for(int i = limit-1; i >= 0; i--) { if(iHigh(NULL,PERIOD_M30,i) > iHigh(NULL,PERIOD_M30,1+i)
-
Why did you post your MT4 question in the
Root /
MT5 General section
instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. - You are mixing apples and oranges.
- See How to do your lookbacks correctly for repainting all M30 bar zero bars
whroeder1:
sorry to post the message in wrong section, can I shift my post to the correct section ? Can you help to modify the code please
-
Why did you post your MT4 question in the
Root /
MT5 General section
instead of the
MQL4 section, (bottom of the Root page?)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Next time post in the correct place. The moderators will likely move this thread there soon. - You are mixing apples and oranges.
- See How to do your lookbacks correctly for repainting all M30 bar zero bars
SIRAJ Multani :
Hello Coders,
I am new to coding mql4, I was trying to code a simple MTF indicator based on simple Logic. But when I attached the indicator to the chart. On M30 the arrows are showing fine, But when I switch to M5 I cant see the Arrow, can you please modify my code so that the arrows can be seen on M5 or any other time frame too.
Regards,
Siraj
Date & time of historical data are different between 5 minutes and 30 minutes, you have to adjust then using "iBarShift" as follows.
for(int i = limit-1; i >= 0; i--) { int y = iBarShift(NULL, PERIOD_M30, Time[i], false); if(iHigh(NULL,PERIOD_M30,y) > iHigh(NULL,PERIOD_M30,1+y) && iHigh(NULL,PERIOD_M30,1+y) < iHigh(NULL,PERIOD_M30,1+y+1) //Candlestick High crosses above Candlestick High && iClose(NULL,PERIOD_M30,y) == Close[i] )
Naguisa Unada:
Wow......what a fantastic solution ....I have never taught about that.............I have become your FAN my friend........Thank you so so much !!!
Date & time of historical data are different between 5 minutes and 30 minutes, you have to adjust then using "iBarShift" as follows.
for(int i = limit-1; i >= 0; i--) { int y = iBarShift(NULL, PERIOD_M30, Time[i], false);Since the source data is a higher TF, you must reprocess all source bar zero values to get the stair step effect, (one source bar, multiple chart bars.)
How to do your lookbacks correctly № 9 through #14.
![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
Hello Coders,
I am new to coding mql4, I was trying to code a simple MTF indicator based on simple Logic. But when I attached the indicator to the chart. On M30 the arrows are showing fine, But when I switch to M5 I cant see the Arrow, can you please modify my code so that the arrows can be seen on M5 or any other time frame too.
Regards,
Siraj