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 pibrew, Today, 06:37 AM
        0 responses
        1 view
        0 likes
        Last Post pibrew
        by pibrew
         
        Started by rbeckmann05, Yesterday, 06:48 PM
        1 response
        14 views
        0 likes
        Last Post bltdavid  
        Started by llanqui, Today, 03:53 AM
        0 responses
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        11 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        15 views
        0 likes
        Last Post AaronKoRn  
        Working...
        X