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

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
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        That looks good. Thanks for help.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Klaus Hengher, Yesterday, 03:13 AM
        2 responses
        15 views
        0 likes
        Last Post Klaus Hengher  
        Started by Sebastian - TwinPeaks, Yesterday, 01:31 PM
        2 responses
        12 views
        0 likes
        Last Post Sebastian - TwinPeaks  
        Started by wbennettjr, 07-15-2017, 05:07 PM
        16 responses
        2,527 views
        1 like
        Last Post eladlevi  
        Started by Human#102, Yesterday, 09:54 AM
        2 responses
        7 views
        0 likes
        Last Post Human#102  
        Started by Patlpp, 08-16-2021, 03:10 PM
        10 responses
        498 views
        0 likes
        Last Post Joerg
        by Joerg
         
        Working...
        X