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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      134 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      118 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X