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 Karado58, 11-26-2012, 02:57 PM
              8 responses
              14,828 views
              0 likes
              Last Post Option Whisperer  
              Started by Option Whisperer, Today, 09:05 AM
              0 responses
              1 view
              0 likes
              Last Post Option Whisperer  
              Started by cre8able, Yesterday, 01:16 PM
              3 responses
              11 views
              0 likes
              Last Post cre8able  
              Started by Harry, 05-02-2018, 01:54 PM
              10 responses
              3,204 views
              0 likes
              Last Post tharton3  
              Started by ChartTourist, Today, 08:22 AM
              0 responses
              6 views
              0 likes
              Last Post ChartTourist  
              Working...
              X