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

BarsType bars.ToDate does not seem to be read only

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

    BarsType bars.ToDate does not seem to be read only

    Dear Team,
    I'm using a variable tempDate = bars.ToDate to read the value of DataSeries/Time frame/End date as a reference point.
    This works fine until I display an indicator, and the then tempDate variable seems to track the date of the indicator as it is loaded in (I have Tick Replay enabled on the Data Series), rather than keeping its original value, which I would have thought would be a read only end date, as shown in the UI.

    Is there a way to ensure that bars.ToDate is a read only (fixed) date ?
    Or is there another way to get DataSeries/Time frame/End date that ensures it's read only ?

    Thanks,
    Louis

    #2
    Hello Louis365,

    Thanks for your post.

    This property is not documented/unsupported, so we may come across some behavior that we do not expect, especially when using Tick Replay. Through my testing, I see where this value changes in OnBarUpdate when using Tick Replay. I would instead suggest accessing this value in State.DataLoaded and to save it to a private variable so you can access it in OnBarUpdate when it is not changing.

    Considering that this value gives us the ToDate from the DataSeries window, this value could also update when the indicator has run for longer than a day. It may also be helpful to update the variable when OnBarUpdate is processing State.Realtime.

    As this item is unsupported, our recommendations would be limited to our immediate observations. However, I hope this information will be helpful for you to attain your goal.

    If you have any other inquiries, please don't hesitate to open a new thread.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim, excellent response.
      Thanks for your help.
      Louis

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by lightsun47, Today, 03:51 PM
      0 responses
      4 views
      0 likes
      Last Post lightsun47  
      Started by 00nevest, Today, 02:27 PM
      1 response
      8 views
      0 likes
      Last Post 00nevest  
      Started by futtrader, 04-21-2024, 01:50 AM
      4 responses
      44 views
      0 likes
      Last Post futtrader  
      Started by Option Whisperer, Today, 09:55 AM
      1 response
      13 views
      0 likes
      Last Post bltdavid  
      Started by port119, Today, 02:43 PM
      0 responses
      8 views
      0 likes
      Last Post port119
      by port119
       
      Working...
      X