Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Coding the color and dash style of an indicator in a custom strategy

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

    Coding the color and dash style of an indicator in a custom strategy

    I am looking for a way I can set the MAX indicator in my custom strategy to be diplayed not only in black but also as dashed ( width 2 ). Could you please advice me on the code I need to use to achieve this because as for now, I am stuck at Add(MAX(High,50));

    #2
    Welcome to our forums - we have posted a tip in the forums to show how this could be further customized as desired including the dash style - http://www.ninjatrader.com/support/f...ead.php?t=3228

    Comment


      #3
      Still getting errors

      Thanks for your reply. I checked out the link you sent me and tried recoding the indicators in the Initialize() section as shown below.

      Add(MAX(High,MAXprdlng).Plots[0].Pen.DashStyle = DashStyle.Dash);
      Add(MAX(High,MAXprdlng).Plots[0].Pen.Color = Color.Black);

      However, I still got error messages. Could you please tell me what's wrong with the code?

      Comment


        #4
        You would not want to include it all into one statement, please try for example in your Strategy Initialize() -

        Add(MAX(High,50));
        MAX(High, 50).Plots[0].Pen.DashStyle = DashStyle.Dash;

        Comment


          #5
          It is working now

          The advice you gave me worked like a charm, thanks.

          Comment


            #6
            Ok, glad to hear that. Have a nice day.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            647 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X