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

Strategy to only run during specific hours

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

    Strategy to only run during specific hours

    Hello.
    I am using Strategy Builder to create my strategy.
    I want to have my strategy omit certain times of the day, specifically between 7:39am and 1:00pm.
    I found these instructions I am following: https://ninjatrader.com/support/help...to_limit_t.htm
    So I input this into the Strategy Builder. When I do a backtest using Strategy Analyzer, it is still showing trades being taken after 1:00pm.
    Did I do something wrong? How to fix this?

    Click image for larger version

Name:	image.png
Views:	24
Size:	8.5 KB
ID:	1296881

    #2
    Here is example to show the trade showing up after 1:00pm:
    Click image for larger version

Name:	image.png
Views:	21
Size:	11.9 KB
ID:	1296884

    Comment


      #3
      Hello betsuni_123,

      Do you have multiple condition sets that submit orders?

      Are these time conditions in all condition sets that submit orders?

      What is the bar type an interval?

      When using Calculate.OnBarClose, orders are submitted after the bar closes and will appear filled with the open of the next bar.
      What is the next bar after 1:00 PM?
      If you change the condition to less than 12:00 PM, does this correct the behavior? (An order submitted after the 12:00 PM bar closes would fill as the 1:00 PM on a 60 Minute chart opens)
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hi Chelsea,
        I deleted this message because everything works now suddenly. I closed NT and reopened it, tried the Strategy Analyzer again and it now does not show trades past 1pm with my script. Thank you for your time either way.
        Last edited by betsuni_123; 03-22-2024, 05:33 PM.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        5 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        8 responses
        61 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        4 responses
        3,289 views
        1 like
        Last Post jgualdronc  
        Started by Option Whisperer, Today, 09:55 AM
        0 responses
        5 views
        0 likes
        Last Post Option Whisperer  
        Started by halgo_boulder, 04-20-2024, 08:44 AM
        2 responses
        24 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X