Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chack for order filling in OnBarUpdate()

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

    Chack for order filling in OnBarUpdate()

    Hello. In OnExecution() we can ckeck and filter using conditions like these:
    protected override void OnExecution(IExecution execution)
    Code:
    {
    			if (entryOrder != null && entryOrder == [B]execution.Order[/B])
    			{
    				if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled || (execution.Order.OrderState == OrderState.Cancelled && execution.Order.Filled > 0))
    				{....
    Is there some opportunities to check and filter in OnBarUpdate and don't use OnExecution()?
    I mean this for daily bars.

    #2
    Hello alexstox,

    Thanks for your post.

    What are you trying to filter in OnBarUpdate()?

    With on execution this will have an execution object which is an order that is being processed that you can compare the IOrder handle to. OnBarUpdate does not have this as its processing your code when the bar closes.

    Are you trying to find an order? If so, use the IOrder handle such as entryOrder.

    Are you trying to find a particular bar? If so, use the bars ago value.
    For example to find the close price from 5 bars ago use Close[5].
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    157 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    91 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    143 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    131 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    107 views
    0 likes
    Last Post CarlTrading  
    Working...
    X