Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Barry Milan, Yesterday, 10:35 PM
    6 responses
    18 views
    0 likes
    Last Post Barry Milan  
    Started by DanielSanMartin, Yesterday, 02:37 PM
    2 responses
    13 views
    0 likes
    Last Post DanielSanMartin  
    Started by DJ888, 04-16-2024, 06:09 PM
    4 responses
    13 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by terofs, Today, 04:18 PM
    0 responses
    12 views
    0 likes
    Last Post terofs
    by terofs
     
    Started by nandhumca, Today, 03:41 PM
    0 responses
    8 views
    0 likes
    Last Post nandhumca  
    Working...
    X