Comments:
1. Performance can get sluggish at the lowest timeframes
2. UpperLimit setting Has to increase with Lower time Intervals
3. As a result at the Lowest timeframe (1 Minute) you might get an
accessviolation Code
4. Don't forget to reset the Parameter window if you edit the values
Title = EncodeColor(4)+ _DEFAULT_NAME()+"; "+EncodeColor(1) +
StrFormat("{{NAME}} - {{INTERVAL}}; {{DATE}}; O=%g, H=%g, L=%g, C=%g
(%.1f%%)
{{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) );
EMABarsVisible89=Param("EMABarsVisible89",89,5,200,1);//for demo purposes
EMABarsVisible55=Param("EMABarsVisible55",55,5,200,1);//for demo purposes
EMABarsVisible34=Param("EMABarsVisible34",34,5,200,1);//for demo purposes
EMABarsVisible21=Param("EMABarsVisible21",21,5,200,1);
UpperLimit=Param("UpperLimit",555,2,10000,1);
Plot(C,"C",1,64);
for(i=1;i< UpperLimit;i++)
{
Plot( IIf( BarIndex() >= BarCount - EMABarsVisible89, EMA( C,89), Null ),
"", 5,styleNoLabel |5 );
Plot( IIf( BarIndex() >= BarCount - EMABarsVisible55, EMA( C,55), Null ),
"", 4,styleNoLabel |5 );
Plot( IIf( BarIndex() >= BarCount - EMABarsVisible34, EMA( C,34), Null ),
"",6 ,styleNoLabel |5 );
Plot( IIf( BarIndex() >= BarCount - EMABarsVisible21, EMA( C,21), Null ),
"", colorViolet,styleNoLabel |5 );
}
//Plot(EMA(C,55),"EMA55",4,5);//Use once only for verification that plots
provide correct value
From: [email protected] [mailto:[email protected]] On Behalf
Of war_maniac2002
Sent: Wednesday, April 21, 2010 5:45 AM
To: [email protected]
Subject: [amibroker] Re: Restricted Plot
Try this-
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo
%g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) )
));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle |
ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("temp");
for(i=0;i<BarCount;i++)
{Plot( IIf( BarIndex()>=BarCount -21, EMA( C, 21), Null ), "ema",
colorRed,styleLine);}
_SECTION_END()
--- In [email protected] <mailto:amibroker%40yahoogroups.com> ,
"osp2osp" <osp2...@...> wrote:
>
> How to plot 21 days EMA only for the last 21 bars.
>
> Thank you.
>
> Warm Regards.
>
> K Karunakaran
>