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 hdge4u, 04-29-2024, 12:23 PM
    5 responses
    28 views
    0 likes
    Last Post MisterTee  
    Started by llanqui, 01-25-2024, 06:15 PM
    9 responses
    64 views
    0 likes
    Last Post MisterTee  
    Started by tradingnasdaqprueba, 05-07-2024, 03:42 AM
    16 responses
    65 views
    0 likes
    Last Post tradingnasdaqprueba  
    Started by Vulgoth_t_Destroyer, 05-09-2022, 04:45 PM
    55 responses
    5,463 views
    0 likes
    Last Post BartMan
    by BartMan
     
    Started by DawnTreader, 05-08-2024, 05:58 PM
    16 responses
    52 views
    0 likes
    Last Post DawnTreader  
    Working...
    X