Step up trailing stop loss only on a potential exit setup

The various standard trailing stop loss processes does not fit with my strategy.
I am trying to modify the coding, copied from the Library, called "Chandelier Exit", but having no success. I have done some simple coding using the process
for( i = 1; i < BarCount; i++ )
but I cannot get this to work in my objective, as defined below.

My objective, on a Long trade is to set the Initial Stop Loss below the entry bar, then to move the Trailing Stop Loss up, ONLY when an event occurs that could cause an Exit from the Long trade, when using a Stop Order. (I seldom use a Market order).
I have several Potential Exit Setups,(ExitCond_1, ExitCond_2, ExitCond_3, etc) each with their own margin below the Low of the Setup bar. This margin is adjusted with reference to the Probability of the Exit Setup Event occurring, ie, low probability will produce a large margin, whereas a high probability will produce a narrow/tight margin, for the Stop Order. In the extreme case, the margin will be zero, meaning to sell at market on close of bar.
I think that I have studied every example of code, relevant to the above, with the "Chandelier Exit" being the best, but leading only to frustration.
Any help would be most appreciated, thank you.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.