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

to get One current day on bar close

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

    to get One current day on bar close

    I try to get data by 1 min on bar.close.
    And to set parameters "Days to load" = 0, "End date" = current day ("Data Series" window).
    example window:
    Click image for larger version

Name:	example.png
Views:	108
Size:	47.1 KB
ID:	1137678
    but it writes to the file for two days: current and before.
    Q: How to get data by minutes on the bar.close only the current day?
    ps I have read this post: https://ninjatrader.com/support/foru...rrent-day-only
    but I need 1 minute on bar close and only the current day.
    Thanks in advance.

    #2
    Hello minds2010,

    Thank you for the post.

    If you had used 0 bars to load that will load 1 session day. With the NQ that would include yesterday because its session spans overnight. If you only wanted the bars from today, matching your current PC clock day, you would need to use logic to do that instead of relying on session information.

    The following would be one way to check if the bar being processed has a date of today:
    Code:
    if(Time[0].Date == NinjaTrader.Core.Globals.Now.Date)

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse.
      Good job.
      Very Big Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by GussJ, 03-04-2020, 03:11 PM
      15 responses
      3,271 views
      0 likes
      Last Post xiinteractive  
      Started by Tim-c, Today, 02:10 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Taddypole, Today, 02:47 PM
      0 responses
      2 views
      0 likes
      Last Post Taddypole  
      Started by chbruno, 04-24-2024, 04:10 PM
      4 responses
      51 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      10 responses
      403 views
      1 like
      Last Post beobast
      by beobast
       
      Working...
      X