MY EA DOES NOT EXECUTE PARABOLIC STOP AND REVERSE (PSAR) CODE ON FOREXTIME, BUT IT DOES ON INSTATRADER
maxlifenow: ON FOREXTIME THE EA DID NOT EXECUTE IN THE 4 INSTANCES ...
- Don't SHOUT at us, that is RUDE.
-
When you post code please use the CODE button (Alt-S)!
(For large amounts of code, attach it.) Please edit your (original) post.
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor - Please use the link button
See the difference? https://www.mql5.com/en/charts/8907668/eurusd-m1-fxtm-ft-global https://www.mql5.com/en/charts/8907681/audusd-m1-instaforex-group
Messages Editor - Use the debugger or print out your variables, including _LastError and prices and find out why.
-
Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't
use it. It's use is usually wrong, as it is in this case.
- Print out your values to the precision you want with DoubleToString - Conversion Functions - MQL4 Reference.
- SL/TP (stops) need to be normalized to tick size (not Point.) (On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 and MetaTrader 4 - MQL4 programming forum) and abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 and MetaTrader 4 - MQL4 programming forum
- Open price for pending orders need to be adjusted. On Currencies, Point == TickSize, so you will get the same answer, but it won't work on Metals. So do it right: Trailing Bar Entry EA - MQL4 and MetaTrader 4 - MQL4 programming forum or Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 and MetaTrader 4 - MQL4 programming forum
- Lot size must also be adjusted to a multiple of LotStep and check against min and max. If that is not a power of 1/10 then NormalizeDouble is wrong. Do it right.
iSAR(0,PERIOD_M1,0.02,0.2,3) iOpen(0,PERIOD_M1,0),5);
Your code only works on the M1. Use PERIOD_CURRENT and can work on any timeframe.- There is no symbol zero. Use _Symbol.
- You can use NULL in place of _Symbol only in those calls that the documentation specially says you can. iHigh does, MarketInfo does not. OrderSend does not.
- Don't use NULL (except for pointers where you explicitly check for it.) Use _Symbol and _Period, that is minimalist as possible and more efficient.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
EA CODE:
double m1psar0=NormalizeDouble(iSAR(0,PERIOD_M1,0.02,0.2,0),5);
double m1psar1=NormalizeDouble(iSAR(0,PERIOD_M1,0.02,0.2,1),5);
double m1psar2=NormalizeDouble(iSAR(0,PERIOD_M1,0.02,0.2,2),5);
double m1psar3=NormalizeDouble(iSAR(0,PERIOD_M1,0.02,0.2,3),5);
double m1open0=NormalizeDouble(iOpen(0,PERIOD_M1,0),5);
double m1open1=NormalizeDouble(iOpen(0,PERIOD_M1,1),5);
double m1open2=NormalizeDouble(iOpen(0,PERIOD_M1,2),5);
double m1open3=NormalizeDouble(iOpen(0,PERIOD_M1,3),5);
if( ( GetOrderCount17112(OP_BUY,17112)<1) && (m1psar0<m1open0 && m1psar1>m1open1) ) OPBUY17112();
LINKS FOR CHARTS
https://www.mql5.com/en/charts/8907668/eurusd-m1-fxtm-ft-global
https://www.mql5.com/en/charts/8907681/audusd-m1-instaforex-group
ON FOREXTIME THE EA DID NOT EXECUTE IN THE 4 INSTANCES SHOWN (SEE CHART LINK ABOVE) BUT THE EA EXECUTES OTHER CODES AS CAN BE SE SEEN ON THE TRADE TERMINAL.
SO I DECIDED TO TEST THE SAME EA/CODE ON INSTATRADER AND THE CODE IS EXECUTED (SEE CHART LINK ABOVE).
GRATEFUL FOR YOUR HELP ON WHAT THE PROBLEM IS WITH THE FOREXTIME EA. (BY THE WAY I'M NEW TO MT4 CODING). THANKS.