Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to ignore signal if order is pending from bar[1]

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

    How to ignore signal if order is pending from bar[1]

    Guys,

    Rarely my strategy gives signals on two adjacent bars. My entries are with the default liveUntilCancelled (false), but my trace orders yields this:

    1/4/2009 7:35:00 PM Entered internal PlaceOrder() method at 1/4/2009 7:35:00 PM: Action=SellShort OrderType=Limit Quantity=0.02M LimitPrice=1.3924 StopPrice=0 SignalName='ShortX' FromEntrySignal=''
    1/4/2009 7:36:00 PM Entered internal PlaceOrder() method at 1/4/2009 7:36:00 PM: Action=SellShort OrderType=Limit Quantity=0.02M LimitPrice=1.3922 StopPrice=0 SignalName='ShortX' FromEntrySignal=''
    1/4/2009 7:36:00 PM Amended open order: Action=SellShort OrderType=Limit Quantity=20000 LimitPrice=1.3922 StopPrice=0 SignalName=ShortX' FromEntrySignal=''
    1

    i.e., my strategy is sending two orders. I trap for MarketPosition.Position == (long or short) to prevent this, but when I get two signals on adjacent bars, the first order isn't automatically cancelled yet by NT, and when it's not filled, I get a second order because there is no position. Is there anyway to prevent the second order or to cancel the first? I'd like to know how to do both because theoretically, the first would be a better price most of the time.

    Please advise, thanks.
    Last edited by crmcwi; 09-22-2009, 08:36 PM. Reason: inserted word "automatically"

    #2
    crmcwi, this is expected behavior, pending orders would be amended / updates if resubmitted as in your case. You can check with IOrders if the there are currently pending / working orders in your strategy -

    Comment


      #3
      check EntryOrder == null?

      Thanks Bertrand, but the issue is not the auto-amending, but the "duplication" of the order. I only want one order to be placed. I thought EntriesPerDirection = 1 would prevent the second entry, but may be not if the first order hasn't been filled.

      So, please tell me, will EntriesPerDirection = 1 keep the second order from being placed even if the first hasn't been filled?

      I think I can absolutely keep the second from being placed if I use the amend my condition with " && EntryOrder == null", yes?

      Comment


        #4
        crmcwi, then please use the EntryOrder == null check, as an entry is not 'counted' if sitting there unfilled.

        Comment


          #5
          thanks Bertrand, just to be sure, once I submit an entryOrder, it will not be null until it is filled or cancelled, yes?

          Comment


            #6
            Correct, once triggered it will be an active object.

            Comment


              #7
              Thank you Bertrand.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              637 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              366 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              107 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              569 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              571 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X