iMA problem (simple)

 

Hi

i wonder if anybody has experienced this problem with iMA. i am creating indicators with two different time frame but when im running it, it doesn't work I am getting the MA from the open chart and not from the time frame that in the code

i want it to work on 15 min and 30 min.

please whats wrong with this code.

Short_MA9 =iMA(NULL,PERIOD_M30,Short_Per9,0, Short_MA_MODE, Short_applied_price_to, shift_short);

MA9=iMA(NULL,0,Per9,PERIOD_M15, Long_MA_MODE, Long_applied_price_to, shift);

thanks

 
MA9 is using 0 for it's timeframe, i.e. "0 means the current chart timeframe."
 

thanks for your help,

It wasnt the problem i miss type its correct in my code but still doesnt work correctly, any ideas

this is my correct code:

Short_MA9 =iMA(NULL,PERIOD_M30,Short_Per9,0, Short_MA_MODE, Short_applied_price_to, shift_short);

MA9=iMA(NULL,PERIOD_M15,Per9,0, Long_MA_MODE, Long_applied_price_to, shift);

 
Add a couple of Print() statements with all the variables used in the iMAs just before these iMAs and make sure the values for them are as you expected.
 
What is shift/shift_short - you can not get bar zero data from the tester
 
WHRoeder:
What is shift/shift_short - you can not get bar zero data from the tester

my shift/ shift_short are = 0. what do you mean you can get bar zero
 

The Strategy Tester has some limitations . . . https://www.mql5.com/en/articles/1512

"Zero bar of another timeframe for the same symbol under test is modeled approximately"

 
birendorf:
my shift/ shift_short are = 0. what do you mean you can get bar zero
WHY didn't you read the link I posted before replying?
Reason: