Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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]
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by elirion, Today, 09:32 PM
    0 responses
    2 views
    0 likes
    Last Post elirion
    by elirion
     
    Started by cre8able, Today, 09:15 PM
    1 response
    5 views
    0 likes
    Last Post bltdavid  
    Started by cummish, Today, 08:43 PM
    0 responses
    10 views
    0 likes
    Last Post cummish
    by cummish
     
    Started by Option Whisperer, Today, 07:58 PM
    4 responses
    21 views
    0 likes
    Last Post Option Whisperer  
    Started by ETFVoyageur, 05-07-2024, 07:05 PM
    13 responses
    87 views
    0 likes
    Last Post ETFVoyageur  
    Working...
    X