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

Daily charts not implementing logic correctly

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

    Daily charts not implementing logic correctly

    I've noticed that my indicators do not work on daily charts reliably, where they work on intraday fine. For example, the attached BarCheck which draws inside & outside bars, and marks bar turn-arounds. Part of it does not work on daily, for example, OBs are drawn, but not IBs.
    Since the logic is no different across bar lengths, this is something particular to NT's implemenetation.

    I even tried adding "if (!Historical)" before the clean-up statement, as in
    if IB then draw IB, else if OB then draw OB, else (if !Historical) remove IB.

    It did NOT help. Once an outside bar, always an outside bar obviously; however an inside bar may grow out of it before the current bar ends, so it is necessary to remove any previously drawn IB once the conditions are no longer met.

    I need to understand this and get it fixed, as it will affect all my indicators. Indicators should work the same, regardless of time-frame.
    Thank you.
    Attached Files

    #2
    If you set CalculateOnBarClose to false, does it make a difference?
    RayNinjaTrader Customer Service

    Comment


      #3
      Even more bizarre. Of the dozen IBs I see on the daily, ONE was marked.

      BTW, thank you. I should have thought to try that. Unfortunately, it did not fix it.

      Comment


        #4
        Actually, I just realized something. There was an OB, but only one. I did not think anything of it until now, when I got just one IB. Both happen to be the very last OB & IB. Earlier ones are not marked.

        My way of creating a unique tag IDs = "IB"+Bars.BarsSinceSession.ToString()

        Is this invalid for daily charts? And what should I use that works for BOTH intraday & daily/weekly, etc?

        Thanks!

        Comment


          #5
          I would not tag bars this way...

          Suggested -

          string myTag = "IB" + CurrentBar;
          RayNinjaTrader Customer Service

          Comment


            #6
            And the ToString() is not necessary? OK. This fixed it, thanks!

            Comment


              #7
              ToString() is only necessary for the very first data type in the expression if not a string already

              for example

              string myString = double.ToString()
              string myString = double.ToString() + " " + double
              RayNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Rapine Heihei, 04-23-2024, 07:51 PM
              2 responses
              30 views
              0 likes
              Last Post Max238
              by Max238
               
              Started by Shansen, 08-30-2019, 10:18 PM
              24 responses
              943 views
              0 likes
              Last Post spwizard  
              Started by Max238, Today, 01:28 AM
              0 responses
              9 views
              0 likes
              Last Post Max238
              by Max238
               
              Started by rocketman7, Today, 01:00 AM
              0 responses
              4 views
              0 likes
              Last Post rocketman7  
              Started by wzgy0920, 04-20-2024, 06:09 PM
              2 responses
              28 views
              0 likes
              Last Post wzgy0920  
              Working...
              X