• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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.


        https://jessica-ninjatrader.tinytake...E4MF84ODUwMTc5
        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.
              https://ninjatrader.com/support/help...ryhandling.htm


              I prepared a short video where I implement these settings.
              https://jessica-ninjatrader.tinytake...IxMl84ODYwNTUw
              Jessica P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by gngmpwdws, Today, 09:58 PM
              0 responses
              4 views
              0 likes
              Last Post gngmpwdws  
              Started by darkgreen, Today, 03:35 PM
              1 response
              15 views
              0 likes
              Last Post lmatiukas  
              Started by imalil, Today, 09:46 PM
              1 response
              8 views
              0 likes
              Last Post Epistemophilic  
              Started by SAITON, Today, 09:03 PM
              0 responses
              6 views
              0 likes
              Last Post SAITON
              by SAITON
               
              Started by suprsnipes, Today, 08:26 PM
              0 responses
              5 views
              0 likes
              Last Post suprsnipes  
              Working...
              X