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

How to Trigger a code execution on Start of the Trading Day

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

    How to Trigger a code execution on Start of the Trading Day

    Hi,

    I want to execute few lines of code right after market opens e.g. check if price opened below yesterday's high etc.
    What is the way to detect that?
    I am building a strategy that uses multi-data Series.

    Please let me know if you have any question!

    Thanks
    G
    Last edited by gbajaj; 06-21-2021, 12:03 AM.

    #2
    Hello gbajaj,

    Thanks for your post.

    If you would like to execute code when right after the market opens, you could use Bars.IsFirstBarOfSession to determine if the current bar processing is the first bar updated in a trading session.

    In a multi-timeframe/multi-instrument script, you could use a BarsInProgress check to determine if the added series is processing and then check if Bars.IsFirstBarOfSession to determine if the current bar processing is the first bar of that added series.

    See the help guide documentation below for more information.
    Bars.IsFirstBarOfSession: https://ninjatrader.com/support/help...rofsession.htm
    BarsInProgress: https://ninjatrader.com/support/help...inprogress.htm
    Working with multi-timeframe/multi-instrument scripts: https://ninjatrader.com/support/help...nstruments.htm

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Kaledus, Today, 01:29 PM
    5 responses
    12 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Waxavi, Today, 02:00 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by alifarahani, Today, 09:40 AM
    5 responses
    23 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by gentlebenthebear, Today, 01:30 AM
    3 responses
    16 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by PhillT, Today, 02:16 PM
    2 responses
    7 views
    0 likes
    Last Post PhillT
    by PhillT
     
    Working...
    X