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

two different buy in one strategy

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

    two different buy in one strategy

    Hi. Running strategy builder, How can I run two different buy in one strategy. Say (A)one is MA cross over 5 and 10 then buy, (B)other is MA cross over 20 and 40 then buy. I cant figure it out. Tried different order handling settings but not working out. If I leave it at unique entry at 2, if A occurs twice before B happens, system buys 2 A signals but not B which happens later in time.

    Thank you

    #2
    Thank you for your question.


    This is exactly the situation signals were designed for. Attached is a code sample that should do something like what you are describing. Code samples we provide are for educational purposes, and are not intended for live trading, and are not guaranteed to accomplish any user goal or to be maintained.


    Please also note that EntriesPerDirection was set to 2.



    Please let us know if there are any other ways we can help.



    Resources :
    Attached Files
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Thank you for such a quick answer.

      Is it possible to do this in strategy builder?

      Comment


        #4
        This is possible through the strategy builder. This video will walk you through the steps.


        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Thank you

          Thank you Jessica. Your help solved it! Is there additional link for videos for strategy builder for me to get educated on? I would love to look more on these videos about current strategy builder.

          Thank you!!

          Comment


            #6
            Hi, Jessica.

            After taking a look at your video, I still have trouble. If I leave order handling to 2, if A occurs twice, then B, system will buy two As but not B. and it averages stop as a whole unit. I want to have A with one entry with its own $200 stop and B with 1 entry with its own $200 stops. does this make sense to you? So two unique strategies under 1 strategy.

            Thank you

            Comment


              #7
              For this situation, we have created the EntryHandling property. This property relies on signals which we've already discussed and implemented. When we set EntryHandling.UniqueEntries and set the EntriesPerDirection to 1, we make it so that there can be at most 1 entry per unique name. In our case, our unique names are "TradeSet1" and "TradeSet2", which means at most 1 contract can be launched from the 5/10 crossover and 1 from the 20/40 crossover.


              This help guide page has more information.



              I prepared a short video where I implement these settings.
              Jessica P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by WeyldFalcon, 12-10-2020, 06:48 PM
              14 responses
              1,426 views
              0 likes
              Last Post Handclap0241  
              Started by Barry Milan, Today, 10:35 PM
              0 responses
              2 views
              0 likes
              Last Post Barry Milan  
              Started by DJ888, Yesterday, 06:09 PM
              2 responses
              9 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by jeronymite, 04-12-2024, 04:26 PM
              3 responses
              40 views
              0 likes
              Last Post jeronymite  
              Started by bill2023, Today, 08:51 AM
              2 responses
              16 views
              0 likes
              Last Post bill2023  
              Working...
              X