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 Balage0922, Today, 07:38 AM
              0 responses
              3 views
              0 likes
              Last Post Balage0922  
              Started by JoMoon2024, Today, 06:56 AM
              0 responses
              6 views
              0 likes
              Last Post JoMoon2024  
              Started by Haiasi, 04-25-2024, 06:53 PM
              2 responses
              19 views
              0 likes
              Last Post Massinisa  
              Started by Creamers, Today, 05:32 AM
              0 responses
              6 views
              0 likes
              Last Post Creamers  
              Started by Segwin, 05-07-2018, 02:15 PM
              12 responses
              1,786 views
              0 likes
              Last Post Leafcutter  
              Working...
              X