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

Scale-in Order management

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

    Scale-in Order management

    Hello NinjaTrader Team

    I am working on a price action scale-in order management. The logic goes as this (long example): Once my 1st entry limit long is filled, I place a stop/target order for that. In the meanwhile I place a 2nd limit buy order at 50% pull back of the price action setup (the full range of the painted bars), and change my first target order to breakeven. During that time, if my first target is filled, I will cancel my 2nd limit buy (2nd buy is always above the stop loss). I found the scale-in order works if the 1st and 2nd order are filled on the same bar, however the scale-in order will not get filled on the subsequent bars.

    Here are some visualization.
    Click image for larger version

Name:	image.png
Views:	171
Size:	46.1 KB
ID:	1252183

    Click image for larger version

Name:	image.png
Views:	115
Size:	42.0 KB
ID:	1252184
    The 1st limit buy is submitted within OnBarUpdate() while the scale-in order is submitted within OnExecutionUpdate(), basically, I want the 2nd order to be submitted if I am already holding a position.

    Is there something I am missing? ​​​Thank you very much.

    #2
    If these are managed orders, are you repeating the scale-in order on subsequent bars? Or, did you set the "good until canceled" flag when you placed the order? If no to both, it would automatically cancel at the end of the bar on which it was placed.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Originally posted by QuantKey_Bruce View Post
      If these are managed orders, are you repeating the scale-in order on subsequent bars? Or, did you set the "good until canceled" flag when you placed the order? If no to both, it would automatically cancel at the end of the bar on which it was placed.
      You are right. And I just fixed the problem. This seems like a silly question from me. Sorry I am new to NT coding. Thank you very much.

      Comment


        #4
        Hello dwerty,

        Thanks for your post.

        I am happy to see you have found a resolution to the behavior you were reporting.

        QuantKey_Bruce has noted something that is important to keep in mind when using the Managed Approach for order handling. By default, orders submitted via Entry() and Exit() methods automatically cancel at the end of a bar if not re-submitted. This is noted on the Managed Approach help guide page below.

        Managed Approach: https://ninjatrader.com/support/help...d_approach.htm

        You could set the isLiveUntilCanceled property is set to true the order will NOT expire at the end of a bar but instead remain live until the CancelOrder() method is called or its time in force is reached. Please refer to the help guide link below regarding Exit methods and the isLiveUntilCanceled property.

        https://ninjatrader.com/support/help...gstoplimit.htm
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        5 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        12 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        13 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,982 views
        3 likes
        Last Post jhudas88  
        Working...
        X