Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

LongLimitOrder always return null,never filled

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

    LongLimitOrder always return null,never filled

    OnBarUpdate()
    Code:
      order=EnterLongLimit(50, GetCurrentAsk()+500);    
        if(order != null){
                        Print("OrderStateAfterSending"+order.OrderState.ToString());
                            }
    else{Print("OrderStateAfterSending1=null");
                            }
    Please can y give me sample of strategy or tell what is wrong with EnterLiongLimit? Which price parametr i should have to fill order.

    EnterLong work fine.

    #2
    trd55, which market / instrument are you running this snippet on? Is this for realtime or historical backtesting? When do you reset your IOrder objects?

    I would also suggest running through with TraceOrders enabled to get more debug info shown in your output window about the exact order sequence seen :



    One further thing to keep in mind is per default non market orders would only last one bar before they expire (you would either need to resbumit them or use the liveUntilCancelled bool set to true of the advanced overload offered)

    Comment


      #3
      Hi thanks for fast reply it is simulated data feed
      Trace=true and i have this output
      14.05.2013 15:48:21 Entered internal PlaceOrder() method at 14.05.2013 15:48:21: BarsInProgress=0 Action=Buy OrderType=Limit Quantity=1 LimitPrice=1169,75 StopPrice=0 SignalName='LongLimit1' FromEntrySignal=''
      14.05.2013 15:48:21 Ignored PlaceOrder() method at 14.05.2013 15:48:21: Action=Buy OrderType=Limit Quantity=1 LimitPrice=1169,75 StopPrice=0 SignalName='LongLimit1' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
      So problem is
      Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties

      Comment


        #4
        trd55, likely the script is already long coming from the historical portion, that's why the subsequent call is ignored according to your EntryHandling settings.



        To avoid evaluating on historical data, just preface the OnBarUpdate() with

        if (Historical) return;

        Comment


          #5
          is it possible to use longlimitorder on simulateddata feed?

          Comment


            #6
            Yes, you should be able to use any order type. The one you spec'd should be markable though, meaning it would fill instantly, as you specify a price higher than the ask for a limit buy (so current price is the best price in this case).

            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