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

Draw Ray problem on both historical and real time data

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

    Draw Ray problem on both historical and real time data

    I have tried to alter the code CurrentDayOHL to draw ray for High and Low Price.

    But the ray only draw on recent day only, how can I applied it on the previous day also ?

    Would you help to show me an example and a result picture.
    Thank you.

    Regards,
    Franco

    #2
    Hello Franco,

    On a new trading day, change the name of the tagName of the drawing object and a new object will be drawn instead of the existing object replaced in a new location.

    Attached is a simple example that would draw a ray from the low of the day to the high of the day.
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Thank you for your prompt reply on my question.
      Your example help me a lot on drawing object, and it also shows the analytical method can simpliful the coding.

      Regards,
      Franco

      Comment


        #4
        Hi Chelsea,

        I found that if the first bar is the highest bar of a trading day, it only draw on the second highest bar only.
        Would you help to reproduce my finding ?

        Thanks !

        Regards,
        Franco

        Comment


          #5
          Hello Franco,

          You may need to add 1 to the Bars.BarsSinceNewTradingDay as I think when this is called, it does not include the current bar.
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by llanqui, Today, 10:29 AM
          0 responses
          4 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by llanqui, Today, 08:32 AM
          1 response
          10 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by lollers, Yesterday, 03:26 AM
          1 response
          53 views
          0 likes
          Last Post lollers
          by lollers
           
          Started by Salahinho99, 05-05-2024, 04:13 AM
          7 responses
          62 views
          0 likes
          Last Post Salahinho99  
          Started by knighty6508, 05-10-2024, 01:20 AM
          4 responses
          30 views
          0 likes
          Last Post knighty6508  
          Working...
          X