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 tkaboris, Today, 05:13 PM
    0 responses
    2 views
    0 likes
    Last Post tkaboris  
    Started by GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,281 views
    0 likes
    Last Post Leafcutter  
    Started by WHICKED, Today, 12:45 PM
    2 responses
    19 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by Tim-c, Today, 02:10 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Taddypole, Today, 02:47 PM
    0 responses
    5 views
    0 likes
    Last Post Taddypole  
    Working...
    X