• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can't cancel position by StopLoss

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

    Can't cancel position by StopLoss

    Hello.

    I make a strategy using Managed and Advanced Order Handling approach.
    Strategy have to work on UniRenko bars.
    UniRenko bars have "fake" open price, so I can't use ExitLong() and ExitShort(), since they close deal on Open price.

    In NT7 I used
    PHP Code:
    SetStopLoss"Signal Name"CalculationMode.PriceCloses[0][0], false ); 
    In NT8 It works on history too, but cause errors in real-time (please, look in attach).

    So, how to let SetStopLoss() work for me? It very clear and reliable. It don't need any additional efforts on order handling.

    And I didn't find any restrictions of using SetStopLoss() in way like this.
    https://ninjatrader.com/support/helpGuides/nt8/en-us/
    https://ninjatrader.com/support/help...d_approach.htm
    Attached Files
    Last edited by fx.practic; 08-13-2017, 08:15 AM.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic,

    The error indicates that the order is rejected by the broker. The managed approach was not violated but the price of the order is either at or below the ask price on the buy side or at or above the bid price on the sell side.

    I would recommend that you place your stop loss a few ticks away from the current price instead of at the current price.

    Also, when using a price as the stop loss value (or other order value), be sure the check that the price is on the correct side of the market before placing the order.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      So, there are no any other way to exit deal at price, nearest to current price, except market exit orders (ExitLong(), ExitShort()), right?
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        fx.practic,

        You could choose a price 1 tick above the ask or 1 tick below the bid with a stop order.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks, I understand logic.
          I tried, even, both:

          PHP Code:
          SetStopLossGetCurrentAsk() - TickSize );
          SetProfitTargetGetCurrentBid() + TickSize ); 
          But, I still have errors.

          NT8 superior-realistic sim-engine is suspected : StopOrder need time to be changed.
          On big replay speed it just have no time to be changed.
          Otherwise, on backtest stop losses works norm.
          So, may be ExitLongStopMarket(price) will help me.
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment


            #6
            Hello fx.practic,

            Are you setting the price of the stop loss after the entry order is placed or before it is placed?

            The stop loss will continue using the old price if it is not set and updated before a new order is placed.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Yes.
              ExitLongStopMarket() and ExitShortStopMarket() (resubmitted on each bar) solved the problem.

              So, not SetStopLoss( Close[0] ) for closing position generated problem, but regular stop loss, far from price on submitting before new position opens.

              And error appearance was depended from MarketReplay speed - so, it was difficult to locate.
              fx.practic
              NinjaTrader Ecosystem Vendor - fx.practic

              Comment


                #8
                Originally posted by fx.practic View Post
                Yes.
                ExitLongStopMarket() and ExitShortStopMarket() (resubmitted on each bar) solved the problem.

                So, not SetStopLoss( Close[0] ) for closing position generated problem, but regular stop loss, far from price on submitting before new position opens.

                And error appearance was depended from MarketReplay speed - so, it was difficult to locate.
                Right note, thank You, but I encountered this problem many times, so have instinct now: first SetStolLoss(), than EnterLong().
                fx.practic
                NinjaTrader Ecosystem Vendor - fx.practic

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by ksarin, Today, 12:39 PM
                3 responses
                12 views
                0 likes
                Last Post NinjaTrader_PatrickG  
                Started by ttodua, Today, 12:03 PM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by tomtr27, Today, 11:35 AM
                1 response
                9 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by Uregon, Today, 07:30 AM
                2 responses
                13 views
                0 likes
                Last Post bltdavid  
                Started by Induna, 02-20-2020, 05:38 AM
                4 responses
                26 views
                0 likes
                Last Post NinjaTrader_Kate  
                Working...
                X