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

GetDayBar - whats wrong

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

    #31
    Originally posted by koganam View Post
    Given your code snippet, why would expect that you would not see data processed from every day on the chart? OnBarUpdate() is an event handler, which is triggered on all data in the stream that it processes.
    Yes, you are right and this is my point too.

    Without a specific escape statement,
    Exactly. The question is how this escape statement should looks like?
    My idea was to compare GetDayBar(1).Time with (trading) yesterday related on actual today. So, I'd escape if NT is still on processing of older dates and enter if both dates are equal.

    Just a simple example similar to what I'd like to code:
    - Create an alert, if the market opened above PriorDay.High, the trades down and reached this prior high during the day. No plots.
    I do not want to see all these alerts for the days in the past. It's gone.

    Comment


      #32
      Originally posted by fel17 View Post
      Yes, you are right and this is my point too.

      Exactly. The question is how this escape statement should looks like?
      My idea was to compare GetDayBar(1).Time with (trading) yesterday related on actual today. So, I'd escape if NT is still on processing of older dates and enter if both dates are equal.

      Just a simple example similar to what I'd like to code:
      - Create an alert, if the market opened above PriorDay.High, the trades down and reached this prior high during the day. No plots.
      I do not want to see all these alerts for the days in the past. It's gone.
      Then what you are saying is a different issue. I read that to mean that you only want to start processing your code proper if the bar is formed today. To do that you just need to compare the date of each bar to today's date and return; if they are not equal.
      Last edited by koganam; 05-30-2012, 05:30 PM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by love2code2trade, 04-17-2024, 01:45 PM
      4 responses
      31 views
      0 likes
      Last Post love2code2trade  
      Started by cls71, Today, 04:45 AM
      2 responses
      10 views
      0 likes
      Last Post eDanny
      by eDanny
       
      Started by proptrade13, Today, 11:06 AM
      0 responses
      5 views
      0 likes
      Last Post proptrade13  
      Started by kulwinder73, Today, 10:31 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by RookieTrader, Today, 09:37 AM
      3 responses
      15 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X