Difference between revisions of "API Drawing styles constants"

From NakedMarkets
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 38: Line 38:
             SetIndexStyle(2, DrawingStyle.DRAW_LINE, Color.DarkOrange);
             SetIndexStyle(2, DrawingStyle.DRAW_LINE, Color.DarkOrange);
             SetIndexLabel(2, "Down Band");
             SetIndexLabel(2, "Down Band");
         }</code>
         }
</code>

Latest revision as of 04:17, 5 January 2023

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");
       }