price = SymbolInfoDouble(Symbol(),SYMBOL_ASK)+offs*point; sl = price-stopLoss*point; tp = price+takeProfit*point;
- We have no idea what offs, stopLoss, or takeProfit is.
You can't move stops (or pending prices) closer to the market than the minimum
(MODE_STOPLEVEL * _Point / SymbolInfoInteger(SYMBOL_TRADE_STOPS_LEVEL).)
Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial -
You buy at the Ask and sell at the Bid.
- Your buy order's TP/SL are triggered when the Bid reaches it. Not the Ask.
-
Your sell order's TP/SL will be triggered when the Ask reaches it. To trigger at
a specific Bid price, add the average spread.
MODE_SPREAD (Paul) - MQL4 and MetaTrader 4 - MQL4 programming forum - Page 3 - The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools -> Options {control-O} -> charts -> Show ask line.)
#whroeder1
Hello and thanks for your reply, even though in the meantime I have found the issue and fix it.
Only a question about when you wrote: "You buy at the Ask and sell at the Bid.
- Your buy order's TP/SL are triggered when the Bid reaches it. Not the Ask.
- Your sell order's TP/SL will be triggered when the Ask reaches it. To trigger at a specific Bid price, add the average spread.
I perfectly know it... but I have to fix my SL when BID reaches the price order (i.e. ASK price) less the TP pips I have established; so sl = bid_price-deltaPip is OK.
The same for TP.
Regards
actually, what code is that?
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
Hello to everybody,
I try to run this chunk of code
But, instead of place a buy stop order, I always get the message "Buy Operation not OK".
What's wrong ?
Davide