Problem with ILOW

 

when i coded like this in my 2minutes Timeframe chart

double lowerPriceForToday=iLow(Symbol(),PERIOD_D1,0);
it gives me correct value,


but this

double lowerPriceForThisWeek=iLow(Symbol(),PERIOD_W1,0);
nothing happen but no errors found in compiling. anybody helps!
 
MT4 or MT5?
 
MikelDavao:

when i coded like this in my 2minutes Timeframe chart

it gives me correct value,


but this

nothing happen but no errors found in compiling. anybody helps!

it is working (MT4)

 

On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
          Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4 2019.05.20

On MT5: Unless the chart is that specific pair/TF, you must synchronize the terminal Data from the Server before accessing candle/indicator values.
          Is it mystical?! It is! - Withdraw - Technical Indicators - MQL5 programming forum
          Timeseries and Indicators Access / Data Access - Reference on algorithmic/automated trading language for MetaTrader 5
          Synchronize Server Data with Terminal Data - Symbols - General - MQL5 programming forum
          SymbolInfoInteger doesn't work - Symbols - General - MQL5 programming forum 2019.09.03
          OnCalculate during weekend MT5 - General - MQL5 programming forum

 
To All who give effort and assistance of my little problems, i give you two thumbs up, as of today case is SOLVE!. THANK YOU ALL OF YOU. happy coding.
 
MikelDavao:


nothing happen but no errors found in compiling. anybody helps!

is there data on your W1 Chart. 
check 

Make Script

OnStart(){printf("Bars on week Period: %d",iBar(Symbol(),PERIOD_W1));}
Reason: