Re: [amibroker] Help with Code for MA Cross Over - Ribbon Indictor [1 Attachment]

2010-09-08 Thread inquisitive voyager
just fixed the AFL errors.
no look into concept.

On Wed, Sep 8, 2010 at 5:02 PM, Ken H sfehe...@yahoo.com.au 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);

 



Re: [amibroker] Help with Code for MA Cross Over - Ribbon Indictor [1 Attachment]

2010-09-08 Thread inquisitive voyager
try this one-

On Wed, Sep 8, 2010 at 7:49 PM, inquisitive voyager 
inquisitive.voya...@gmail.com wrote:


  
 [Attachment(s)https://mail.google.com/mail/?ui=2view=jsname=main,tlistver=tMWDK4VVLkE.en.am=!HnqNg-A4riyxhZ4C2vB2xDbd5G4Oj82iIj0cEiUTOD47RHoW3qQfri#12af1b80909aeeb3_TopTextfrom
  inquisitive voyager included below]

 just fixed the AFL errors.
 no look into concept.

 On Wed, Sep 8, 2010 at 5:02 PM, Ken H sfehe...@yahoo.com.au 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);