• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plot Singal Above/Below candle ATR*2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Plot Singal Above/Below candle ATR*2

    Hey guys, im trying to make this indicator plot signals above / below the High/Low of the candles 2 times the ATR measure.

    already got the ATR working but dont know how to implement it:

    //Variables

    private DataSeries KATR;
    private double resultATR= 0;

    protected override void Initialize()

    KATR = new DataSeries(this); //ATR Dataseries

    protected override void OnBarUpdate()

    if ( CurrentBars[0] < 14 ) return;
    KATR.Set(ATR(Input,14)[0]);

    double resultATR = (KATR[0] * 10000);


    DrawTextFixed( "ATR", "ATR: " + resultATR.ToString("N1") , TextPosition.BottomRight);


    if (Condition)
    {
    DrawText(xxxxxxxxxxxxxxxxxxx, Low[0] - resultATR*2 ??? , xxxxxxxxxxxxxxxxxxxxx);
    }


    Thank you in advance

    #2
    Hello kabott,

    Thank you for your post.

    Are you trying to create a plot or draw the text at a specific place on the chart? What are you trying to implement?
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      HI Patrick, im trying to draw the text at a specific distance from the candle, ATR * 2 from the high of the candle for Sell signals, ATR *2 below the candle Low for Buy Signals

      Comment


        #4
        Hello kabott,

        Thank you for your response.

        For the sell signal you could use the following as an example:
        Code:
        DrawText("ATRSell", ATR(14)[0].ToString(), 0, High[0] + (2*ATR(14)[0]), Color.Black);
        Patrick H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jjanguda, 05-19-2015, 01:13 PM
        15 responses
        1,372 views
        0 likes
        Last Post Eric M.
        by Eric M.
         
        Started by morrnel, Today, 01:13 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Jim  
        Started by babouin77, Today, 12:41 PM
        8 responses
        18 views
        0 likes
        Last Post babouin77  
        Started by punkiy2111, Today, 12:17 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Tabor  
        Started by GLFX005, Today, 11:22 AM
        9 responses
        38 views
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Working...
        X