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

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.​
    Brandon H.NinjaTrader Customer Service

    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.
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by zstheorist, Today, 07:52 PM
        0 responses
        3 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        149 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 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
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Working...
        X