Mohamed Mostafa Mohamed Sonbol:
Hi!do i have to get the SL value and place it again if i want to change only TP value ?
cause placing a 0 delete my SL value .
thanks !
Yes
Mohamed Mostafa Mohamed Sonbol: do i have to get the SL value and place it again if i want to change only TP value ? cause placing a 0 delete my SL value .
Yes, for the PositionModify method function, you have to supply both the Stop-Loss and Take-Profit prices, even if you only want to change one of them.
Please refer to the documentation ...
Parameters
sl
[in] The new price by which the Stop Loss will trigger (or the previous value, if the change is not necessary).
tp
[in] The new price by which the Take Profit will trigger (or the previous value, if the change is not necessary).
Documentation on MQL5: Standard Library / Trade Classes / CTrade / PositionModify
- www.mql5.com
PositionModify(const string,double,double) - CTrade - Trade Classes - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
do i have to get the SL value and place it again if i want to change only TP value ?
cause placing a 0 delete my SL value .
thanks !