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 zstheorist, Today, 07:52 PM
            0 responses
            3 views
            0 likes
            Last Post zstheorist  
            Started by pmachiraju, 11-01-2023, 04:46 AM
            8 responses
            149 views
            0 likes
            Last Post rehmans
            by rehmans
             
            Started by mattbsea, Today, 05:44 PM
            0 responses
            5 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            33 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Started by tkaboris, Today, 05:13 PM
            0 responses
            5 views
            0 likes
            Last Post tkaboris  
            Working...
            X