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 Mongo, Today, 11:05 AM
    4 responses
    14 views
    0 likes
    Last Post Mongo
    by Mongo
     
    Started by traderqz, Today, 12:06 AM
    7 responses
    13 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Skifree, Today, 03:41 AM
    5 responses
    13 views
    0 likes
    Last Post Skifree
    by Skifree
     
    Started by traderqz, Yesterday, 09:06 AM
    5 responses
    34 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by guillembm, Today, 11:25 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X