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, 05-11-2026, 05:56 AM
    0 responses
    34 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    185 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    344 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    266 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X