I have this code. It is suppose to reverse the whole strategy. It should close open positions, cancel orders and, also, submit orders and positions in the other direction. However, the algorithm is close open positions and cancelling orders, but it is not submitting orders or positions in the other side. Would you please help me finding the solution? I don't see the error.
Also, if you need the full code or a bigger piece, I need to send it privately. Thank you so much in advance!
if ( TimeToTrade() && barNumberOfShortEntries == 0 && okToEnter )
{
if (ShortSignal())
{
//Reverse if we are long or have open long orders
if ( Position.MarketPosition == MarketPosition.Long || barNumberOfLongEntries > 0 )
{
LongReverse();
}
PlaceShortEntries();
}
}
Comment