Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to filter out of specific timeframes?

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

    how to filter out of specific timeframes?

    hi there!

    i am new to programming and just getting started in putting a strategy together that i was trading "by hand" recently.
    i need to filter out highs and lows for specific timeframes (say 9:00am to 17:00pm) not only for the previous day, but also 2 and 3 days in advance.

    example:

    // Condition set 1
    if (GetCurrentAsk() > PriorDayOHLC().PriorHigh[0])
    {
    EnterLong(
    1, "go long");
    }


    so what would i put to get me the high of the time between 9:00 and 17:00?
    and would i put to call the same of two (or more) days earlier?

    thanks so far!



    #2
    You would want to work in conjunction with GetBar() to get a bar [] that goes to the previous and 3rd day back. Then you would just pass in the correct [] index into your PriorDayOHLC() indicator to get the values you are seeking.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X