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

Positions accounts exceeds entryhandling

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

    Positions accounts exceeds entryhandling

    Dear all.

    My strategy is developed based on EntryHandling.AllEntries=1.

    But in my account position appears 2 Long positions. I don´t know why add 1 new position in my strategy?.

    Attached you can find the executions and the positions.

    Bes regards
    Attached Files

    #2
    Hello memonic,

    Thanks for opening the thread.

    Strategies manage their own virtual position that is not to be confused with the Account position. This design is in place so you can run concurrent strategies on the same instrument and be able to go short and long at the same time, for example.

    The Strategies tab of the Control Center will tell you the strategies current virtual position as well as the account position on that instrument.

    To further troubleshoot a strategy to understand how it ended up in a certain position, debugging steps will need to be taken to monitor the logic that allowed the order methods to submit. We generally advise to add prints for the variables used to control your order entry conditions and to enable TraceOrders so you can observe the logic of your strategy as it processes in the Output window.

    An example of a good diagnostic print would be as follows:

    Code:
    Print("Entry Condition:  VarA: " + VairableA + " VarB: " + VariableB);
    if(VariableA == VariableB)
    {
    	Print("Condition true. Quantity: " + Quantity);
    	EnterLong(Quantity);
    }
    Debugging - http://ninjatrader.com/support/forum...ead.php?t=3418

    TraceOrders - http://ninjatrader.com/support/forum...ead.php?t=3627

    Account Position Vs. Strategy Position - http://ninjatrader.com/support/forum...ead.php?t=4033

    If you have any additional questions, please don't hesitate to write back.
    JimNinjaTrader Customer Service

    Comment


      #3
      Thanks Jim.

      In this case, what is my current position. Position=1 or Acct.Position=2

      Best regards
      Attached Files

      Comment


        #4
        Hello memonic,

        The Strategy has a position of 1 long and the Account has an overall position of 2 long. The Account position includes the Strategy position.
        JimNinjaTrader Customer Service

        Comment


          #5
          hello Jim.

          But this account has only 1 strategy. and the strategy has EntryHandling.AllEntries=1.

          Comment


            #6
            Hello memonic,

            The Strategy has a position of 1 long. This makes sense if the strategy has an EntriesPerDirection value of 1.

            The account is out of sync with the strategy. This could be a result of enabling and disabling the strategy so it adds a position of 1 long to the account before it is enabled again and adds another position of 1 long to the account.

            This could also be from a manual order submission outside of the strategy.

            Please let me know if there is anything else I can do to assist you further.
            JimNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bortz, 11-06-2023, 08:04 AM
            47 responses
            1,605 views
            0 likes
            Last Post aligator  
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            8 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            18 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            4 views
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            13 views
            0 likes
            Last Post Javierw.ok  
            Working...
            X