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 samish18, 04-17-2024, 08:57 AM
        27 responses
        116 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by ETFVoyageur, 04-30-2024, 02:04 PM
        7 responses
        43 views
        0 likes
        Last Post eDanny
        by eDanny
         
        Started by f.saeidi, Today, 07:07 AM
        5 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Creamers, 04-27-2024, 05:32 AM
        9 responses
        60 views
        0 likes
        Last Post Creamers  
        Started by cmtjoancolmenero, 04-29-2024, 03:40 PM
        19 responses
        60 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X