You buy at the Ask and sell at the Bid. Pending Buy Stop orders become market orders when hit by the Ask.
-
Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice reaches it. Using Ask±n, makes your SL shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?
-
Your sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask / OrderClosePrice reaches it. To trigger close to a specific Bid price, add the average spread.
MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25 -
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.)
Most brokers with variable spreads widen considerably at end of day (5 PM ET) ± 30 minutes.
My GBPJPY shows average spread = 26 points, average maximum spread = 134.
My EURCHF shows average spread = 18 points, average maximum spread = 106.
(your broker will be similar).
Is it reasonable to have such a huge spreads (20 PIP spreads) in EURCHF? - General - MQL5 programming forum (2022)
You buy at the Ask and sell at the Bid. Pending Buy Stop orders become market orders when hit by the Ask.
-
Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice reaches it. Using Ask±n, makes your SL shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?
-
Your sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask / OrderClosePrice reaches it. To trigger close to a specific Bid price, add the average spread.
MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25 -
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.)
Most brokers with variable spreads widen considerably at end of day (5 PM ET) ± 30 minutes.
My GBPJPY shows average spread = 26 points, average maximum spread = 134.
My EURCHF shows average spread = 18 points, average maximum spread = 106.
(your broker will be similar).
Is it reasonable to have such a huge spreads (20 PIP spreads) in EURCHF? - General - MQL5 programming forum (2022)
Hello, everyone. My name is David, and although I am still learning MQL5. I am having trouble getting my bot to close out positions. I want the ask line to cancel out any buy positions on that
currency pair and switch to selling when it drops below the 50 MA (Mavalue), and the bid line to do the opposite when it rises above the 50 MA (MaValue) and switches to buying. This is my code.
I kindly ask for your assistance with this.
- TSHIMENA Gauthier #: Hi there William, could please assist me with my code too. I want to cancel the TP and SL so that my buy position will close when the fast MA crosses the slow Ma and via versa for Sell position.
Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
No free help (2017)Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2018)We're not going to code it for you (although it could happen if you are lucky or the issue is interesting).
No free help (2017) -
Don't Hijack other threads for your off-topic post. Next time, make your own, new, thread.
Don't double post!
General rules and best pratices of the Forum. - General - MQL5 programming forum (2017)
I want to know how is working
When the BID is below the 10 M.A and 200 M.A is greater than the 50 M.A which is greater than 10 M.A it sells and when the ASK is above 10 M.A is greater than the 50 M.A which is greater than the 200 M.A it buys. I want it to close an open buy position if the ASK goes below the 50 M.A at the same time open a sell trade and should do same when the bid goes above the 50 M.A it should close the sell trade and at the same time open a buy trade.
When the BID is below the 10 M.A and 200 M.A is greater than the 50 M.A which is greater than 10 M.A it sells and when the ASK is above 10 M.A is greater than the 50 M.A which is greater than the 200 M.A it buys. I want it to close an open buy position if the ASK goes below the 50 M.A at the same time open a sell trade and should do same when the bid goes above the 50 M.A it should close the sell trade and at the same time open a buy trade.
It makes absolutely no sense to use the Ask's position relative to MAs that are calculated using the Bid.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, everyone. My name is David, and although I am still learning MQL5. I am having trouble getting my bot to close out positions. I want the ask line to cancel out any buy positions on that
currency pair and switch to selling when it drops below the 50 MA (Mavalue), and the bid line to do the opposite when it rises above the 50 MA (MaValue) and switches to buying. This is my code.
I kindly ask for your assistance with this.