Assuming there are 4 entries, the TP values might be 40, 60, 80, 100 ticks.
It should TP each entry to the corresponding value. However it is adding the next TP value to the prior one each time for each entry. So then the TP levels are 40, 100, 180, 280 in this example. Can someone tell me what is causing this?
The print of the short levels are all correct values.
The Stoplimit seems to be having a problem too as it doesnt work, but i assume its the same issue
for (int i = 0; i < EntriesPerTrade; i++)
{
takeProfitShortLevels = execution.Order.AverageFillPrice - TakeProfitLevels[i] * TickSize;
takeProfitLongLevels = execution.Order.AverageFillPrice + TakeProfitLevels[i] * TickSize;
ExitShortLimit(0, true, execution.Order.Filled, takeProfitShortLevels, "Short TP " + i, "Short " + i);
ExitShortStopLimit(0, true, execution.Order.Filled, execution.Order.AverageFillPrice + InitialSLAmount, execution.Order.AverageFillPrice, "Initial Short SL " + i, "Short " + i);
ExitLongLimit(0, true, execution.Order.Filled, takeProfitLongLevels, "Long TP " + i, "Long " + i);
ExitLongStopLimit(0, true, execution.Order.Filled, execution.Order.AverageFillPrice - InitialSLAmount, execution.Order.AverageFillPrice, "Initial Long SL " + i, "Long " + i);
PrintTo = PrintTo.OutputTab2;
Print(DateTime.Now + " " + execution.Order.AverageFillPrice + " short levels: " + i + " " + takeProfitShortLevels);
}
Comment