I was looking for information in the community for not ask again what was asked, but the invalid stops are being shown for me too, but... only for selling positions, very weird, since I only have to change the logical inverting it for selling, it's the only difference from buy.
It's giving this problem a lot of times only for sell, for buy it's ok.
Hi,
i can't see clearly your logic, but i have doubt about two needs:
first one: if trailingStop in any profit and starting from start of trade:
if(symbolSell == Symbol()) if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL) if(m_position.StopLoss() > m_position.PriceCurrent() + (breakStep01*_Point)||!m_position.StopLoss()) trade.PositionModify(PositionGetTicket(bSell),m_position.PriceCurrent() + (breakStep01*_Point),m_position.TakeProfit());
else if trailingStop in positiv profit and starting from 0 minimum:
if(symbolSell == Symbol()) if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_SELL) if((m_position.StopLoss() > m_position.PriceCurrent() + (breakStep01*_Point)||!m_position.StopLoss())&&m_position.PriceCurrent() + (breakStep01*_Point)<m_position.PriceOpen()) trade.PositionModify(PositionGetTicket(bSell),m_position.PriceCurrent() + (breakStep01*_Point),m_position.TakeProfit());
Hi,
i can't see clearly your logic, but i have doubt about two needs:
first one: if trailingStop in any profit and starting from start of trade:
else if trailingStop in positiv profit and starting from 0 minimum:
I used something about Allowed freeze level and now it's ok, the weird is that no errors shown for EURUSD about it, but there are also spread errors, a lot, perhaps a bug or if it shows these errors they have to exist? Thanks for your help!
EDITED
The error still persists, but less, I checked a longer period, from more than 1 year, but few errors about breakeven.
I used something about Allowed freeze level and now it's ok, the weird is that no errors shown for EURUSD about it, but there are also spread errors, a lot, perhaps a bug or if it shows these errors they have to exist? Thanks for your help!
EDITED
The error still persists, but less, I checked a longer period, from more than 1 year, but few errors about breakeven.
hi,
yes right, this depending on rules of your broker such as stoplevel...
you should synchronize it, my solution is only for asked problem not to solve all details.
thank you :)
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I was looking for information in the community for not ask again what was asked, but the invalid stops are being shown for me too, but... only for selling positions, very weird, since I only have to change the logical inverting it for selling, it's the only difference from buy.
It's giving this problem a lot of times only for sell, for buy it's ok.