Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stuck historical positions

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

    Stuck historical positions

    I am trying to clear 7 "stuck" historical positions from my simulation account. No matter what options I choose, they return exactly as if I had done nothing when I restart my strategies...every morning, intraday, mid day, after the close, it doesn't matter. I can not remove them from my strategies page.

    They do not show up on my positions tab however.

    I have tried to express this several different ways now and am not seeming to be getting an answer to the question I am asking.

    Thank you in advance for any solution to this problem.

    Regards,

    Andrew

    #2
    Hello Andrew,
    Please reset the Simulator account to clear the stuck orders.

    Resetting a simulation account will clear all historical trade data from this account. Please follow the instructions below to reset a simulation account.
    • From the NinjaTrader Control Center window select the menu Tools > Options
    • Select the "Simulator" tab
    • Press the "Reset" button
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      I am sorry Joydeep, I misspoke:

      the positions started last week in my simulation account, but I was working on other things. Now they have followed my strategies over to my Interactive Broker Simulation Account:

      Every time I load my strategies, morning afternoon or night, these positions reappear regardless of price. Resetting the NT Sim accounts did not work.

      Apologies, please let me know what to try next.

      Regards,

      Andrew

      Comment


        #4
        Hello Andrew,
        To assist you further may I know do you have open positions in your IB simulator/paper account.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          I have open positions in the IB paper account. Some are legitimate.

          But some are not. If I flatten one of these "Stuck Positions" manually, when I restart the strategy in NT, the position immediately reappesrs in my NT GUI and NT then send an order over to my IB account so that the position can be recreated over there as well.

          This is literally driving me nuts.

          How do you simply tell your Ninja Script strategies that they are flat and should remain flat until the strategy next executes? Under Options >> Strategies >> NinjaScript, I see two options:

          -- Wait until flat before executing live (which I do not want); or
          -- Immediately sumbit live working historical orders (which i do not want)

          Where is the option that says "Allow me to manually exit a position when I choose to, so that I can flatten my account in an instrument RIGHT NOW which will allow me to use this strategy with real time data immediately??

          Thank you and regards,



          Andrew

          Comment


            #6
            Hello Andrew,
            Thanks for the clarification.

            Unfortunately there are no options/settings of that nature.

            As an alternative you can create some custom button in your code from where you can direct the strategy to exit any position.

            Please refer to this code which demonstrates how to create custom buttons via your NinjaScript code.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              Thank you joydeep Let me make sure I understand you correctly:

              if I implement these buttons, will i be able to close my position that is unwanted, and at the same time, reset the strategy that I want it to be removed from?

              If so, that would be very helpful.

              Is my understanding correct?

              Regards,

              Andrew

              Comment


                #8
                Hello Andrew,
                Say you are long. However you do not want to go long at that point and you want to go flat. You can do so via the custom buttons.
                JoydeepNinjaTrader Customer Service

                Comment


                  #9
                  will it reset the strategy position to flat? I do not trade from charts ever. this is what i want, for the account and strategy position to go to flat when i sell the shares using this button...or another method if the answer is no.

                  Comment


                    #10
                    Hello Andrew,
                    In such scenario I would suggest not to evaluate the codes on historical bars.

                    Code:
                    protected override void OnBarUpdate()
                    {
                       if (Historical) return;
                      //rest of the code
                    }
                    This way you wont be evaluating any code on historical bar and you will be flat when you initialize the strategy.
                    JoydeepNinjaTrader Customer Service

                    Comment


                      #11
                      TY Joydeep...final question:

                      Do I use the code quoted below TOGETHER with the buttons to get the results I am searching for, or just the code below by itself?

                      Regards,

                      Andrew


                      Originally posted by NinjaTrader_Joydeep View Post
                      Hello Andrew,
                      In such scenario I would suggest not to evaluate the codes on historical bars.

                      Code:
                      protected override void OnBarUpdate()
                      {
                         if (Historical) return;
                        //rest of the code
                      }
                      This way you wont be evaluating any code on historical bar and you will be flat when you initialize the strategy.

                      Comment


                        #12
                        Hello Andrew,
                        No, they are independent of each other and you dont have to use the buttons.

                        Also can you please upload some screenshot showing the "stuck" orders. Please upload the screenshot of the Strategies tab also.
                        JoydeepNinjaTrader Customer Service

                        Comment


                          #13
                          These are not .stuck orders so much as they are positions. i can not close.

                          They reappear no matter what i do each morning now. I will upload shortly.

                          Comment


                            #14
                            Code:
                            if (Historical) return;
                            This was all the fix needed. Thank you Joydeep.

                            Comment


                              #15
                              Hi JoyDeep,

                              I have the same problem as this fellow and so I searched the forums and found your solution, which is..

                              if (Historical) return;

                              OK that's fine as a work-around, but now I cannot view the historical trades that the strategy WOULD have made had it been active during historical trades.

                              Clearly the strategy saw the last 'historical' trade as un-closed (SIM101 acct) and so it would not employ ANY real-time trades.

                              My problem here is I too cannot 'delete' the historical trades despite resetting and clearing the SIM101 account history.

                              There's got to be a problem somewhere in the software because nothing we do will clear the "ghost" positions/trades. - Or I am doing it wrong, but I've already followed how to clear the SIM101 account and reset it. No trades show up in the execution box, yet they show up on my chart - Just as the original poster has said.



                              Originally posted by NinjaTrader_Joydeep View Post
                              Hello Andrew,
                              No, they are independent of each other and you dont have to use the buttons.

                              Also can you please upload some screenshot showing the "stuck" orders. Please upload the screenshot of the Strategies tab also.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by GussJ, 03-04-2020, 03:11 PM
                              11 responses
                              3,227 views
                              0 likes
                              Last Post xiinteractive  
                              Started by andrewtrades, Today, 04:57 PM
                              1 response
                              13 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by chbruno, Today, 04:10 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post chbruno
                              by chbruno
                               
                              Started by josh18955, 03-25-2023, 11:16 AM
                              6 responses
                              440 views
                              0 likes
                              Last Post Delerium  
                              Started by FAQtrader, Today, 03:35 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post FAQtrader  
                              Working...
                              X