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 fx.practic, 10-15-2013, 12:53 AM
              5 responses
              5,406 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by Shai Samuel, 07-02-2022, 02:46 PM
              4 responses
              98 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by DJ888, Yesterday, 10:57 PM
              0 responses
              8 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by MacDad, 02-25-2024, 11:48 PM
              7 responses
              160 views
              0 likes
              Last Post loganjarosz123  
              Started by Belfortbucks, Yesterday, 09:29 PM
              0 responses
              9 views
              0 likes
              Last Post Belfortbucks  
              Working...
              X