My MFI expert advisor. If the position is in the overbought or sell zone after closing, it opens a
new position immediately. Idont want this. I want it to open when the MFI indicator exits the overbought or oversold region and re-enters.
What command should be added? Help please.
Files:
MFInew_ea.mq4
6 kb
- Opening and Closing Positions - Trade - MetaTrader 5 for Android
- Opening and Closing Positions - Trade - MetaTrader 5 for iPhone
- Market Execution - Opening and Closing Positions - Trade - MetaTrader 5 for Android
- Look for a cross only once per bar
For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart,) volume is unreliable (miss ticks,) Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
New candle - MQL4 programming forum -
double mfi=iMFI(Symbol(),0,MFIperiod,0); double mfi1=iMFI(Symbol(),0,MFIperiod,1);
There is only one tick difference between these to values initially. And you may get multiple crosses as the candle forms. Look at bars 1 and 2.
cemun:
My MFI expert advisor. If the position is in the overbought or sell zone after closing, it opens a new position immediately. Idont want this. I want it to open when the MFI indicator exits the overbought or oversold region and re-enters. What command should be added? Help please.
My MFI expert advisor. If the position is in the overbought or sell zone after closing, it opens a new position immediately. Idont want this. I want it to open when the MFI indicator exits the overbought or oversold region and re-enters. What command should be added? Help please.
Hello,
try this version of code.
I made some change.
Files:
MFInewEA_v3.mq4
6 kb
Thank you.
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