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

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 helpwanted, Today, 03:06 AM
            1 response
            16 views
            0 likes
            Last Post sarafuenonly123  
            Started by Brevo, Today, 01:45 AM
            0 responses
            11 views
            0 likes
            Last Post Brevo
            by Brevo
             
            Started by aussugardefender, Today, 01:07 AM
            0 responses
            6 views
            0 likes
            Last Post aussugardefender  
            Started by pvincent, 06-23-2022, 12:53 PM
            14 responses
            244 views
            0 likes
            Last Post Nyman
            by Nyman
             
            Started by TraderG23, 12-08-2023, 07:56 AM
            9 responses
            387 views
            1 like
            Last Post Gavini
            by Gavini
             
            Working...
            X