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

account position error

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

    account position error

    after the strategy closes a trade, in the main panel it keeps marking this position
    Attached Files

    #2
    Hello franatas,

    This is likely an issue with the position update from Apex/Rithmic.

    May I confirm you are updated to 8.1.1.7?

    If so, please send an email to support [at] ninjatrader [dot] com so we may request your log and trace files and report to our development.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      no but it already happen​ed to me with leeloo

      Comment


        #4
        How do I update just in case?
        Attached Files

        Comment


          #5
          Hello franatas,

          The latest release can be downloaded from the Client Portal.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            sorry for my clumsiness, i already did
            Now I'll see if it's corrected but I'll tell you what's been happening to me for a month with leeloo​

            Comment


              #7
              the same thing keeps happening
              Attached Files

              Comment


                #8
                Hello franatas,

                Please send an email to support [at] ninjatrader [dot] com so we may request your log and trace files and report to our development.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  You sent me to contact support by mail and I did so. unfortunately the only answer they gave me was to open a real account with ninja, that this happened because rithmic only gives some data by registered email, the truth is that I don't understand what this answer is due to.
                  The fact is that by having two apex accounts they resolved that it was like that and that's it, but now I'm with only one account, so this shouldn't happen but it does.
                  It is annoying that after closing an operation, it no longer opens until deactivating and reactivating the strategy, since the position that was opened at the beginning appears in the main panel of strategies and is not restored. could you help please, thank you​

                  Comment


                    #10
                    I think the code is correct

                    protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
                    {
                    if (execution.Order.OrderState == OrderState.Filled)
                    {
                    OrdenEntrada = null;
                    SumaRellenos = 0;
                    }
                    }

                    protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice, int quantity, int filled, double averageFillPrice, OrderState orderState, DateTime time, ErrorCode error, string nativeError)
                    {
                    AssignOrderToVariable(ref order);

                    if (OrdenEntrada != null && OrdenEntrada == order)
                    {
                    if (order.OrderState == OrderState.Cancelled || order.OrderState == OrderState.Rejected || order.OrderState == OrderState.Unknown)
                    {
                    OrdenEntrada = null;
                    SumaRellenos = 0;
                    }
                    }
                    }​​

                    Comment


                      #11
                      Hello franatas,

                      The issue is not that the exit order was not submitted, the issue is that the position update from the brokerage does not show the position as closed on the Positions tab of the Control Center is this correct?

                      This is likely due to the instrument update coming out of order and causing unexpected behavior.

                      We would need to track these so that we can provide the information to the brokerage.

                      Do you have a case number from your email to our support so that I may check in with the technician that received your case?
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        no, I don't have it anymore, sorry

                        Comment


                          #13
                          Originally posted by franatas View Post
                          I think the code is correct

                          protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
                          {
                          if (execution.Order.OrderState == OrderState.Filled)
                          {
                          OrdenEntrada = null;
                          SumaRellenos = 0;
                          }
                          }

                          protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice, int quantity, int filled, double averageFillPrice, OrderState orderState, DateTime time, ErrorCode error, string nativeError)
                          {
                          AssignOrderToVariable(ref order);

                          if (OrdenEntrada != null && OrdenEntrada == order)
                          {
                          if (order.OrderState == OrderState.Cancelled || order.OrderState == OrderState.Rejected || order.OrderState == OrderState.Unknown)
                          {
                          OrdenEntrada = null;
                          SumaRellenos = 0;
                          }
                          }
                          }​​
                          I don't think this solves your problem, but the additional code in red seems more correct,

                          protected override void OnExecutionUpdate(Execution execution, string executionId, double price,
                          int quantity, MarketPosition marketPosition, string orderId, DateTime time)
                          {
                          if (OrdenEntrada != null && OrdenEntrada == execution.Order && execution.Order.OrderState == OrderState.Filled)
                          {
                          OrdenEntrada = null;
                          SumaRellenos = 0;
                          }
                          }

                          Comment


                            #14
                            I'm just testing it to avoid the error, I don't know if it will solve it, but the code passes EntryOrder to null and I imagine that it no longer takes the panel into account, let's see what happens
                            if (OrdenEntrada == null && DayOk)
                            en vez de

                            if (Position.MarketPosition == MarketPosition.Flat && DayOk )
                            Last edited by franatas; 07-17-2023, 09:17 AM.

                            Comment


                              #15
                              I think my support email is entered incorrectly, since as you can see in the image I have tried to contact support via email as they told me, and it turns out that it is the sales department, can you provide me with a valid email address where I can write with this problem?
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by fx.practic, 10-15-2013, 12:53 AM
                              5 responses
                              5,403 views
                              0 likes
                              Last Post Bidder
                              by Bidder
                               
                              Started by Shai Samuel, 07-02-2022, 02:46 PM
                              4 responses
                              94 views
                              0 likes
                              Last Post Bidder
                              by Bidder
                               
                              Started by DJ888, Yesterday, 10:57 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by MacDad, 02-25-2024, 11:48 PM
                              7 responses
                              158 views
                              0 likes
                              Last Post loganjarosz123  
                              Started by Belfortbucks, Yesterday, 09:29 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post Belfortbucks  
                              Working...
                              X