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

Multiple Stop Market Orders (Long/Short error)

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

    Multiple Stop Market Orders (Long/Short error)

    Hi NT Community,
    I am trying to place two orders (StopLong and StopShort) but surprisingly the Platform is rejecting the second order (ie. If I place LongStopMarket and ShortStopMarket order it rejects the Short order and if I place in reverse order then it is rejecting the Long order ).

    This is how I am placing the two orders.

    #################################
    _enterLongOrder = EnterLongStopMarket( InitialLotSize, Open[0] + 100 *A * TickSize , "Open Long");
    _enterShortOrder = EnterShortStopMarket( InitialLotSize, Open[0] + 100 *C * TickSize , "Open Short");
    ################################

    PS: Usually the Stop point is very father away from the current price so this isn't a issue of placing stop below the current Ask/Bid price.

    Need Help !
    Last edited by dastaan; 06-21-2020, 11:31 PM.

    #2
    Here is the Order output :
    01/06/2020 09:32:53 Strategy 'Same order/201627812': Entered internal SubmitOrderManaged() method at 01/06/2020 09:32:53: BarsInProgress=0 Action=Buy OrderType=StopMarket Quantity=4 LimitPrice=0 StopPrice=0.6729'2 SignalName='Open Long' FromEntrySignal='' 01/06/2020 09:32:53 Strategy 'Same order/201627812': Entered internal SubmitOrderManaged() method at 01/06/2020 09:32:53: BarsInProgress=0 Action=SellShort OrderType=StopMarket Quantity=4 LimitPrice=0 StopPrice=0.6709'2 SignalName='Open Short' FromEntrySignal='' 01/06/2020 09:32:53 Strategy 'Same order/201627812': Ignored SubmitOrderManaged() method at 01/06/2020 09:32:53: BarsInProgress=0 Action=SellShort OrderType=StopMarket Quantity=4 LimitPrice=0 StopPrice=0.6709'2 SignalName='Open Short' FromEntrySignal='' Reason='An Enter() method to submit an entry order has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.'

    Comment


      #3
      Hello dastaan,

      Thank you for your posts.

      When using the Managed approach with a strategy, methods that generate orders to enter a position will be ignored if:

      •A position is open and an order submitted by a non market order exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction

      •A position is open and an order submitted by a set method (SetStopLoss() for example) is active and the order is used to open a position in the opposite direction

      •A position is open and two or more Entry methods to reverse the position are entered together. In this case the second Entry order will be ignored.

      •The strategy position is flat and an order submitted by an enter method (EnterLongStopMarket for example) is active and the order is used to open a position in the opposite direction

      •The entry signal name is not unique

      It appears you're running into #4 - The strategy position is flat and an order submitted by an enter method is active and the second order would be used to open the position in an opposite direction.

      You could certainly look at using the unmanaged approach instead. With the unmanaged approach the handling rules above don't apply, and it would allow both those orders to be submitted simultaneously. However, the unmanaged approach would only be recommended for very advanced programmers, as you would need to create your own handling for overfills, rejections, and connection loss handling. You can find out more about the unmanaged approach in our help guide here:



      Please let us know if we may be of further assistance to you.
      Kate W.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      4 views
      0 likes
      Last Post Javierw.ok  
      Started by timmbbo, Today, 08:59 AM
      2 responses
      10 views
      0 likes
      Last Post bltdavid  
      Started by alifarahani, Today, 09:40 AM
      6 responses
      40 views
      0 likes
      Last Post alifarahani  
      Started by Waxavi, Today, 02:10 AM
      1 response
      18 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by Kaledus, Today, 01:29 PM
      5 responses
      15 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X