Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

uniRenko New date indicator

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

    uniRenko New date indicator

    I have a session break to force a new Onbarupdate to end my day. My system runs perpetually. I want my strategy to know when it is a new day. It is my understanding that Time[0] is the date and time of the last completed bar. Thus it does not have the current date. If this is true then I need to wait for the second bar to end to know that that date has changed. Is there a way to know the date has changed with the first tick of the day short of changing my OnBarUpdate to be tick by tick.

    #2
    Hi Buttermilk,

    Thanks for your post.

    If you want to detect something on the first tick of the day, you will need to run the script on every tick.

    If the script only runs when a bar closes, then it would not be possible to detect something after 1 tick.

    You run the script with Calculate on bar close set to false, or you can use intra-bar granularity of 1 tick.

    You could also use a timer that runs on an interval and check the current system time instead of the bar time. (DateTime.Now)

    Below is a link to an example of intra-bar granularity.
    http://www.ninjatrader.com/support/f...ead.php?t=6652

    And attached is an example of using a timer.
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by soon123, Today, 12:25 AM
    1 response
    22 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by deetee, Today, 09:55 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by Cormick, Today, 09:05 AM
    3 responses
    28 views
    0 likes
    Last Post Cormick
    by Cormick
     
    Started by sidlercom80, Today, 09:41 AM
    2 responses
    12 views
    0 likes
    Last Post sidlercom80  
    Started by UltraNIX, Today, 06:03 AM
    2 responses
    11 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X