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 JonesJoker, 04-22-2024, 12:23 PM
          8 responses
          41 views
          0 likes
          Last Post JonesJoker  
          Started by timko, Today, 06:45 AM
          0 responses
          3 views
          0 likes
          Last Post timko
          by timko
           
          Started by Waxavi, 04-19-2024, 02:10 AM
          2 responses
          39 views
          0 likes
          Last Post poeds
          by poeds
           
          Started by chbruno, Yesterday, 04:10 PM
          1 response
          44 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Max238, Today, 01:28 AM
          1 response
          25 views
          0 likes
          Last Post CactusMan  
          Working...
          X