[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] BOLD moving average line



PureBytes Links

Trading Reference Links

Hi,

I don't know the author.

// PlotThickLine Example

     #include <PlotThickLine.afl>




     _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", colorGrey50 ), styleNoTitle | 
ParamStyle("Style") | GetPriceStyle() );
     _SECTION_END();

     _SECTION_BEGIN("MA");
     P = ParamField("Price field",-1);
     Periods = Param("Periods", 15, 2, 200, 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", 15, 2, 200, 1, 10 );
     // Plot( MA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", 
colorCycle ), ParamStyle("Style") );
     PlotThickLine( MA( P, Periods ), colorGreen);
	_SECTION_END();


/* copy the function in the directory C:\Program 
Files\AmiBroker\Formulas\Include

          PlotThickLine.afl

          A function which draws multiple plots very close together to 
create the visual of a single very thick plot.
          "Very close" is defined by an offset, which varies by symbol.



     function PlotThickLine(Startpoint, DrawColor)
     {
        Thickness = 6 ;  // set your desired thickness here
        ST = Name();
        Offset = 0.01;  // default offset for arbitrary symbol, e.g. stocks

        //  Specific offsets for defined symbols
        if (ST == "ER"){Offset = .001;}
        if (ST == "YM"){Offset = .3;}
        if ((ST == "EU") OR ST == "FG" OR ST == "AU" OR ST == 
"GB"){Offset = .000001;}

        //   Draw the exact plot
        Plot(Startpoint, "", DrawColor, 5);

        //  Draw multiple extra plots to create thickness effect
        for( idx = 1; idx < Thickness; idx++ ){
              Plot(Startpoint + (idx * Offset), "", DrawColor, 5+4096); 
      //   plot just above
              Plot(Startpoint - (idx * Offset), "", DrawColor, 5+4096); 
      //   plot just below
        }

     }

*/



tomingchen a écrit :
> 
> 
> 
> Any way to configure AB to show 'bold' moving average line ? It is hard 
> to see line on the chart.
> 
> thanks.
> 
> 



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/