Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Easiest way to program "Is the market up or down"

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

    Easiest way to program "Is the market up or down"

    I've been messing around trying to add another bar series to my strategy (like QQQQ day bars) and am struggling.

    Are there any existing NT indicators/logic that simply say if a major index (can be Dow, S&P, Nasdaq, etc) is higher or lower for the day? Like a boolean true/false or something like that?

    If not, what is the easiest way to program this? Use PriorDayOHLC and add the bar series for the instrument I want to reference and then compare it to the latest tick (or some current day bar series)? If so, please give me a brief example b/c I'm struggling to figure this out. Thanks,

    kc

    #2
    Hi kcsystemtrader, I'm not aware of such an indicator already developed or posted. Please check this link for info how to work with multiple bars objects - http://www.ninjatrader-support.com/H...struments.html

    Here's an idea for the dayLow value to get you started (assumes a double dayLow was alreaddy declared in the Initialize section) -

    Code:
    [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] (BarsInProgress == [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]1[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2])
    dayLow = PriorDayOHLC().PriorLow[[/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]];
    [/SIZE][/SIZE]

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    576 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X