Code example below, as output by the strategy builder.
Code will compile and run in the editor fine, which is OK, if you no longer want to use the builder...
if (BarsInProgress != 0) return; if (CurrentBars[0] < 3) return; // Set 1 if ((Close[2] > DonchianChannel1.Mean[0]) && (Close[1] < DonchianChannel1.Mean[0]) && (Close[3] < DonchianChannel1.Mean[0])) { EnterLong(Convert.ToInt32(2), ""); ExitLongLimit(Convert.ToInt32(1), (DonchianChannel1.Upper[0] + (-4 * TickSize)) , @"", ""); ExitLongLimit(Convert.ToInt32(1), (Position.AveragePrice + (3 * TickSize)) , "", ""); }
Comment