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 am trying to code an indicator which uses another timeframe for same symbol. I dont want to open this other timeframe's chart for updating its data. I am using ArrayCopyRates for that pupose. This indic should run for the FIRST time and then for only FIRST TICK of new bar of other timeframe. İ tried two ways but none of them worked correctly.
1st way:
2nd way:
I also tried combination of this two way, but result is same. I have encountered below situations ( for example we use daily as other timeframe ):
1- if there is NO history in history folder, two behaviours:
a) if indic is dragged and dropped on an open chart, works CORRECTLY.
b) if MT4 Terminal is newly opened or restarted with open chart which has the indic attached, Terminal LOCKS.
2- if there is OLD history in history folder, indic is calculated with WRONG data.
I could solve some above problems with checking if Terminal is connected to server or not. But this time new problems have come and indic is calculated with WRONG data, all data is 0, etc...
I also tried to check if there is any data in newRates[ 0 ][ 0 ] and newRates[ 1 ][ 0 ] and compare if newRates[ 0 ][ 0 ] has updated data according to TimeCurrent and alot of way... There may be mixed dates while downloading new data in 0 and 1 indexed array elements. I didnt look further.
Any suggestion is very appreciated.
Thank you very much.