Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ignored SubmitOrderManaged() method

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

    Ignored SubmitOrderManaged() method

    •By default, orders submitted via Entry() and Exit() methods automatically cancel at the end of a bar if not re-submitted.
    I'm using Managed approach,Calculate.OnBarClose, my orders EnterLongStopMarket/EnterShortStopMarket, EntryHandling.AllEntries, EntriesPerDirection = 1.

    My strategy placed EnterLongStopMarket 1 tick above 23 bar (see pic). As I know if it didn't trigger next bar it will be cancelled. But before that the strategy places another order at 24 bar but it's not possible bc previous order is still there. So this behavior is ok?

    Trace:
    Code:
    9/28/2020 1:11:31 PM Strategy 'Strategy16/-1': Entered internal SubmitOrderManaged() method at 9/28/2020 1:11:31 PM: BarsInProgress=0 Action=Buy OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=11275.75 SignalName='23' FromEntrySignal='' NQ 03-21
    9/28/2020 1:11:31 PM Strategy 'Strategy16/-1': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='23' Mode=Price Value=11266.25 IsSimulatedStop=False IsMarketIfTouched=False NQ 03-21
    9/28/2020 1:11:31 PM Strategy 'Strategy16/-1': Entered internal SetStopTarget() method: Type=Target FromEntrySignal='23' Mode=Price Value=11329.75 IsSimulatedStop=False IsMarketIfTouched=False NQ 03-21
    9/28/2020 1:12:17 PM Strategy 'Strategy16/-1': Entered internal SubmitOrderManaged() method at 9/28/2020 1:12:17 PM: BarsInProgress=0 Action=Buy OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=11271.00 SignalName='24' FromEntrySignal='' NQ 03-21
    9/28/2020 1:12:17 PM Strategy 'Strategy16/-1': Ignored SubmitOrderManaged() method at 9/28/2020 1:12:17 PM: BarsInProgress=0 Action=Buy OrderType=StopMarket Quantity=1 LimitPrice=0 StopPrice=11271.00 SignalName='24' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties' NQ 03-21
    9/28/2020 1:12:17 PM Strategy 'Strategy16/-1': Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='24' Mode=Price Value=11263.5 IsSimulatedStop=False IsMarketIfTouched=False NQ 03-21
    9/28/2020 1:12:17 PM Strategy 'Strategy16/-1': Entered internal SetStopTarget() method: Type=Target FromEntrySignal='24' Mode=Price Value=11327 IsSimulatedStop=False IsMarketIfTouched=False NQ 03-21
    9/28/2020 1:12:17 PM Strategy 'Strategy16/-1': Cancelled expired order: BarsInProgress=0, orderId='NT-00029-12744' account='Backtest' name='23' orderState=Working instrument='NQ 03-21' orderAction=Buy orderType='Stop Market' limitPrice=0 stopPrice=11275.75 quantity=1 tif=Gtc oco='' filled=0 averageFillPrice=0 onBehalfOf='' id=-1 time='2020-09-28 13:11:31' gtd='2099-12-01' statementDate='2020-12-14' NQ 03-21
    Attached Files

    #2
    Hello Leeroy_Jenkins, thanks for writing in.

    If you give the order a unique signal name it will not submit the same order twice. On the second submission if the order has the same signal name and is called twice it will not submit again, but it will keep the order alive if the order was submitted on the previous bar. If you are not using a signal name and the order prices are different It would submit a different order.

    Please let me know if I can assist any further.

    Comment


      #3
      But they do have different SignalName.

      my code looks like this:

      if(..) //condition to go long
      {
      Count++; //count trades
      EnterLongStopMarket(High[0] + TickSize, "" + Count);
      SetStopLoss("" + Count, CalculationMode.Price, Low[0] - TickSize, false);
      SetProfitTarget("" + Count, CalculationMode.Price, TargetLong);
      }

      As I see in my trace SignalName='23' FromEntrySignal=''

      Next trade: SignalName='24' FromEntrySignal=''

      So they have different SignalName but empty FromEntrySignal in both cases. And different prices of course.



      Comment


        #4
        Hello Leeroy_Jenkins, thanks for your reply.

        This is expected to happen. The first order, 23, gets submitted, then on the next bar the 24 order is submitted and the 23 order is canceled. If you wanted to keep the 23 order alive on subsequent bars you would need to save the signal name as a variable and re-submit the order with the saved signal name.

        Please let me know if I can provide any further information.

        Comment


          #5
          It works, thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          86 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          151 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          79 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          53 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          61 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X