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 CarlTrading, 03-31-2026, 09:41 PM
            1 response
            152 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            89 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            131 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            127 views
            1 like
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            107 views
            0 likes
            Last Post CarlTrading  
            Working...
            X