How to display MA from another timeframe? New comment [Deleted] 2011.05.02 15:47 I am trying to write indicator that shows Daily EMA disregarding to current chart timeframe. And i found that i have no idea how to accomplish it. Code: for(int i=0; i<limit; i++) { ExtMapBuffer1[i]=iMA(NULL,PERIOD_D1,9,0,MODE_EMA,PRICE_CLOSE,i); } Does not work, because BarNumber (variable i) has a different meaning in current timeframe and D1. Any help? Can you please help... Show daily MA on any timeframe? iBarShift at no standard graph ... zzuegg 2011.05.02 15:51 #1 You have to use iBarShift to get the index value from another timeframe. //z [Deleted] 2011.05.02 16:04 #2 Thank you zzuegg. Sorry can't check at the moment, but as i am understand code should be like following: for(int i=0; i<limit; i++) { ExtMapBuffer1[i]=iMA(NULL,PERIOD_D1,9,0,MODE_EMA,PRICE_CLOSE,iBarShift(NULL, PERIOD_D1, Time[i], false)); } Am I right? Why Moving Average can Basic EA template Gold low high of zzuegg 2011.05.02 16:08 #3 looks good [Deleted] 2011.05.02 16:21 #4 zzuegg: looks good Thanks a lot! New comment
I am trying to write indicator that shows Daily EMA disregarding to current chart timeframe. And i found that i have no idea how to accomplish it.
Code:
for(int i=0; i<limit; i++)
{
ExtMapBuffer1[i]=iMA(NULL,PERIOD_D1,9,0,MODE_EMA,PRICE_CLOSE,i);
}
Does not work, because BarNumber (variable i) has a different meaning in current timeframe and D1.
Any help?