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

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.
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        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 zstheorist, Today, 07:52 PM
          0 responses
          3 views
          0 likes
          Last Post zstheorist  
          Started by pmachiraju, 11-01-2023, 04:46 AM
          8 responses
          149 views
          0 likes
          Last Post rehmans
          by rehmans
           
          Started by mattbsea, Today, 05:44 PM
          0 responses
          5 views
          0 likes
          Last Post mattbsea  
          Started by RideMe, 04-07-2024, 04:54 PM
          6 responses
          33 views
          0 likes
          Last Post RideMe
          by RideMe
           
          Started by tkaboris, Today, 05:13 PM
          0 responses
          5 views
          0 likes
          Last Post tkaboris  
          Working...
          X