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 Stanfillirenfro, Today, 07:23 AM
      1 response
      2 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by cmtjoancolmenero, Yesterday, 03:58 PM
      2 responses
      19 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
      943 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