Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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?

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by inanazsocial, Today, 01:15 AM
        0 responses
        2 views
        0 likes
        Last Post inanazsocial  
        Started by trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        22 views
        0 likes
        Last Post trilliantrader  
        Started by Davidtowleii, Today, 12:15 AM
        0 responses
        3 views
        0 likes
        Last Post Davidtowleii  
        Started by guillembm, Yesterday, 11:25 AM
        2 responses
        9 views
        0 likes
        Last Post guillembm  
        Started by junkone, 04-21-2024, 07:17 AM
        9 responses
        71 views
        0 likes
        Last Post jeronymite  
        Working...
        X