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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X