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 love2code2trade, 04-17-2024, 01:45 PM
        4 responses
        36 views
        0 likes
        Last Post love2code2trade  
        Started by alifarahani, Today, 09:40 AM
        2 responses
        13 views
        0 likes
        Last Post alifarahani  
        Started by junkone, Today, 11:37 AM
        3 responses
        16 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by pickmyonlineclass, Today, 12:23 PM
        0 responses
        2 views
        0 likes
        Last Post pickmyonlineclass  
        Started by frankthearm, Yesterday, 09:08 AM
        12 responses
        44 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Working...
        X