protected override void Execute() { double jumppct = paramMult.Value; int mode = paramMode.ValueInt; double factor = paramChEx.ValueInt; ChandelierLong cl = new ChandelierLong(Bars, factor); PlotStops(); SetBarColors(Color.Silver, Color.Silver); for (int bar = 50; bar < Bars.Count; bar++) { if (shoulderette(bar, jumppct, mode)) SetBarColor(bar, Color.Blue); if (IsLastPositionActive) { Position p = LastPosition; if (!SellAtStop(bar + 1, p, cl[bar], "Chandelier")) { if (shoulderette(bar, jumppct, mode)) if (p.NetProfitAsOfBarPercent(bar) > 20) SellAtLimit(bar + 1, p, Close[bar], "Shoulderette"); } } else { if (BuyAtStop(bar + 1, High[bar - 20] + (4 * ATR.Series(Bars, 14)[bar])) != null) LastPosition.Priority = -Close[bar]; } } }
public static ChandelierLong Series(Bars bars, double Factor) { ChandelierLong _ChandelierLong = new ChandelierLong(bars, Factor); return _ChandelierLong; }