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

3 Moving average conditions in strategy builder

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

    3 Moving average conditions in strategy builder

    Hi, How would i set my conditions with 3 MA crossover in Strategy builder?

    Ex: I have SMA 9, SMA 20 and SMA 30
    I'm going long when: SMA 9 cross over SMA 20 and then SMA 20 cross over SMA 30 (They are not necessarely happen simultaniously)
    I'm going short when SMA 9 cross below SMA 20 and then SMA 20 cross below SMA 30 (They are not necessarely happen simultaniously)

    Do i put theses condition in the same set or separately?

    Thank you.
    Last edited by McGyver270; 02-20-2024, 02:25 PM.

    #2
    Hello McGyver270,

    These would be two conditions sets. One for the long entry, and the second for the short entry.

    If the SMA 9 and SMA 20 are both crossing on the same bar, these would be in the same condition set.

    Below is a link to the 'Automate Your Trading with NinjaTrader's Strategy Builder' training video to learn how to use the Strategy Builder.


    As well as a link to a support article with helpful resources on getting started with NinjaScript and C#.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chelsea but that doesn't work. I have attached images to help you understand my request.
      Attached Files

      Comment


        #4
        Hello McGyver270,

        Apologies, I overlooked that you didn't want these crosses on the same bar.

        Instead you will need to split these into separate conditions and use a bool that is set to true when the first condition is true, and required to be true for the second condition where the bool is set back to false.

        Below is a link to an example.
        Hi, To improve a strategy, I would like the condition to enter a trade to be triggered only after a second crossing happens. Meaning, for instance we have a sthocastics crossing, but the strategy would only trigger when a crossing between 2 emas happen. Would the looking back N bars work? Can it be done within the builder
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by fx.practic, 10-15-2013, 12:53 AM
        5 responses
        5,404 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by Shai Samuel, 07-02-2022, 02:46 PM
        4 responses
        95 views
        0 likes
        Last Post Bidder
        by Bidder
         
        Started by DJ888, Yesterday, 10:57 PM
        0 responses
        8 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        159 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Yesterday, 09:29 PM
        0 responses
        8 views
        0 likes
        Last Post Belfortbucks  
        Working...
        X