Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Handling Open Positions After NT Restart

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

    Handling Open Positions After NT Restart

    I just purchased a license for NT, and am testing my strategy against a demo FXCM account (!). I restarted NT with open positions and profit target orders at FXCM to see if NT would retain knowledge of these things after restart.

    It did! When I restarted NT, I saw on the Position tab that it knew that I had positions open at FXCM. I also saw that it knew that I had working Profit Target orders.

    Note that in my strategy, I don't use "If (Historical), return"; and I use "Wait until flat before executing live" and "Sync account position" as false so that NT doesn't cancel orders under any conditions.

    To exit a position, I check if Position.MarketPosition == MarketPosition.Short or Long before executing my exit logic. If a position is short and my exit logic is true, I ExitShort(), et al.

    Will my strategy recognize that there is an open position after this restart? It seems yes since I can see the position on the Positions tab. But I wanted to make sure with your team that even though I see an open position, that my strategy would also recognize it.

    Thanks in advance for your feedback during this awesome step in my trading journey.

    #2
    Just a follow-up that those settings didn't keep NT from cancelling my open profit target orders. But I have logic in my strategy to recreate the targets.

    Comment


      #3
      I found my answer here:


      I'll turn on "Immediately Submit Live Working Orders".

      Comment


        #4
        Originally posted by micprice View Post
        Just a follow-up that those settings didn't keep NT from cancelling my open profit target orders. But I have logic in my strategy to recreate the targets.
        ref: http://ninjatrader.com/support/forum...d.php?p=398054

        Comment


          #5
          Thanks koganam. Now I'm stuck at figuring out how to recreate my profit targets. It doesn't look like I can create one manually without creating a new order to buy/sell. My script logic to create new profit targets didn't work. I also have a bunch of pending cancel orders (formerly, my limit orders) that I can't seem to cancel manually. Any advice on how to handle reissuing my profit targets and getting rid of these pending cancel orders would be appreciated.

          Comment


            #6
            Originally posted by micprice View Post
            Thanks koganam. Now I'm stuck at figuring out how to recreate my profit targets. It doesn't look like I can create one manually without creating a new order to buy/sell. My script logic to create new profit targets didn't work. I also have a bunch of pending cancel orders (formerly, my limit orders) that I can't seem to cancel manually. Any advice on how to handle reissuing my profit targets and getting rid of these pending cancel orders would be appreciated.
            On what account. If it is the Sim101 account, or any Sim account for that matter, just reset the account. It is by far the simpler thing to do.

            Comment


              #7
              This is on a demo account at FXCM. Turns out NT recognizes that there is an open position -- the position exists if I cycle through the Account.Positions collection.

              However, on a strategy level, this position doesn't exit. If I attempt to set a profit target with ExitLongLimit, my strategy says (I have trace on):

              5/1/2015 4:00:00 PM Entered internal PlaceOrder() method at 5/1/2015 4:00:00 PM: BarsInProgress=0 Action=BuyToCover OrderType=Limit Quantity=404,000 LimitPrice=0.6511 StopPrice=0 SignalName='' FromEntrySignal=''
              5/1/2015 4:00:00 PM Ignored PlaceOrder() method: Action=BuyToCover OrderType=Limit Quantity=404000 LimitPrice=0.6511 StopPrice=0 SignalName='' FromEntrySignal='' Reason='This was an exit order but no position exists to exit'


              Even though a position does exist, and can be referenced in the Account.Positions collection.

              Now I'm stuck -- I have a position that was opened prior to restarting NT, and I can't get my strategy to recognize the position. However, on an account level, my strategy verifies that the position exists.

              Comment


                #8
                I'm getting closer. I managed to get my strategy to recognize the position by setting Positions[0] = the position object from the Account.Positions collection. This may be hack, but for now it's working. I can see the position from FXCM in my NT strategies tab, and Position.MarketPosition reflects that a position is there.

                I still can't set a profit target since I don't have the from entry signal name from my original order. So for now, I'll just manage the profit taking exit programmatically.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Jonafare, 12-06-2012, 03:48 PM
                5 responses
                3,986 views
                0 likes
                Last Post rene69851  
                Started by Fitspressorest, Today, 01:38 PM
                0 responses
                2 views
                0 likes
                Last Post Fitspressorest  
                Started by Jonker, Today, 01:19 PM
                0 responses
                2 views
                0 likes
                Last Post Jonker
                by Jonker
                 
                Started by futtrader, Today, 01:16 PM
                0 responses
                8 views
                0 likes
                Last Post futtrader  
                Started by Segwin, 05-07-2018, 02:15 PM
                14 responses
                1,792 views
                0 likes
                Last Post aligator  
                Working...
                X