• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Writing data history to file does not include final bar

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

    Writing data history to file does not include final bar

    Hello,

    I created a strategy (based on other examples in the forum) that writes a range of history data to a text file. The problem I'm having is writing the final bar. For example, I will run the HIstorical Data download for a symbol for Jan 1 through today (running download in the evening, 4-5 hours after the U.S. market closes. I then run the strategy, and if I select DAY, then it will write all days up through yesterday, but not today's OHLC values. If I switch to minute, then it will write all Minute data, including today except for the final minute of the normal trading hour).

    What am I missing?

    Thanks,
    Ray
    Attached Files

    #2
    Hello jrm999,

    Thank you for the post.

    Since the strategy runs on bar close, you will not get todays timestamp until todays bar has closed. You can work around this by setting Calculate == OnEachTick and only running the logic for the first tick of the bar. See the attached modification of the script you posted.

    Please let me know if I can assist further.

    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chris. I made the change and it performed exactly as expected. I really appreciate your assistance.

      Ray

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by StefanJ, Today, 04:11 AM
      2 responses
      7 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by fxSol, 03-17-2019, 04:17 AM
      3 responses
      22 views
      0 likes
      Last Post NinjaTrader_ChristopherD  
      Started by MarthaClines, Yesterday, 08:06 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by Trader_Kim, Yesterday, 03:41 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_ChristopherD  
      Started by MarthaClines, Yesterday, 06:23 PM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Working...
      X