- Delete Pending Orders
- EA which will take only one trade at a time ?
- How To Close All Open Orders at the touch of the MA Not after the candle close?
Paul:
This means the buy stop should have been set at 1.2803 and the sell stop at 1.2770. Instead the account history shows it bought at 1.28103 and sold at 1.2780.
The stop loss for the buy should have been at 1.2780 and the sell stop should have been at 1.2780. Instead the buy order closed at 1.27894 and the sell order closed at 1.28063. According to the account history the long trade opened at 12:03:54 and closed at 12:04:09 15 sec later and the short trade opened 1 sec later at 12:04:10 and closed 3 seconds later at 12:04:13 This doesn't make any sense on many levels.
I have attached my code. Could someone please tell me if the problem is in my code. As I said it worked great all of this week except for today. And when I run it now at a current hour candle, everything works as programmed. Also, could someone tell me how I post the mql4 code in the right format in this thread.
- Normally I'd post about using points and not PIPs .
A PIP is defined as 0.00010 (or 0.0010 for Yen pairs.)
Percentage in point - WikipediaCode 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 forumbuy_stop_price = high + (buy_points_buffer * Point * 10); sell_stop_price = low - (sell_points_buffer * Point * 10);
But you use point*10 everywhere. Perhaps your broker suddenly went to 6 digits. Market Watch -> right click -> Specification -
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.)
- When you post code please use the SRC button! Please edit your post.
General rules and best pratices of the Forum. - General - MQL5 programming forum
- Normally I'd post about using points and not PIPs .But you use point*10 everywhere. Perhaps your broker suddenly went to 6 digits. Market Watch -> right click -> Specification
-
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.)
- When you post code please use the SRC button! Please edit your post.
General rules and best pratices of the Forum. - General - MQL5 programming forum
Thank you for your reply and suggestions. I will go ahead and make some changes in my program.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use