I would like to place a market order with a SL and a TP. If my understanding is right, it must be split into an EnterLong() and an ExitLongStopLimit() order. How can I make sure, that the ExitLongStopLimit() is only executet once for every order.
Eg.
if ( ..)
{
EnterLong();
ExitLongStopLimit(tp, sl);
}
will cause an execution of the ExitLongStopLimit() even if the EnterLong is not executed due to the "Entries per direction" limit.
It is possible to get the number of positions during backtests?
if (Performance.LongTrades.Count == 0)
{
EnterLong();
ExitLongStopLimit(tp, sl);
}
seems not to work during backtests.
Best Regards
Thomas
Comment