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

EntriesPerDirection and OrderState

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

    EntriesPerDirection and OrderState

    Hello,

    I would appreciate some advice on the following: I want my strategy not to reverse positions. First it exits and sets BarsInProgress == 1 (1tick) while checking conditions for a new entry. So I want confirmation that the exit position is filled completely or partly as fast as possible to allow for a new entry or not.

    If EntriesPerDirection is always set to 1, does checking OrderState provide any advantages versus checking MarketPosition and Position.Quantity?
    Do I really need to deal with OrderState if EntriesPerDirection is always set to 1? Thanks!

    #2
    Hello roblogic,
    Thanks for your post.

    It would be highly dependant on your own custom logic whether or not checking the order state was beneficial when checking MarketPosition and Position.Quantity. It seems to me these are all different properties and would produce different results if used interchangeably like that.

    I suggest tracking the order state to see when the exit is filled. That will be the most reliable way to determine where the order is at during its life.
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your response. Do you have some samples showing some different operations with OrderState, specially those checking if the order is filled completely or partly OnEachTick?

      Comment


        #4
        rblogic,

        If you are basing logic off of order fills it would be reccomended to use OnOrderUpdate() or OnExecutionUpdate(), which have no concept of OnEachTick. I am not aware of any samples that demonstrate similar logic using OnBarUpdate().

        We have a sample in our help guide that shows how to monitor OnOrderUpdate or OnExuectionUpdate with the purpose of placing protective orders. That would be a great place to start in my opinion: https://ninjatrader.com/support/help...and_onexec.htm

        Josh G.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by itrader46, Today, 09:04 AM
        0 responses
        3 views
        0 likes
        Last Post itrader46  
        Started by timmbbo, Today, 08:59 AM
        0 responses
        1 view
        0 likes
        Last Post timmbbo
        by timmbbo
         
        Started by bmartz, 03-12-2024, 06:12 AM
        5 responses
        33 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Started by Aviram Y, Today, 05:29 AM
        4 responses
        14 views
        0 likes
        Last Post Aviram Y  
        Started by algospoke, 04-17-2024, 06:40 PM
        3 responses
        28 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X