Hi I'm trying to implement a system which uses different Buy/Sell rules depending on the condition of a certain indicator. I'm using a 100 period linear regression of the Russell 2000 as this indicator.
Cond6 = LinearReg( Foreign( "^RUT", "Close" ),100); Cond7 = Ref( LinearReg(Foreign( "^RUT", "Close" ),100),-1); Buy=C>EMA(Close,100);//Buy signal 1 Sell=C<EMA(Close,100);//Sell signal 1 Buy=RSI(2)<2;Buy signal 2 ApplyStop( stopTypeNBar, stopModeBars,4 );//Sell signal 2 Essentially,if Cond6>Cond7 I wish to use buy/sell signal #1. If not use Buy/Sell signal 2. Have tried IIF Function as well as if-else loop, but no luck so far. Any help would be appreciated Regards Haders
