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 NullPointStrategies, Today, 05:17 AM
    0 responses
    25 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    121 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    64 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    46 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X