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

Number of contracts set in strategy

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

    Number of contracts set in strategy

    Hello,

    This is something I am trying to do in Strategy Builder (no code) without success. I want to build 2 separate conditions upon which a single Long order will submit per condition met. The conditions are unique. Not possible to satisfy both conditions at the same time. But, it's possible both to be true during the same time, just not at the exact time. That means, during execution there could be 0, 1 Long, or 2 Long positions. Then, there will be a single condition that would trigger exit of all Long positions. It would not be possible to have for example 2 Long positions and the exit 1 of them. The Long exit position condition will always satisfy all Long positions if met.

    I have tried many times but the only thing I have accomplished is to place only 1 Long position of quantity 2. Any help?

    thanks

    #2
    Hi space_trader, thanks for posting.

    Did you set your Entries Per Direction property to 2 in the strategy settings? The default setting of 1 would prevent the strategy from entering the second long position. If you did could you please Export the strategy and post it so I can have a look?

    Best regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      hello Chris,

      That's right. I have tried all possible different settings combinations and didn't work. I have extracted and e-mail the strategy file to you (support request e-mail, subject: Number of contracts set in strategy).

      thanks

      Comment


        #4
        Hi, thanks for sending that in.

        It is using a third party indicator so I can not test on my machine. The next thing to do is add prints to make sure that your second entry condition is being hit e.g.

        Code:
        if (trade conditions)
              {
                EnterLong(Convert.ToInt32(DefaultQuantity) , "");
        [B]Print("First Entry Hit");[/B]
              }
        
               // Set 2
              if (trade conditions)
              {
                EnterLong(Convert.ToInt32(DefaultQuantity) , "");
        [B]Print("Second Entry Hit");[/B]
              }
        You can find the print statement in the Misc actions menu. If you do see the second entry and it's getting ignored double-check your entries per direction parameter, I noticed its still set to 1 by default, this can be changed in the general properties menu.

        Best regards.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by samish18, 04-17-2024, 08:57 AM
        16 responses
        55 views
        0 likes
        Last Post samish18  
        Started by arvidvanstaey, Today, 02:19 PM
        3 responses
        9 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by jordanq2, Today, 03:10 PM
        2 responses
        8 views
        0 likes
        Last Post jordanq2  
        Started by traderqz, Today, 12:06 AM
        10 responses
        18 views
        0 likes
        Last Post traderqz  
        Started by algospoke, 04-17-2024, 06:40 PM
        5 responses
        47 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X