Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Second instrument signal

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

    Second instrument signal

    Hi,

    I want to add a second instrument and set a variable when Close goes above SMA(14) for the second instrument and use the variable to trigger other signals.

    I have:
    Add("IBM", PeriodType.Day, 1);

    and then

    if (Closes[1][0] > SMA(14)[0])
    variable =
    1;

    I tried using the BarsInProgress method but I keep getting errors about type and SMA.

    Please help...


    #2
    TexFly,

    I am happy toa ssist you.

    I would suggest using :

    SMA(Closes[1], 14)[0] here instead to link to your second series.
    Adam P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    648 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X