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 fx.practic, 10-15-2013, 12:53 AM
            5 responses
            5,403 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by Shai Samuel, 07-02-2022, 02:46 PM
            4 responses
            94 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by DJ888, Yesterday, 10:57 PM
            0 responses
            6 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            158 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Yesterday, 09:29 PM
            0 responses
            8 views
            0 likes
            Last Post Belfortbucks  
            Working...
            X