-
if(type == OP_BUY)g_tp = Ask + take_profit * tickSize; if(type == OP_SELL)g_tp = Bid - take_profit * tickSize;
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 at 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)
-
- Ernest Akoyi: What I want now is the EA to only rset back to normal lots and tp after the trade has hit the tp and not close positively by opposite close. Kindly help: Below is my cod;
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)
-
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 at 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)
-
-
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)
Hello I think I have stated my problem and also shown the attempt of my work. The above code works perfectly but I only want it to reset the tp and lot upon hitting the tp and not by opposite signal function
Hello I think I have stated my problem and also shown the attempt of my work. The above code works perfectly but I only want it to reset the tp and lot upon hitting the tp and not by opposite signal function
check history, if the order_price > tp for buys (opposite for sells) then reset *tp* ( I think you meant to write lotsize)
check history, if the order_price > tp for buys (opposite for sells) then reset *tp* ( I think you meant to write lotsize)
Hello what I mean is that anytime EA closes in positive the lot and tp will be reset to their original values what I want now is the EA to only reset lot and tp upon hitting the desired tp and not when it closes positive that is by opposite close.
![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
Hello have this function working our perfectly but I want to do some modification on it. Currently when EA has successive number of losses for instance 2 and from the input variable the n_op(number of operation is 3),the EA will increase the lot of the third trade together with the tp by a certain formula as shown in my code. The EA will then reset back to normal lots as long as the trade is closed in profit either by hitting tp or opposite close signal. What I want now is the EA to only rset back to normal lots and tp after the trade has hit the tp and not close positively by opposite close. Kindly help: Below is my cod;