Announcement

Collapse
No announcement yet.

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 lismartin, Yesterday, 03:30 PM
    3 responses
    17 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by RT001, Yesterday, 03:47 PM
    3 responses
    26 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by johnMoss, Yesterday, 10:40 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by torch2k, Today, 06:24 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by WalterSkinner, Yesterday, 02:37 PM
    4 responses
    23 views
    0 likes
    Last Post WalterSkinner  
    Working...
    X