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

Moving Average Ribbon Strategy

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

    Moving Average Ribbon Strategy

    I am trying to create a strategy where a group of EMA's must all close above/below a single SMA before a buy/sell order is triggered. Using Strategy Builder, I listed all of the EMA's (crossing above and below SMA) with the If All condition selected---simple enough, but the strategy does not work. Any ideas on what I am doing wrong?
    Thank you!
    Attached Files
    Last edited by markps400; 02-14-2018, 05:37 PM.

    #2
    Hello markps400,

    Thanks for your post.

    The cross conditions you have created would require that all of them (EMAs) cross the SMA on the same bar. I would expect that it would be unusual that all of the EMAs would crossbelow (or crossabove) the SMA 50 on the same bar. If you plot these on a chart you can see that this does not occur frequently, if at all.

    If the requirement is to have all the EMAs cross the SMA 50 then it would seem that you need only check that the EMA(20) has cross above/below the SMA(50) because the EMA(2) leads the EMA(4) which leads the EMA(6), etc etc.until you get to the slowest EMA(20).
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Paul!

      Comment


        #4
        Originally posted by markps400 View Post
        I am trying to create a strategy where a group of EMA's must all close above/below a single SMA before a buy/sell order is triggered. Using Strategy Builder, I listed all of the EMA's (crossing above and below SMA) with the If All condition selected---simple enough, but the strategy does not work. Any ideas on what I am doing wrong?
        Thank you!
        Also, another way for the condition may be to indicate if the cross has happened within the last N bars (or individual N bars for each EMA) instead of just the current bar to make sure all your EMA's have crossed the SMA.

        Comment


          #5
          Hello, I have a somewhat related question but figured I would add to this thread for sake of posterity...

          When creating an automated strategy using the moving average ribbon, how do I indicate whether all the moving averages are stacked positive or stacked negative? I simply entering in the strategy builder equals "rising" for stacked positive and "falling" for stacked negative but neither worked. Unfortunately no luck either with "true" and "false."

          Any suggestions greatly appreciated!
          Last edited by gravityflyer; 06-05-2022, 10:37 AM.

          Comment


            #6
            Hello gravityflyer,

            You are wanting to compare the value of one EMA to be greater than or less than another EMA?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello gravityflyer,

              You are wanting to compare the value of one EMA to be greater than or less than another EMA?
              Yes, but simply using the ribbon indicator (rather than adding a slew of individual EMAs to my strategy builder).

              Thanks!

              Comment


                #8
                Hello gravityflyer,

                You would need to make an indicator that calls these SMA calls and add plots and public Series<double> to return the Values[plot index], and set the Values[plot index][barsAgo index] to the value of those SMAs. Then you could call your indicator in your strategy with these preset SMA values.

                I'm trying to expose my variables to the strategy builder so everyone can have better use of the WaveTrend indicator (it has a lot of code). Explain this to me like I am 5 because this isnt the first time I've tried to figure it out and hit a wall. What is Series? I know its like an array that stores bars. Why not just call it


                As a heads up, the attachment in your post #1 is a strategy and not indicator.
                Last edited by NinjaTrader_ChelseaB; 06-06-2022, 03:11 PM.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by cre8able, Today, 03:20 PM
                1 response
                9 views
                0 likes
                Last Post cre8able  
                Started by fiddich, Today, 05:25 PM
                0 responses
                3 views
                0 likes
                Last Post fiddich
                by fiddich
                 
                Started by gemify, 11-11-2022, 11:52 AM
                6 responses
                804 views
                2 likes
                Last Post ultls
                by ultls
                 
                Started by ScottWalsh, Today, 04:52 PM
                0 responses
                4 views
                0 likes
                Last Post ScottWalsh  
                Started by ScottWalsh, Today, 04:29 PM
                0 responses
                9 views
                0 likes
                Last Post ScottWalsh  
                Working...
                X