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 authority structure

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

    strategy authority structure

    Hello,

    I have a developed strategy that has a time filter for continued back-testing, i need to keep the time filter. however under no circumstances do I want trades during the 08:30 est announcements . is there a why to configure a strategy with just a time filter to override the other configured strategies?

    Also need to ask, the code for the current time filter isn't going to work, can someone point me in the direction of examples of how to code for two separate time sections ? I.e. 1800 thru 0815 next day and then 0845 thru 1530 or would I need to put as three 00:00 thru 0815, 0845 thru 1530, and 1800 thru 2359?

    Thanks in advance

    p22

    #2
    Hello Paladin22,

    Thank you for your post.

    There is not a way to configure a strategy that contains only a time filter that could be used to override other strategies. Time filter logic will have to be programmed in each individual strategy.

    Instead, you could create a time filter that checks if the time is 0000 - 0815, or 08:45 - 15:30, or 18:00 - 23:59 and enters a position. The time filter would look something like this:

    if ((ToTime(Time[0]) >= 180000 && ToTime(Time[0]) < 81500) || (ToTime(Time[0]) >= 84500 && ToTime(Time[0]) < 153000) || (ToTime(Time[0]) >= 180000 && ToTime(Time[0]) < 235900))
    {
    // Entry Signal: If current close greater than previous close, enter long
    if (Close[0] > Close[1])
    EnterLong();
    }

    Please see the SampleTimeFilter script in the help guide link below for more information.

    SampleTimeFilter - https://ninjatrader.com/support/help...to_limit_t.htm

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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by WHICKED, Today, 12:45 PM
    2 responses
    18 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by GussJ, 03-04-2020, 03:11 PM
    15 responses
    3,276 views
    0 likes
    Last Post xiinteractive  
    Started by Tim-c, Today, 02:10 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Taddypole, Today, 02:47 PM
    0 responses
    5 views
    0 likes
    Last Post Taddypole  
    Started by chbruno, 04-24-2024, 04:10 PM
    4 responses
    51 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Working...
    X