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

Time Filter

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

    Time Filter

    Hello
    I am trying to create a time filter using the strategy builder - trades only to be opened between 3pm and 6.40am

    I have the entry on 2 separate tabs

    Set 1
    "entry code"
    time filters

    Times[Default input][0].TimeOfDay>=new TimeSpan(15,0,0)
    Times[Default input][0].TimeOfDay<=new TimeSpan(23,59,0)

    Set 2
    "entry code"
    time filters
    Times[Default input][0].TimeOfDay>=new TimeSpan(0,0,0)
    Times[Default input][0].TimeOfDay<=new TimeSpan(6,40,0)


    I am still returning values between 6.41am and 2.59pm

    Thanks for any help

    Stefan





    #2
    Hello Stefan,

    Thanks for your post.

    Using your time codes above, I do not see any activity between 6:40 AM and 3:00 PM on the chart as indicated by the dots. You may want to debug by printing a dot when your filter conditions are true. You may want to simplify the strategy (if you have other things in there, or create a new one of only the filter conditions).


    Click image for larger version

Name:	sdauteuil-1.PNG
Views:	366
Size:	79.3 KB
ID:	1063352
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ETFVoyageur, Today, 07:05 PM
    0 responses
    7 views
    0 likes
    Last Post ETFVoyageur  
    Started by Orion815, 05-02-2024, 08:39 AM
    2 responses
    18 views
    0 likes
    Last Post Orion815  
    Started by suroot, 02-25-2017, 04:43 AM
    11 responses
    2,551 views
    0 likes
    Last Post Zilvercat  
    Started by Rogers101, 05-05-2024, 11:30 AM
    16 responses
    50 views
    0 likes
    Last Post Rogers101  
    Started by ninza33, Today, 12:31 PM
    2 responses
    12 views
    0 likes
    Last Post ninza33
    by ninza33
     
    Working...
    X