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

PercentComplete returns 1 on Daily bars. Always. Again.

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

    PercentComplete returns 1 on Daily bars. Always. Again.

    I tested, double tested and triple tested. I can't find a way to make it work:
    when period is daily, Bars.PercentComplete always return 1. whether it's historical (as it should) or real-time.
    Bars.PercentComplete works correctly under any other intraday period, but not daily.

    Suspicion: I think something changed in v8.0.9.0 because I'm quite sure it was working fine before.

    Cause: I'm not sure, but I think it has something to do with the fact that Bars.GetSessionEndTime now returns date with midnight hour (any timezone) on daily bars where it returns the correct bar end time on any intraday period.

    If you want to replicate, even the example code from the manual doesn't work.

    Advice?

    #2
    Hello uvblue,

    I am not able to reproduce this behavior.

    Below is a link to a short video that demonstrates.
    Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


    Attached is the script tested.

    Without modifying the script, and when taking the exact steps shown in the video, are you experiencing different behavior?

    What version of NinjaTrader 8 are you using (Help -> About... e.g. 8.0.X.X)

    Is your script printing the Bars.PercentComplete on each tick or are is this printing only when the bar closes?
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      I followed your steps to the letter (well almost, as I don't have a Kinetick guest account rather an IB with live data, and I'm monitoring equities [AAPL for example] rather futures) and used your unchanged imported script.
      Results are the same as before: a long line of 1... A very different result from your video.

      BTW, my script was tested in many ways including Calculate on tick, on price change, on bar close... I've been working on this for days now trying to figure out what's wrong. I'm basically now reduced to develop my own DailyPercentComplete function but would love to avoid it if possible.

      My exact NT version is 8.0.9.0 64-bit (Multi-Broker).

      If you like, I can take a video recording of my own steps, although it'll be very straightforward - just as your video.

      Anything else you can think of? Any global setting that may affect this? Is IB that different than Kinetick to cause this weird behavior? Or perhaps it's unique for equities?

      Comment


        #4
        Hello uvblue,

        Please send an email to platformsupport [at] ninjatrader [dot] com so that we may schedule a call for me to observe this on your end.

        In the email, please include a link to this forum thread.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks for your awesome support, Chelsea. Most appreciated!

          For the sake of sharing with the community what we found here, I'd just give a brief update on our findings so far (Feel free to correct me here). This may be important to others that, like me, smooth some daily indicators results as the daily bar progresses.

          We found that if your NT machine is on any timezone other than EST, your Bars.PercentComplete will return wrong results. Obviously, the further your timezone is from EST, the worse the offset going to be.
          As a result of a bug, probably, NT calculates that function based on the local host time rather the exchange's time. This problem, most likely, affects other functions such as Bars.GetTime(). It's important to mention it'll be mostly noticeable on bar periods of daily and higher (weekly, monthly, etc). Intraday calculation seems to be unaffected.

          Until this issue is properly examined, fixed and released, I recommend either changing NT/host's timezone to EST (I didn't test it, but will most likely fix the issue), or use own function (my preference).

          NT support managers: get Chelsea a raise. Mate's a superstar!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by samish18, Yesterday, 08:31 AM
          4 responses
          14 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by funk10101, Yesterday, 09:43 PM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by TheWhiteDragon, 01-21-2019, 12:44 PM
          5 responses
          551 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by rtwave, 04-12-2024, 09:30 AM
          5 responses
          37 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by funk10101, Today, 12:02 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Working...
          X