I am trying to write a program that has 3 possible trade exists. The basic structure is:
Buy = buy code
SellOrder1 = Sell condition 1 (profit target - such as High > Bollinger band)
SellOrder2 = Sell condition 2 (based on some indicator such as CCI slope < 0)
Sell order3 = Sell condition3 (Trailing stop)
SellOrder 1 and sell order 2 may use ApplyStop() function
I want to have a result of the earliest exit signal to be the one that takes effect and closes the trade.
Sell = SellOrder1 OR SellOrder2 OR SellOrder3;
Is the above appropriate code to achieve my objective or do I need to use CBT and process signals bar by bar and test for each condition sequensially?
Any other options?