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

Using candle close and price chang

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

    Using candle close and price chang

    Hi
    I'm using strategies builders and I want to know how to put candle closed and enter trade as soon as it break. For example.

    1. On candle closed 5ema cross above 10ema
    Then
    2. If this current candle break high of last candle go long asap.
    And not wait for candle closed.

    Thank you

    #2
    Hello SuperDude123,

    You can see the following sample for information about using OnEachTick calculation and then using the first tick of the bar to simulate OnBarClose.

    I know technically every price change the computer is registering that the previous bar has closed. But I have some bools and other functionality that need to be reset after the current bar officially closes. Is it possible to do that in an "On price change" strategy?


    To do what you are asking you would need to do your step 1 during the first tick of the bar. If that condition is true you can set a variable to know it became true so the step 2 condition can be checked during the bar.

    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by fitspressoburnfat, Today, 04:25 AM
    0 responses
    2 views
    0 likes
    Last Post fitspressoburnfat  
    Started by Skifree, Today, 03:41 AM
    1 response
    4 views
    0 likes
    Last Post Skifree
    by Skifree
     
    Started by usazencort, Today, 01:16 AM
    0 responses
    1 view
    0 likes
    Last Post usazencort  
    Started by kaywai, 09-01-2023, 08:44 PM
    5 responses
    603 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    6 responses
    23 views
    0 likes
    Last Post xiinteractive  
    Working...
    X