I do already have them listed as variables.
protected override void OnExecution(IExecution execution)
{
if (LongLimit != null && LongLimit == execution.Order)
{
if (execution.Order.OrderState == OrderState.Filled)
{
ExitLongStop(AvgPrice-(execution.Price - AvgPrice),"LongStopB","LongEntryB");
}
/*After the Entry B stop has made it initial move, we then wait for the SMA to catch up to the price. When it catches up, then the Stop loss should trail the SMA. The distance that it trails below the SMA (for longs) will be the ((SignalCandle High) - (Signal Candle Low)*StopPerc). The Trailing Stop should naturally only go up and never go down in case the SMA begins to turn downward. */
if (SMA(sMAPeriod)[0] - ((SignalHigh - SignalLow)*StopPerc) > LongStopB.StopPrice)
{
ExitLongStop(SMA(sMAPeriod) - ((SignalHigh - SignalLow) * StopPerc), "LongStopB", "LongEntryB") ;
}
}
}
- SignalHigh
- LongLimit
- AvgPrice
- SignalLow
They are established in the Variables section
- private double SignalHigh
- private double SignalLow
- private IOrder LongLimit

Comment