Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitShort(9001) completely ignored?

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

    #16
    Matthew, there's no correct sequence - you supply the sequence needed to track in your custom code, for maximum precision you need to check with the IOrder object states to finetune your approach, which would also cover the fill aspect, since you can directly check for that, too.

    You current strategy position can be checked with the Position object, the current account position can't be accessd from NinjaScript - thus you have to ensure those are in sync. For the initial synching when starting up NT7 would have an autoSync option which would send a market order to achieve Account Position == Strategy Position on startup.
    BertrandNinjaTrader Customer Service

    Comment


      #17
      Well, in that case, I am stumped.

      As you can see I have been trying for ages to write the order micro management code to do the tracking. All attempts have failed.

      So I guess that is the end of my usage of NT.

      Comment


        #18
        Hi Matthew,

        Sorry to hear that it's not doing what you want. If you pursue this further you should look into unmanaged orders in NT7. With unmanaged orders you have more control because you're not working with NinjaTrader's internal order handling system.
        Ryan M.NinjaTrader Customer Service

        Comment


          #19
          I have now managed to get the position tracking working using unmanaged orders. Phew! :-).

          Comment


            #20
            Glad to hear, Matt! Thanks for sharing.
            Ryan M.NinjaTrader Customer Service

            Comment


              #21
              Here is a class "trackPosition" which uses unmanaged orders to do (attempt to do) the position tracking.

              Anyhow, it provides the function:
              public void changePositionTo(int newPosition, double limitPrice)

              which should place orders to try to keep the strategy position as close as possible to newPosition. limitPrice = 0 will result in market orders.

              I have not tested it fully, but it appears to work so far.
              Attached Files

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Option Whisperer, Today, 09:55 AM
              0 responses
              3 views
              0 likes
              Last Post Option Whisperer  
              Started by geddyisodin, 04-25-2024, 05:20 AM
              8 responses
              58 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by halgo_boulder, 04-20-2024, 08:44 AM
              2 responses
              21 views
              0 likes
              Last Post halgo_boulder  
              Started by mishhh, 05-25-2010, 08:54 AM
              19 responses
              6,189 views
              0 likes
              Last Post rene69851  
              Started by gwenael, Today, 09:29 AM
              0 responses
              5 views
              0 likes
              Last Post gwenael
              by gwenael
               
              Working...
              X