mocs520: . wrong stop loss at -100 rather than enter_price-100
input int SL = 100; ⋮ rq.sl = NormalizeDouble(sl, SymbolInfoInteger(txs.symbol, SYMBOL_DIGITS));
- A Stop Loss is a price. There is a difference between setting the SL to 100 vs. setting it the open price - 100, vs. setting it the open price - 100 points.
-
Using Point means code breaks on 4 digit brokers, exotics (e.g. USDZAR
where spread is over 500 points,) and metals. Compute what a PIP is and use it,
not points.
How to manage JPY pairs with parameters? - MQL4 and MetaTrader 4 - MQL4 programming forum
Slippage defined in index points - Currency Pairs - Expert Advisors and Automated Trading - MQL5 programming forum
William Roeder:
@ William, Thank you for your reply. I tried to fix it, but no luck yet. Thank you again.
- A Stop Loss is a price. There is a difference between setting the SL to 100 vs. setting it the open price - 100, vs. setting it the open price - 100 points.
-
Using Point means code breaks on 4 digit brokers, exotics (e.g. USDZAR
where spread is over 500 points,) and metals. Compute what a PIP is and use it,
not points.
How to manage JPY pairs with parameters? - MQL4 and MetaTrader 4 - MQL4 programming forum
Slippage defined in index points - Currency Pairs - Expert Advisors and Automated Trading - MQL5 programming forum
mocs520:
You forgot to use the HistoryDealSelect.

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
Any help or reference will be very appreciated. By the way, this is my first mql5 code I ever work. So, I am clearly novice. Thank you.