API Drawing styles constants

From NakedMarkets
Jump to navigation Jump to search

Summary

The Drawing style constants are used in chart drawing functions to set the graph type. Is used with the SetIndexStyle() function.

Definition

Constant name Value
DrawingStyle.DRAW_LINE Draws the data as a line
DrawingStyle.DRAW_HISTOGRAM Draws the data as an histogram
DrawingStyle.DRAW_FILL Draws the data as a filled area
DrawingStyle.DRAW_ARROW Draws the data as a symbol
DrawingStyle.DRAW_SECTION Draws the data as sections between even and odd indicator buffers, 2 buffers of values (ie: ZigZag indicator)
DrawingStyle.DRAW_CANDLES Draws the data as a set of candles (ie: Heikin Ashi)
DrawingStyle.DRAW_NONE Doesn't draw the data

Examples

C# code snippet :

       public override void OnInit()
       {
           SetIndicatorShortName("Bollinger Bands");
           Indicator_Separate_Window = false;
           SetIndexBuffer(0, UpBand);
           SetIndexStyle(0, DrawingStyle.DRAW_LINE, Color.DarkOrange);
           SetIndexLabel(0, "Up Band");
           SetIndexBuffer(1, MA);
           SetIndexStyle(1, DrawingStyle.DRAW_LINE, Color.DarkOrange);
           SetIndexLabel(1, "MA");
           SetIndexBuffer(2, DownBand);
           SetIndexStyle(2, DrawingStyle.DRAW_LINE, Color.DarkOrange);
           SetIndexLabel(2, "Down Band");
       }