Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Set Up an Alert on 2 Different Timeframes

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

    How to Set Up an Alert on 2 Different Timeframes

    Hello,
    Is there a simple way to, lets say for example, set up a 1-minute 12-period SMA crossing over a 5-minute, 20-period SMA?

    #2
    Just to add, I just realized I posted on the "Ninjatrader 7/Indicator Development". Just to let you know, this is for Ninjatrader 8. Sorry about that.

    Comment


      #3
      Hello RookieTrader,

      Thanks for your post.

      I have moved the forum thread to the NinjaTrader Desktop Indicator Development section of the Forums since you mentioned this inquiry is about NinjaTrader 8, not NinjaTrader 7.

      To have an indicator calculate values based on a secondary data series, you could add the secondary data series to the script by using the AddDataSeries() method.

      Then, you could specify the BarsArray of the series you want to use when calling the indicator.

      For example, SMA(BarsArray[1], 20)[0] would be used to have the SMA indicator calculate values based on the first added series in a NinjaScript.

      Whereas SMA(12)[0] would mean the SMA indicator is calculating using the primary series the script is running on.

      You could create your condition comparing the two SMA values and then call Alert() within your condition.

      See the help guide documentation below for more information.

      SMA: https://ninjatrader.com/support/help...simple_sma.htm
      AddDataSeries: https://ninjatrader.com/support/help...dataseries.htm
      BarsArray: https://ninjatrader.com/support/help.../barsarray.htm
      Multi-Timeframe/Multi-Series NinjaScripts: https://ninjatrader.com/support/help...nstruments.htm
      Alert: https://ninjatrader.com/support/help.../nt8/alert.htm
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment


        #4
        That looks good. Thanks for help.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        580 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        335 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
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X