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

Enter trade on the open of the next bar.

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

    Enter trade on the open of the next bar.

    How would I get my strategy to enter a trade at the open of the next candle after a MA cross? I also have it checking for a close lower or higher depending on the direction of the cross.

    #2
    Hello james13501,

    Thank you for the post.

    This depends on how closely you want to submit to the open, If you are submitting orders OnBarClose, the event which opens the bar is also the event which closes the bar so the Close price can be the open price in a lot of cases. There can be some variation in price there so if you instead wanted to actually wait for the first tick of the next bar, you would need to use Calculate.OnEachTick and the IsFirstTickOfBar property. https://ninjatrader.com/support/help...ghtsub=isfirst

    As shown in the sample, you could reference the 1 bars ago value with the indicators your check at that time to know what the value was during the last closed bar. This is not something which can be done in the strategy builder and would need to be manually coded.

    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Belfortbucks, Today, 09:29 PM
    0 responses
    3 views
    0 likes
    Last Post Belfortbucks  
    Started by zstheorist, Today, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    150 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    6 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Working...
    X