I would appreciate if anyone could help provide a simple example.
Here is what I'm trying as a simple example:
protected override void OnBarUpdate()
if (Close[0] > Close[1])
{
EnterLong(DefaultQuantity, "L1");
Variable0 = (Low[0]);
SetStopLoss("L1", CalculationMode.Price, Variable0 , false);
}
if (BarsSinceEntry() >= 1)
ExitLong("L1");
if (stopLoss is triggered)
{
EnterShort(DefaultQuantity, "S1");
Variable1 = (High[0]);
SetStopLoss("S1", CalculationMode.Price, Variable1 , false);
}
if (BarsSinceEntry() >= 1)
ExitShort("S1");
Comment