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 pechtri, 06-22-2023, 02:31 AM
    9 responses
    122 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by frankthearm, 04-18-2024, 09:08 AM
    16 responses
    65 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by habeebft, Today, 01:18 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by benmarkal, Today, 12:52 PM
    2 responses
    13 views
    0 likes
    Last Post benmarkal  
    Started by f.saeidi, Today, 01:38 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Working...
    X