How to plot 15min Moving average in 1 min chart in amibroker

#1
Hello all,

I have plot moving average in 15 chart. Now i want to plot 15 min moving average in 1 min. I tried with MA(Ref(C,-15),50); but it calculates for every last 15 candles. As it should plot at every 15th candle in 1 min chart.
 

vijkris

Learner and Follower
#2
Hello all,

I have plot moving average in 15 chart. Now i want to plot 15 min moving average in 1 min. I tried with MA(Ref(C,-15),50); but it calculates for every last 15 candles. As it should plot at every 15th candle in 1 min chart.
u have to use timeframe functions. nicely expllained in ami website and everywhere. pls search on google.

timeframeset(in15minute);
ma(c,50);
timeframerestore();

use timeframeexpand function..

BTW this thread should have been opened in amibroker sub-forum, not in advanced trading strategies.
 
Last edited:
#3
yes tried with timeframe set also,but plot doen't match with 1 min chart. Also tried timeframegetprice....

TimeFrameSet(in15Minute);

MAp = Param("Periods",3, 2, 300, 1, 10 );
MA1=MA(C,MAp);

Plot( MA1, _DEFAULT_NAME(), ParamColor( "ColorMA1", colorCycle ), ParamStyle("Style") );

TimeFrameRestore()

.............................................................

i have thought to take close value when timenum()/300 =0 and fit it in array. confused how to code....
 

vijkris

Learner and Follower
#4
yes tried with timeframe set also,but plot doen't match with 1 min chart. Also tried timeframegetprice....

TimeFrameSet(in15Minute);

MAp = Param("Periods",3, 2, 300, 1, 10 );
MA1=MA(C,MAp);

Plot( MA1, _DEFAULT_NAME(), ParamColor( "ColorMA1", colorCycle ), ParamStyle("Style") );

TimeFrameRestore()

.............................................................

i have thought to take close value when timenum()/300 =0 and fit it in array. confused how to code....
bro, u need to read.. u r confused.
plotting ma is easiest to code in multi timefrane.

u just have to use timeframeexpand(......)
then plot function.
u used plot function 1st and then timeframe restore function , it is wrong thats y values not matching.
pls see my previous post.
all plots only after timeframe restore.
 

Similar threads