joshatt:
You have 4 times as many bars on M15 than on H1 so your limit value may well be incorrect.
Hi,
I'm writing a code which is used in Visual Mode(F12), it's to simply draw candles of different timeframe.
Say I'm in M15 chart, and I want to draw H1 candles in separate window. I did a test : draw a line with "iHigh", time is in year 2009. It's odd: the indicator line value is actually today's value: 1.3420. But in the main chart I can see candle high is 1.48xx, in year 2009.
for(int i=0; i<limit; i++) ind_buffer1[i]=iHigh(NULL,60,i);Don't mid apples and oranges
for(int iChart=0; iChart<limit; iChart++){ int iH1 = iBarShift(NULL, PERIOD_H1, Time[iChart]); ind_buffer1[iChart]=iHigh(NULL,60,iH1); }
Works great! Thanks a lot.

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
Hi,
I'm writing a code which is used in Visual Mode(F12), it's to simply draw candles of different timeframe.
Say I'm in M15 chart, and I want to draw H1 candles in separate window. I did a test : draw a line with "iHigh", time is in year 2009. It's odd: the indicator line value is actually today's value: 1.3420. But in the main chart I can see candle high is 1.48xx, in year 2009.
The code is as usual:
The data (M15 and H1 and others) was created with "period converter auto".
Any idea?