Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

limit orders reversal

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

    limit orders reversal

    Hello everyone. I would like to request support on this easy question... When I use EnterShort() or EnterLong() commands the strategy reverses the position - no rush here. But I do want to use EnterShortLimit() and EnterLongLimit() and it simple DOES NOT reverse anything! How can it be handled?

    thanks!

    Code:
        
    private IOrder entryLongOrder 	= null;
    private IOrder entryShortOrder     = null;
    
    protected override void OnBarUpdate()
    {
      if (entryLongOrder == null && myTrigger())
    	entryLongOrder = EnterLongLimit(1, GetCurrentBid(), "Long");
      else if (entryShortOrder == null && myTrigger())
            entryShortOrder = EnterShortLimit(1, GetCurrentAsk(), "Short");
    }

    #2
    djmoura, welcome to the forums - when and how do you reset those IOrder objects then? If you run with TraceOrders enabled does it report any orders being ignored?

    Comment


      #3
      Thanks for your quick reply!
      This is an example of TradeOrder output of a candle which should have reverted my position. The strategy was on a long position before it.

      Code:
      2/8/2013 3:33:13 PM Entered internal PlaceOrder() method at 2/8/2013 3:33:13 PM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=4 LimitPrice=1512.25 StopPrice=0 SignalName='ShortEntry' FromEntrySignal=''
      2/8/2013 3:37:38 PM Entered internal PlaceOrder() method at 2/8/2013 3:37:38 PM: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=4 LimitPrice=1511.75 StopPrice=0 SignalName='ShortEntry' FromEntrySignal=''
      2/8/2013 3:59:44 PM Entered internal PlaceOrder() method at 2/8/2013 3:59:44 PM: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=4 LimitPrice=1512.75 StopPrice=0 SignalName='LongEntry' FromEntrySignal=''
      2/8/2013 3:59:44 PM Ignored PlaceOrder() method at 2/8/2013 3:59:44 PM: Action=Buy OrderType=Limit Quantity=4 LimitPrice=1512.75 StopPrice=0 SignalName='LongEntry' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
      Then it tries going long but the strategy is already on long position since no reversal was done.

      Comment


        #4
        djmoura, thanks. Looks to me the order is correctly placed, but then not filled with the bar? This would always be a consideration when attempting to reverse via non market orders.

        Comment


          #5
          Yes. I am trying to reverse via EnterLongLimit or EnterShortLimit order and hoped these to be allowed.

          Comment


            #6
            They are allowed, but you can't count on them 100% when reversing since due to their nature this could leave you unfilled. In backtesting you can try working with the liberal fill mode that we have that would be filling on touch as well, but I would not expect that to happen for your realtime orders then....

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            104 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            52 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            34 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            38 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            74 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X