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 Nyman, Today, 02:27 PM
        0 responses
        3 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by qewcool, Today, 10:26 AM
        2 responses
        23 views
        0 likes
        Last Post qewcool
        by qewcool
         
        Started by RISKYBUSINEZZ, Today, 09:07 AM
        4 responses
        33 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by tkaboris, Today, 08:30 AM
        3 responses
        19 views
        0 likes
        Last Post tkaboris  
        Started by DerkWehler, 07-15-2024, 11:35 AM
        19 responses
        57 views
        0 likes
        Last Post DerkWehler  
        Working...
        X