protected override void OnBarUpdate()
{[INDENT]SetStopLoss("Average Down Short", CalculationMode.Ticks, AverageDownSL, false);
EnterShortLimit(0, false, ReentryQty, AverageDownEntry, "Average Down Short");
if (AverageDownSet && !AverageDownExecuted)
{
SetProfitTarget(CalculationMode.Price, AverageDownTP);
AverageDownExecuted = true;
}[/INDENT]
}
protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
{
if (execution.Order.Name == "Average Down Long" || execution.Order.Name == "Average Down Short")
{
AverageDownSet = true;
}
}

Comment