Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding and Plotting indicator

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

    Adding and Plotting indicator

    I tried the following below but getting compile errors. Can a ATR component somehow be added to the EMA as below?

    Add(EMA(20) + 2*ATR(10));
    EMA(20) + 2*ATR(10).Plots[0].Pen.Color = Color.Green;

    #2
    Hi Delta007, only strategies could add in indicators for display. The calculation logic would be done in the indicator then, the add really only does the including of the indicator for visualization purposes, it would not be used to further include custom calculations like yours.

    You could for example check into the Keltner indicator and make a copy to let it's midline be an EMA. And then add this new study you created in via the strategy for display.

    Comment


      #3
      What I'm looking to do is have one line display in the strategy analyzer charts which is a offset of 2 ATR's from the EMA20

      Comment


        #4
        Right, first create an indicator that would calculate that value for you. Then Add() this indicator in for visualization in your strategy script.

        Comment


          #5
          Ok. From looking at the script of the Keltner indicator in NT it just uses High - Low instead of the "max of" like the ATR uses. Unless I have an outdated version.

          Comment


            #6
            You are correct, that's the traditional way to calculate it I believe. Even easier then would be just creating a new indicator with one plot with our wizard.

            Then add this to your OnBarUpdate() -

            Plot0.Set(EMA(20)[0] + 2 * ATR(10)[0]);

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            581 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            338 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            552 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X