Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit when candle end

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

    Exit when candle end

    Hi
    I was wondering if anyone know how to exit a play on the same candle you enter. So im using 5 minutes candle. No matter what happens, I want to exit a trade once candle end.
    thank you

    #2

    Hello SuperDude123,

    Thanks for your post.

    I understand that you would like to exit an order at the end of the current candle that the order was opened on.

    This could be accomplished by creating a condition that checks if IsFirstTickOfBar = True and calling your Exit order method, such as ExitLong().

    IsFirstTickOfBar lets us know that the current bar is closed and the current tick is the first tick of a new bar.

    See this help guide page for more information about IsFirstTickOfBar: https://ninjatrader.com/support/help...ttickofbar.htm

    Let us know if we may assist further.​
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Thank you for answering
      I will be doing this in strategies builder. For example.
      3ema crossabove 9ema enter long. (5m candle)
      then exit when this candle finish. So basically I want to exit on the same candle I enter.

      Comment


        #4
        Hello SuperDude123,

        Thanks for your note.

        You would need to create a Strategy Builder strategy that uses Calculate.OnEachTick. Then, you could use IsFirstTickOfBar as mentioned in post # 2.

        IsFirstTickOfBar could be found in the Misc folder when creating a condition in the Strategy Builder.

        See the help guide documentation below for more information about working with the Strategy Builder.
        Builder Screens: https://ninjatrader.com/support/help...er_screens.htm
        Conditions: https://ninjatrader.com/support/help...on_builder.htm
        Actions: https://ninjatrader.com/support/help...t8/actions.htm

        Let me know if I may assist further.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        577 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X