Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Fill or Kill

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

    #16
    Hello,

    stopOrder = ExitLongStop(0, true, execution.Order.Filled, longStop,
    STOP_LOSS, LONG_POSITION);
    The execution.Order.Filled will get the quantity that was filled here. So if it was filled with 50 it would submit a stop order of 50. If you're logic allowed for the remaining portion to still be filled it would then fill the remaining quantity next time it was executed.

    I strongly encourage you do testing on your code before going live. You can test partial fills on a SIM account by going to Tools -> Options -> Simulator Tab -> Enforce partial fills

    Additionally TraceOrders = true may be of help



    I would also request this to be added to the next major release. Which will occur when by the way?
    All the informaiton publically available for NT8 can be found here: http://www.bigmiketrading.com/webina...r_8_preview_2/

    I will add your request to the list of users requesting this feature.

    Let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment


      #17
      Originally posted by NinjaTrader_Lance View Post
      The execution.Order.Filled will get the quantity that was filled here. So if it was filled with 50 it would submit a stop order of 50. If you're logic allowed for the remaining portion to still be filled it would then fill the remaining quantity next time it was executed.
      Which is why I put it in the onExecution() method - this way it would definitely be called again, correct?

      Also, if I receive the remaining fill I am still sitting on *one* order. After the second stopOrder assignment, wouldn't it be missing 50 contracts? Or will execution.Order.Filled be set to 100? I hope I understand the process correctly.

      Originally posted by NinjaTrader_Lance View Post
      I strongly encourage you do testing on your code before going live. You can test partial fills on a SIM account by going to Tools -> Options -> Simulator Tab -> Enforce partial fills

      Additionally TraceOrders = true may be of help

      Thanks I will explore that.

      Comment


        #18
        Originally posted by molecool View Post
        Which is why I put it in the onExecution() method - this way it would definitely be called again, correct?

        Also, if I receive the remaining fill I am still sitting on *one* order. After the second stopOrder assignment, wouldn't it be missing 50 contracts? Or will execution.Order.Filled be set to 100? I hope I understand the process correctly.
        I can't say definitively that it would be called again as this will depend on your other trade logic and how you handled the case when an order is partially filled. Because of this I would highly recommend doing the testing as previously mentioned to ensure all your logic triggers as expected.

        We have an example here that you may have already seen that shows OnExecution() being used to handle partial fills. http://www.ninjatrader.com/support/f...ead.php?t=7499
        LanceNinjaTrader Customer Service

        Comment


          #19
          Originally posted by NinjaTrader_Lance View Post
          I can't say definitively that it would be called again as this will depend on your other trade logic and how you handled the case when an order is partially filled. Because of this I would highly recommend doing the testing as previously mentioned to ensure all your logic triggers as expected.

          We have an example here that you may have already seen that shows OnExecution() being used to handle partial fills. http://www.ninjatrader.com/support/f...ead.php?t=7499
          Actually that is exactly the example I used as my template way back when. Given that very approach would you foresee any potential issues with the scenario I have described?

          Comment


            #20
            Originally posted by molecool View Post
            Actually that is exactly the example I used as my template way back when. Given that very approach would you foresee any potential issues with the scenario I have described?
            Actually, correction - I am assigning my stopOrder in the onExecution() method and not in the onBarUpdate() method per the quoted example. This is due to the fact I am running my own trailing stop logic.

            Comment


              #21
              From the sound of it you'll have to look at both those examples to help you write a script that suites your trading needs. Let me know if I can be of specific assistance along the way.
              LanceNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by JimB17, 01-10-2020, 10:27 AM
              75 responses
              2,790 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by JGriff5646, 05-07-2024, 10:02 PM
              3 responses
              28 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by KonAdams, 05-07-2024, 10:53 PM
              6 responses
              24 views
              0 likes
              Last Post KonAdams  
              Started by dp8282, Today, 07:35 AM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by Klaus Hengher, Yesterday, 03:13 AM
              3 responses
              17 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X