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 love2code2trade, Yesterday, 01:45 PM
      4 responses
      28 views
      0 likes
      Last Post love2code2trade  
      Started by funk10101, Today, 09:43 PM
      0 responses
      7 views
      0 likes
      Last Post funk10101  
      Started by pkefal, 04-11-2024, 07:39 AM
      11 responses
      37 views
      0 likes
      Last Post jeronymite  
      Started by bill2023, Yesterday, 08:51 AM
      8 responses
      45 views
      0 likes
      Last Post bill2023  
      Started by yertle, Today, 08:38 AM
      6 responses
      26 views
      0 likes
      Last Post ryjoga
      by ryjoga
       
      Working...
      X