Hello. Sometimes I think that I have already gone head over heels and as a result everything is bad, but no. There is 1 Expert Advisor, goes on the signal, then goes on tp and sl. The dose rises and gradually comes out. If I run it simply, click Debug on historical data in MetaEditor, then at the beginning of the trade, such transactions are obtained
But if I put Breakpoint at the moment of conditions different in Sl and Tp and just run the EA through ctrl F11, then the deals are already obtained according to the condition.
That is, if the close exceeds sl, the EA should open the opposite trade with 1 lot. What could it possibly be?
Here is the entire action code for this period
fresto
In the end, I decided everything, I did not notice that the transaction was in the end 1 and in the condition I wrote
if(m_position.Volume()==1.0)
{
mytrade.PositionClose(SellTicket);
Sell_opened=false;
}
And I wrote down the ticket from the previous opening of the second to the short, and the ticket for the first opening disappeared from me.
As a result, you need to record like this
if(m_position.Volume()==1.0)
{
mytrade.PositionClose(m_position.Ticket());
Sell_opened=false;
}
This is a universal option
fxsaber
Almost offtop. In several dialogues, I could not grasp the essence of the problems that I was told about. Well, I didn’t understand what it was about. As a result, the opponent recorded a two-minute video where he showed the problem and… in two minutes I understood absolutely everything that I could not do in the half-hour dialogue. Therefore, I recommend recording a video with the problem, because, probably, not only I did not understand anything. Save everyone’s time.