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

Plot a line of the bar close

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

    Plot a line of the bar close

    Hello,

    I'm new to NT and am working my way around it

    How would I code an indicator that plotted a horizontal line at the close of a bar at 14:00. The line would be the value of the close of that bar at 14:00.

    DR

    #2
    You could capture the close price when the bar time (Time[0]) was at the specific time then draw a horizontal line using the DrawLine() method.
    RayNinjaTrader Customer Service

    Comment


      #3
      Plot a continueous line of bar close

      Hi

      I'd like to plot a continuous "line of close" on top of the OHLC bars I use.

      How can I do this? With DrawLine() or another way? I've tried coding this but can only get the line to draw between the previous 2 closes.

      Thanks

      Stephen

      Comment


        #4
        Hello Stephen,

        Thanks for your post and welcome to the forums!

        You have posted in the NinjaTrader 7 forums so I will respond with those links.

        You would want to use the DrawHorizontalLine() method: http://ninjatrader.com/support/helpG...zontalline.htm

        You can also accomplish this without coding. Add an SMA to a chart, set the SMA period to 1, set the CalculateOnBarClose to "False" to adjust on each tick or leave true to update on bar close, in the "plots" section of the SMA, change the "plotStyle" from "Line" to "HLine".
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thanks Paul, that works well. Cheers! :-)

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Stanfillirenfro, Today, 07:23 AM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by cmtjoancolmenero, Yesterday, 03:58 PM
          2 responses
          20 views
          0 likes
          Last Post cmtjoancolmenero  
          Started by olisav57, Yesterday, 07:39 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by cocoescala, 10-12-2018, 11:02 PM
          7 responses
          944 views
          0 likes
          Last Post Jquiroz1975  
          Started by oviejo, Today, 12:28 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X