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

Multiple Targets using StopLimit Entry

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

    Multiple Targets using StopLimit Entry

    When entering the market via a market order trading 2 contracts, I am able to create two exit orders each trading a single contract and a single stop order trading 2 contracts. The entire transaction works exactly as expected.
    // market order entry
    EnterShort(2, "Entry");
    // on execution of "Entry"...
    stopOrder = ExitShortStopMarket(0,true,2,stopPrice,"Entry-Stop","Entry");
    targetOrder1 = ExitShortLimit(0,true,1,target1,"Entry-T1","Entry");
    targetOrder2 = ExitShortLimit(0,true,1,target2,"Entry-T2","Entry");

    // on execution of "Entry-T1"
    I move "Entry-Stop" into an entry-plus-one position using ChangeOrder(), and I set targetOrder1 = null;

    As I stated, this works flawlessly.

    However, when I try the exact same approach using a stop limit entry, I get different results:

    // stop limit entry
    (
    EnterShortStopLimit(0, true, 2, 0, entryPrice, "Entry");


    When target one is filled (a single contract), the remaining target and the stop are both cancelled leaving an open position of the 1 remaining contract (entered with 2).

    I am utterly baffled by this. I'd rather not create multiple entry orders when using a StopLimitOrder entry, especially seeing as how I get the exact response I am looking for with the Mar****rder entry. That being said, if it is the only way, I'll get 'er done. I just don't want to waste my time if there is something simple I am missing.

    Thanks ;-)
    Last edited by efagerstrom; 12-09-2018, 10:01 AM.

    #2
    Hello efagerstrom,

    My first recommendation would be to use separate entries and exits for each quantity. Trying to use multiple exits for the same entry can cause overfills, the position becoming double and reversing, and can cause positions to be left open.

    However, I will test this and inquire with our development if this is expected behavior.
    I appreciate your patience.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks you, Chelsea ;-)

      Comment


        #4
        Hello efagerstrom,

        Thank you for your patience.

        There is no expected behavior as scaling in and out of Managed Orders should be done with an order for each quantity upon entry and exit.

        You can find an example of scaling in and out at the following link: https://ninjatrader.com/support/foru...osition?t=3751

        Please let me know if you have any questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by WeyldFalcon, 12-10-2020, 06:48 PM
        14 responses
        1,426 views
        0 likes
        Last Post Handclap0241  
        Started by Barry Milan, Today, 10:35 PM
        0 responses
        2 views
        0 likes
        Last Post Barry Milan  
        Started by DJ888, Yesterday, 06:09 PM
        2 responses
        9 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        40 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Today, 08:51 AM
        2 responses
        16 views
        0 likes
        Last Post bill2023  
        Working...
        X