Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Moving Average Filter

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

    Moving Average Filter

    Good Evening I hope everyone is having a good weekend.

    I am sure that there is a very simple solution for this. I am attempting to filter my working strategy to only take a trade above or below a certain moving average. For an easy example, (not necessarily the same period moving average I am using), I want it to trade my strategy, but filtering to only take a long if we are above the 15 period SMA, and only take a short if the market is below the 15 period SMA. What combination of parameters must I use to make proper use of this moving average filter line. This seems like an easy solution but I am just not figuring it out. Thanks in advance for your help.

    #2
    Hi Superlite,
    We all started as Junior Members.
    The attached just uses the SMA filter. Add you other conditions and have fun.
    NT-Roland
    Attached Files

    Comment


      #3
      Hi NT-Roland,

      Thanks for the reply and for creating that for me. It seems as though that what you have created is not necessarily filtering, but rather being it's own strategy. The strategy is now using price crossing the SMA line as the entry and exit parameter into the trade rather than using my strategy as as the entry and exit. Do you have any other ideas we could try? Thanks.

      Comment


        #4
        Hello Superlite,
        You can simply add another condition to your existing set of conditions : Close[0] > SMA(15)[0] for long entry & Close[0] < SMA(15)[0] for short entry. Use Strategy Builder so you don't make a mistake. Hope it helps.
        Last edited by s.kinra; 10-17-2020, 11:08 PM.

        Comment


          #5
          Hello Superlite,

          If you have not already watched the Strategy Builder 301 training video I recommend this as a starting place.
          https://www.youtube.com/watch?v=HCyt...We0Nf&index=10

          I am also including a link to a forum post with helpful information about getting started with NinjaScript.
          https://ninjatrader.com/support/foru...040#post786040

          NT-Roland, thank you for your sample code and sample script.
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by wehewwehd, Today, 11:10 AM
          0 responses
          1 view
          0 likes
          Last Post wehewwehd  
          Started by my-trade, Today, 10:45 AM
          0 responses
          7 views
          0 likes
          Last Post my-trade  
          Started by localappleseed, Today, 09:51 AM
          0 responses
          4 views
          0 likes
          Last Post localappleseed  
          Started by wehewwehd, Today, 09:13 AM
          0 responses
          4 views
          0 likes
          Last Post wehewwehd  
          Started by aaajv, Yesterday, 06:45 AM
          3 responses
          22 views
          0 likes
          Last Post NinjaTrader_ThomasC  
          Working...
          X