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

    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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      53 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X