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 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