Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing a user defined line

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

    Drawing a user defined line

    I am wondering how I can add a user defined line into an existing pivot indicator please.
    I am unable to get a field in the user defined area that exists.
    I have put in a line at the variables and added a plot line coding.
    Thanks

    #2
    Do you want a constant line that is always on the chart or a fixed line, as if you have drawn it manually?
    RayNinjaTrader Customer Service

    Comment


      #3
      I would like to add it to part of an indicator that I am using to calculate pivots points. I am using the user defined values for Open, Close, High and Low. I would like to add another field called Gap
      Thanks

      Comment


        #4
        Have you taken a look at the source code for the Stochasitics indicator? There you can see how to add a line to the Initialize() method of an indicator.

        You can review this tip for adding user defined parameters - http://www.ninjatrader-support2.com/...ead.php?t=5782
        RayNinjaTrader Customer Service

        Comment


          #5
          Ok. Have looked at the tips.
          All I want to do is have a blank field in the Userdefined section of the indicator. I would then put in a value of say "2635" and a dashed line in blue at 2pts wide is drawn horizontally.

          Comment


            #6
            I suggest reviewing the tip again to create a user defined field named "Gap". Then at the top of the OnBarUpdate() method, you can draw a line using the following code:

            DrawLine("Gap", CurrentBar, Gap, 0, Gap, Color.Blue, DashStyle.Dash, 2);
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            579 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            334 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 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
            551 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X