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
I guess we are back to the beginning question.
I would like to use the functons iTime, iClose, iOpen, iHigh, etc. What is the recommended technique to use these functions for different time frames and currency pairs in an EA attached to a single chart?
try
I don't see how the "Sleep" function will help. The question is: What needs to be done, so that iTime doesn't return a zero value for a different currency pair/time frame then exists on the chart.
It "sleeps" while waiting for the time array to be updated
The problem is that there isn't history data for the currency pairs and time frames that I am using the "I" functions for. (This is why iTime returned 0) The sleep function won't produce or update these local files.
I will open up a new topic which is really what I was hoping to address here.
I would like to use the functons iTime, iClose, iOpen, iHigh, etc. What is the recommended technique to use these functions for different time frames and currency pairs in an EA attached to a single chart? Do I have to open up a chart for all of currency pairs and time frame combinations I wish to access? I was hoping to update the local history data within the EA without having to create a chart for each combination.
The problem is that there isn't history data for the currency pairs and time frames that I am using the "I" functions for. (This is why iTime returned 0) The sleep function won't produce or update these local files.
WOW, you sure ?
I will open up a new topic which is really what I was hoping to address here.
don't bother
the only thing you should bother is:why wasting other people's time when you even didn't bother to test their suggestions
I would like to use the functons iTime, iClose, iOpen, iHigh, etc. What is the recommended technique to use these functions for different time frames and currency pairs in an EA attached to a single chart? Do I have to open up a chart for all of currency pairs and time frame combinations I wish to access? I was hoping to update the local history data within the EA without having to create a chart for each combination.
tell us what you find
The problem is that there isn't history data for the currency pairs and time frames that I am using the "I" functions for. (This is why iTime returned 0) The sleep function won't produce or update these local files.
I will open up a new topic which is really what I was hoping to address here.
I would like to use the functons iTime, iClose, iOpen, iHigh, etc. What is the recommended technique to use these functions for different time frames and currency pairs in an EA attached to a single chart? Do I have to open up a chart for all of currency pairs and time frame combinations I wish to access? I was hoping to update the local history data within the EA without having to create a chart for each combination.
The Sleep function won't update the files, the initial call to iTime etc will
Sleep just allows some time for the data to update.
I used this code for an exotic pair that I knew there was no history for
for(int x=0;x<100;x++) { datetime t=iTime("USDCNH",PERIOD_M30,0); double h=iHigh("USDCNH",PERIOD_M30,0); Print("Time is ",TimeToStr(t,TIME_MINUTES),", High is ",DoubleToStr(h,4)); if(t==0 || h==0) Sleep(100); else break; }
The prints were
15:53:35 a1 GBPUSD,M15: initialized
15:53:35 a1 GBPUSD,M15: Time is 00:00, High is 0.0000
15:53:35 a1 GBPUSD,M15: Time is 00:00, High is 0.0000
15:53:35 a1 GBPUSD,M15: Time is 00:00, High is 0.0000
15:53:35 a1 GBPUSD,M15: Time is 00:00, High is 0.0000
15:53:35 a1 GBPUSD,M15: Time is 00:00, High is 0.0000
15:53:35 a1 GBPUSD,M15: Time is 00:00, High is 0.0000
15:53:35 a1 GBPUSD,M15: Time is 00:00, High is 0.0000
15:53:35 a1 GBPUSD,M15: Time is 00:00, High is 0.0000
15:53:35 a1 GBPUSD,M15: Time is 00:00, High is 0.0000
15:53:35 a1 GBPUSD,M15: Time is 00:00, High is 0.0000
15:53:36 a1 GBPUSD,M15: Time is 00:00, High is 0.0000
15:53:36 a1 GBPUSD,M15: Time is 11:30, High is 6.2217
15:53:36 a1 GBPUSD,M15: uninit reason 0
So it took just over a second and history now exists where it didn't before
Aren't sleep used for making the ea idle itself for awhile without doing anything?
correct, but, he needs the data before continuing
so he has no choice but sleep