Dear Sir,
I am a beginner to amibroker .
I need to draw this line in 15min timeframeset.
Could you plz tell me how to do it?
(Draw trace is ok ,but draw trace15min is not appear ?)
Many thanks!
_SECTION_BEGIN("trace");
n = Param("periods",10);
trace=Null;
MA10=MA(C,10);
d1=(StDev(C,10))^2;
trace[10]=MA10[10];
for(i=n+1; i<BarCount;i++){
d2=(trace[i-1]-MA10)^2;
t=IIf(d2<d1,0,1-d1/d2);
trace=trace[i-1]+t*(MA10[i-1]-trace[i-1]);
}
Plot(trace,"trace",colorRed,styleLine);
_SECTION_END();
_SECTION_BEGIN("trace_15min");
TimeFrameSet(in15Minute);
n = Param("periods",10);
trace=Null;
MA10=MA(C,10);
d1=(StDev(C,10))^2;
trace[10]=MA10[10];
for(i=n+1; i<BarCount;i++){
d2=(trace[i-1]-MA10)^2;
t=IIf(d2<d1,0,1-d1/d2);
trace=trace[i-1]+t*(MA10[i-1]-trace[i-1]);
}
TimeFrameRestore();
Plot(TimeFrameExpand(trace,in15Minute,expandFirst),"trace15min",colorRed,styleLine);
_SECTION_END();
I am a beginner to amibroker .
I need to draw this line in 15min timeframeset.
Could you plz tell me how to do it?
(Draw trace is ok ,but draw trace15min is not appear ?)
Many thanks!
_SECTION_BEGIN("trace");
n = Param("periods",10);
trace=Null;
MA10=MA(C,10);
d1=(StDev(C,10))^2;
trace[10]=MA10[10];
for(i=n+1; i<BarCount;i++){
d2=(trace[i-1]-MA10)^2;
t=IIf(d2<d1,0,1-d1/d2);
trace=trace[i-1]+t*(MA10[i-1]-trace[i-1]);
}
Plot(trace,"trace",colorRed,styleLine);
_SECTION_END();
_SECTION_BEGIN("trace_15min");
TimeFrameSet(in15Minute);
n = Param("periods",10);
trace=Null;
MA10=MA(C,10);
d1=(StDev(C,10))^2;
trace[10]=MA10[10];
for(i=n+1; i<BarCount;i++){
d2=(trace[i-1]-MA10)^2;
t=IIf(d2<d1,0,1-d1/d2);
trace=trace[i-1]+t*(MA10[i-1]-trace[i-1]);
}
TimeFrameRestore();
Plot(TimeFrameExpand(trace,in15Minute,expandFirst),"trace15min",colorRed,styleLine);
_SECTION_END();