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 lightsun47, Today, 03:51 PM
    0 responses
    4 views
    0 likes
    Last Post lightsun47  
    Started by 00nevest, Today, 02:27 PM
    1 response
    8 views
    0 likes
    Last Post 00nevest  
    Started by futtrader, 04-21-2024, 01:50 AM
    4 responses
    44 views
    0 likes
    Last Post futtrader  
    Started by Option Whisperer, Today, 09:55 AM
    1 response
    13 views
    0 likes
    Last Post bltdavid  
    Started by port119, Today, 02:43 PM
    0 responses
    9 views
    0 likes
    Last Post port119
    by port119
     
    Working...
    X