Difference between revisions of "API Drawing styles constants"

From NakedMarkets
Jump to navigation Jump to search
Line 1: Line 1:
=== Summary ===
=== Summary ===


The Drawing style constants are used in chart drawing functions to set the graph type
The Drawing style constants are used in chart drawing functions to set the graph type. Is used with the SetIndexStyle() function.
<br>
<br>
=== Definition ===
=== Definition ===
Line 8: Line 8:
! Constant name !! Value
! Constant name !! Value
|-
|-
| '''DRAW_LINE''' || Draws the data as a line
| '''DrawingStyle.DRAW_LINE''' || Draws the data as a line
|-
|-
| '''DRAW_HISTOGRAM''' || Draws the data as an histogram
| '''DrawingStyle.DRAW_HISTOGRAM''' || Draws the data as an histogram
|-
|-
| '''DRAW_FILL''' || Draws the data as a filled area
| '''DrawingStyle.DRAW_FILL''' || Draws the data as a filled area
|-
|-
| '''DRAW_ARROW''' || Draws the data as a symbol
| '''DrawingStyle.DRAW_ARROW''' || Draws the data as a symbol
|-
|-
| '''DRAW_SECTION''' || Draws the data as sections between even and odd indicator buffers, 2 buffers of values (ie: ZigZag indicator)
| '''DrawingStyle.DRAW_SECTION''' || Draws the data as sections between even and odd indicator buffers, 2 buffers of values (ie: ZigZag indicator)
|-
|-
| '''DRAW_CANDLES''' || Draws the data as a set of candles (ie: Heikin Ashi)
| '''DrawingStyle.DRAW_CANDLES''' || Draws the data as a set of candles (ie: Heikin Ashi)
|-
|-
| '''DRAW_NONE''' || Doesn't draw the data
| '''DrawingStyle.DRAW_NONE''' || Doesn't draw the data
|}
|}
=== Examples ===
=== Examples ===
C# code snippet :
<code>
        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");
        }</code>

Revision as of 04:16, 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");
       }