if (BarsInProgress == 1) return; if (BarsInProgress == 0) { if (Position.MarketPosition == MarketPosition.Flat) { SetTrailStop("", CalculationMode.Ticks, StopLoss, false); StopMove = StopLoss - 1; } // When the median of price crosses above avg high band or across the fast follower line if it is above the avg high band go long. if ((CrossAbove(Median, EMABand(11, 11, 21).AvgHigh, 1 ) || (CrossAbove(Median, EMABand(11, 11, 21).Follow, 1 ) && EMABand(11, 11, 21).Follow[0] > EMABand(11, 11, 21).AvgHigh[0] )) && Position.MarketPosition == MarketPosition.Flat && (BarsSinceExit(1,"",0) > 5 || BarsSinceExit(1,"",0) == -1) && ((ToTime(Time[0]) > TT1_Start && ToTime(Time[0]) < TT1_End ) || (ToTime(Time[0]) > TT2_Start && ToTime(Time[0]) < TT2_End ))) { /* The entry condition is triggered on the primary bar series, but the order is sent and filled on the secondary bar series. The way the bar series is determined is by the first parameter: 0 = primary bars, 1 = secondary bars, 2 = tertiary bars, etc. */ EnterLong(DefaultQuantity, 1, "HIB_L"); } // When the median of price crosses below the avg low band or across the fast follower line if it is below the avg low band go short. else if ((CrossBelow(Median, EMABand(11, 11, 21).AvgLow, 1 ) || (CrossBelow(Median, EMABand(11, 11, 21).Follow, 1 ) && EMABand(11, 11, 21).Follow[0] < EMABand(11, 11, 21).AvgLow[0] )) && Position.MarketPosition == MarketPosition.Flat && (BarsSinceExit(1,"",0) > 5 || BarsSinceExit(1,"",0) == -1) && ((ToTime(Time[0]) > TT1_Start && ToTime(Time[0]) < TT1_End ) || (ToTime(Time[0]) > TT2_Start && ToTime(Time[0]) < TT2_End ))) { /* The entry condition is triggered on the secondary bar series, but the order is sent and filled on the primary bar series. The way the bar series is determined is by the first parameter: 0 = primary bars, 1 = secondary bars, 2 = tertiary bars, etc. */ EnterShort(DefaultQuantity, 1, "HIB_S"); }
Can you let me know if the syntax is correct?
Thanks
DaveN
Comment