Hello Ken,
check this ..

_SECTION_BEGIN("MA");
P =ParamField("Price field",-1);
Periods =Param("Periods", 15, 2, 300, 1, 10 );
Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), 
ParamStyle("Style") );
_SECTION_END();
 
_SECTION_BEGIN("MA1");
P2 =ParamField("Price field",-1);
Periods2 =Param("Periods", 50, 2, 300, 1, 10 );
Plot( MA( P2, Periods2 ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), 
ParamStyle("Style") );
_SECTION_END();
Bull_Trend=(MA( P, Periods )>MA( P2, Periods2 ));
Bear_Trend=(MA( P, Periods )<MA( P2, Periods2 ));
//Bull_Trend=(MA(p2, Param("Periods", 15, 2, 300, 1, 10) )> 50);
//Bear_Trend=(MA(p2, Param("Periods", 15, 2, 300, 1, 10 ))< 50);
Ribbon_kol=IIf( Bull_Trend, colorDarkGreen, IIf(Bear_Trend, colorRed,colorRed));
Plot(1, "ribbon", Ribbon_kol, styleOwnScale| styleArea|styleNoLabel,0,10); 
Thank you
--- In amibroker@yahoogroups.com, Ken H <sfehe...@...> wrote:
>
> Hi 
>  
> Can anyone assist me in fixing this code?  
>  
> I am trying to create a ribbon indicator to show when a MA cross over occurs.
>  
> Many thanks 
>  
> Ken
>  
> _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("MA");
> P = ParamField("Price field",-1);
> Periods = Param("Periods", 15, 2, 300, 1, 10 );
> Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), 
> ParamStyle("Style") ); 
> _SECTION_END();
>  
> _SECTION_BEGIN("MA1");
> P = ParamField("Price field",-1);
> Periods = Param("Periods", 50, 2, 300, 1, 10 );
> Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), 
> ParamStyle("Style") ); 
> _SECTION_END();
>  
> Bull_Trend=(MA( Param("Periods", 15, 2, 300, 1, 10) )> 50);
> Bear_Trend=(MA( Param("Periods", 15, 2, 300, 1, 10 ) )< 50);
> Ribbon_kol=IIf( Bull_Trend, colorDarkGreen, IIf(Bear_Trend, 
> colorRed,colorRed))
> ;
> Plot(5, "ribbon", Ribbon_kol, styleOwnScale| styleArea|
> styleNoLabel,-0.5,10);
>


Reply via email to