//--------------------------------------------------------------------
// Trading rule: Trading signals (On Bar Open)
//--------------------------------------------------------------------
LongEntrySignal = Detrended Price Oscillator(Main chart,DPOLevelPeriod1)[1] is above 0.01;
ShortEntrySignal = Detrended Price Oscillator(Main chart,DPOLevelPeriod1)[1] is below 0.01;
LongExitSignal = (Open below BollingerBands(Main chart,BBBarOpensPeriod1, 2, PRICE_MEDIAN).UpperBand
and (CCI(Subchart1, D1,CCIPeriod1, PRICE_CLOSE)[2] is falling));
ShortExitSignal = (Open above BollingerBands(Main chart,BBBarOpensPeriod1, 2, PRICE_MEDIAN).LowerBand
and (CCI(Subchart1, D1,CCIPeriod1, PRICE_CLOSE)[2] is rising));
Should be this:
//--------------------------------------------------------------------
// Trading rule: Trading signals (On Bar Open)
//--------------------------------------------------------------------
LongEntrySignal = Detrended Price Oscillator(Main chart,DPOLevelPeriod1)[1] is above 0.01;
ShortEntrySignal = Detrended Price Oscillator(Main chart,DPOLevelPeriod1)[1] is below -0.01;
LongExitSignal = (Open below BollingerBands(Main chart,BBBarOpensPeriod1, 2, PRICE_MEDIAN).UpperBand
and (CCI(Subchart1, D1,CCIPeriod1, PRICE_CLOSE)[2] is falling));
ShortExitSignal = (Open above BollingerBands(Main chart,BBBarOpensPeriod1, 2, PRICE_MEDIAN).LowerBand
and (CCI(Subchart1, D1,CCIPeriod1, PRICE_CLOSE)[2] is rising));