Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

bug when using ExitShortStopMarket

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

    bug when using ExitShortStopMarket

    hello
    i have issue when trying to make stop trail - using Playback
    the scenario is like this:
    1. get into possition - 10 units
    2. set stoploss - 10 units
    3. set profit-target - 5 units
    ---------------------------------
    profit target - executed - 5 units sold
    I cancel the old stoploss and set a new one.

    if (_stopLossShortOrder != null)
    CancelOrder(_stopLossShortOrder);

    ExitShortStopMarket(dStopLossPrice, ORDER_e.StopLoss_Short.ToString(), ORDER_e.Short_market_entry.ToString());

    in the order list i see order accepted - buy when the price hit the stoploss - the order is canceled instaed of sell execution !

    Please advice
    thanks
    Oren
    Attached Files

    #2
    Hello orenytz,

    Thank you for the post.

    I just wanted to clarify, are you trying to do a change order here to update the order after the partial fill or specifically cancel and resubmit a new order? Generally for trailing orders you would not need to resubmit it but only change it when you want a new price or modification. If the situation is that this is just for a change order I would likely suggest trying to use ChangeOrder here instead of CancelOrder and resubmitting it. https://ninjatrader.com/support/help...hangeorder.htm

    If you are specifically trying to cancel the order and submit a totally new stop market order I would likely want to see a specific sample of the output which details the events of the orders so I can better understand what happened. It may also be helpful to upload a small working sample that submits one order in realtime with targets to demonstrate the problem. As this is happening in playback I should be able to test that to see the same result.

    I look forward to being of further assistance.

    Comment


      #3
      hello Jesse
      sorry for delay feedback
      problem solved.
      it seems that when profit target executed - the stoploss won't update with the new possition - and then sell more units then it have.
      so i update the stoploss with new possition count and now it works.
      should'nt it be managed automatically? or something i'm doing is wrong?

      Comment


        #4
        Hello orenytz,

        Thank you for the reply.

        For the managed approach to control scaling you would need to submit two separate sets of targets and have two sets of entries. If you use the signal names that is important. In this case it would be a profit target/stop with 5 quantity and then another profit and stop with 5 quantity to make 10 total, two entries with separate signal names would be used with 5 quantity each and the targets would close part of the position for an individual entry. If you are otherwise controlling the orders yourself you would likely need to update the order however we don't have any samples showing that for the managed approach.




        I look forward to being of further assistance.

        Comment


          #5
          Hello Jesse
          now it's clear. thank you.
          i update the stop loss with updated quantity and it works well !
          thanks again!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          49 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          126 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          67 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X