can you please print this:
Print("USDCHF: ",iTime("USDCHF", PERIOD _M1,0)," ",Symbol(),": ",iTime(Symbol(), PERIOD _M1,0));
and show it here?
Hi,
By using iTime() I found an interesting situation
I have opened the USDCHF M1 chart, and put into a script Print(iTime("USDCHF", PERIOD _M1,0)) it returned with 0.
When I replaced "USDCHF" with Symbol() , Print(iTime(Symbol(), PERIOD _M1,0)); worked well.
You should have received a compiler error for PERIOD and _M1 there should be no space. If that is just a typo then the most likely issue is that you have an incorrect symbol name, please post a screen shot of your USDCHF M1 chart so we can check that the symbol name is actually USDCHF and not USDCHFx or something else that is not USDCHF . . .
Note:
Hi,
Thank you for your respond
Here is the test script I wrote, and I also attached the screenshot of the output
//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
int i=1;
string curr= "USDCHF";
Print( Time[0]," " ,iTime(curr,PERIOD_M1,0), " ");
Alert (GetLastError());
Print("Current bar for USDCHF M1: ",iTime("USDCHF",PERIOD_M1,i),", ", iOpen(Symbol(),PERIOD_M1,i),", ",
iHigh("USDCHF",PERIOD_M1,i),", ", iLow("USDCHF",PERIOD_M1,i),", ",
iClose("USDCHF",PERIOD_M1,i),", ", iVolume("USDCHF",PERIOD_M1,i));
Print("USDCHF: ",iTime("USDCHF", PERIOD_M1,0)," ",Symbol(),": ",iTime(Symbol(), PERIOD_M1,0));
//----
return(0);
}
//+------------------------------------------------------------------+
Hi,
Thank you for your respond
Here is the test script I wrote, and I also attached the screenshot of the output
<CODE DELETED>
Hi,
Thank you for your respond
Here is the test script I wrote, and I also attached the screenshot of the output
Here is what your script outputs on my terminal:
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
int start() { //---- int i=1; string curr= "USDCHF"; Print( Time[0]," " ,iTime(curr,PERIOD_M1,0), " "); Alert (GetLastError()); Print("Current bar for USDCHF M1: ",iTime("USDCHF",PERIOD_M1,i),", ", iOpen(Symbol(),PERIOD_M1,i),", ", iHigh("USDCHF",PERIOD_M1,i),", ", iLow("USDCHF",PERIOD_M1,i),", ", iClose("USDCHF",PERIOD_M1,i),", ", iVolume("USDCHF",PERIOD_M1,i)); Print("USDCHF: ",iTime("USDCHF", PERIOD_M1,0)," ",Symbol(),": ",iTime(Symbol(), PERIOD_M1,0)); //---- return(0); } //+------------------------------------------------------------------+
Here is what your script outputs on my terminal:
I get this . . .
2013.06.05 17:00:30 iTime-Test USDCHF,M1: removed
2013.06.05 17:00:30 iTime-Test USDCHF,M1: uninit reason 0
2013.06.05 17:00:30 iTime-Test USDCHF,M1: USDCHF: 1370458800 USDCHF: 1370458800
2013.06.05 17:00:30 iTime-Test USDCHF,M1: Current bar for USDCHF M1: 1370458740, 0.9424, 0.9424, 0.9421, 0.9421, 26
2013.06.05 17:00:30 iTime-Test USDCHF,M1: Alert: 0
2013.06.05 17:00:30 iTime-Test USDCHF,M1: 1370458800 1370458800
2013.06.05 17:00:29 iTime-Test USDCHF,M1: loaded successfully
Thanks, I followed your advice Mr RaptorUK
int start() { //---- int i=1; string curr= "USDCHF"; Print( Time[0]," " ,iTime(curr,PERIOD_M1,0), " "); Alert (GetLastError()); // Print("Current bar for USDCHF M1: ",iTime("USDCHF",PERIOD_M1,i),", ", iOpen(Symbol(),PERIOD_M1,i),", ", // iHigh("USDCHF",PERIOD_M1,i),", ", iLow("USDCHF",PERIOD_M1,i),", ", // iClose("USDCHF",PERIOD_M1,i),", ", iVolume("USDCHF",PERIOD_M1,i)); Print("USDCHF: ",iTime("USDCHF", PERIOD_M1,0)," ",Symbol(),": ",iTime(Symbol(), PERIOD_M1,0)); if (Symbol()!= "USDCHF") Print(" DIFF" , Symbol(), "USDCHF"); else Print ("OK"); //---- return(0); }
I modified the script it seems so that Symb not equal with "EURUSD"
Any idea
Thank you:
Ferenc

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
By using iTime() I found an interesting situation
I have opened the USDCHF M1 chart, and put into a script Print(iTime("USDCHF", PERIOD _M1,0)) it returned with 0.
When I replaced "USDCHF" with Symbol() , Print(iTime(Symbol(), PERIOD _M1,0)); worked well.
Can somebody help me ?
Thank you
F.