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 burtoninlondon, Today, 12:38 AM
    0 responses
    5 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    14 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    13 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,983 views
    3 likes
    Last Post jhudas88  
    Working...
    X