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

Can i set ExitLongStopLimit and EnterShortStop at the same price

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

    Can i set ExitLongStopLimit and EnterShortStop at the same price

    Hi everyone. In my strategy i need to set two orders (ExitLongStopLimit and EnterShortStop) at the same price.

    i did it this way

    Code:
     orderCloseLong = ExitLongStopLimit(Close[1], Close[1], "ExitLong", "LongStopLimit");
    orderCloseLong.IsLiveUntilCancelled = true;
    
    orderShort = EnterShortStopLimit(1, Close[1], Close[1], "ShortStopLimit");
    orderShort.IsLiveUntilCancelled = true;
    but

    21.12.2020 9:16:01 Strategy 'Test/221732070': Entered internal SubmitOrderManaged() method at 21.12.2020 9:16:01: BarsInProgress=0 Action=Sell OrderType=StopLimit Quantity=0 LimitPrice=3704,50 StopPrice=3704,50 SignalName='ExitLong' FromEntrySignal='LongStopLimit'
    21.12.2020 9:16:01 Strategy 'Test/221732070': Entered internal SubmitOrderManaged() method at 21.12.2020 9:16:01: BarsInProgress=0 Action=SellShort OrderType=StopLimit Quantity=1 LimitPrice=3704,50 StopPrice=3704,50 SignalName='ShortStopLimit' FromEntrySignal=''
    Strategy 'Test/221732070': An Enter() method to submit an entry order at '21.12.2020 9:16:00' has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.

    help me pleeease

    #2
    I think your problem is here: https://ninjatrader.com/support/helpGuides/nt8/index.html?managed_approach.htm#InternalOrderHandl ingRulesThatReduceUnwantedPositions

    Comment


      #3
      Leeroy_Jenkins, thanks for the hint, but unfortunately I didn't find the answer, it seems I don't know something about the rules of placing orders

      Comment


        #4
        Hello Kovalev,

        This would not be possible because of the types of orders you have chosen.

        A buy stop order must have the stop price above the current ask. A sell stop must have the stop price below the current bid.

        These cannot be set to the same price.
        Before trying to place the orders through NinjaScript, try placing these manually first.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello NinjaTrader_ChelseaB, please tell me - are there any ways to solve my problem?

          Comment


            #6
            Hello Kovalev,

            You would need to choose order types that are valid at those price levels.

            Buy limit orders are placed below the ask, sell limit orders are placed above the bid. A buy stop order must have the stop price above the current ask. A sell stop must have the stop price below the current bid.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ETFVoyageur, Today, 02:10 AM
            2 responses
            27 views
            0 likes
            Last Post ETFVoyageur  
            Started by ryan_21, Today, 08:46 PM
            1 response
            2 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by ESHunter, Today, 08:06 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by ETFVoyageur, 05-07-2024, 07:05 PM
            18 responses
            144 views
            0 likes
            Last Post bltdavid  
            Started by thumper57, Yesterday, 04:30 PM
            8 responses
            26 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X