Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

exit on close under entry bar

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

    exit on close under entry bar

    I cant find how to identify the entry bar for the position which has been triggered, i want to auto exit position if any candle after closes under the candle which position was entered on?

    I have tried price-CLOSE . . . less . . .(but no option i can see for entry, which i would need to enter signal name i presume)

    #2
    Hello, thanks for writing in. You can save the CurrentBar value before placing the entry order e.g.

    private int savedBar;

    //in OnBarUpdate:
    if(<entry condition>)
    {
    savedBar = CurrentBar;
    EnterLong();
    }

    This can also be captured more precisely in the OnExecutionUpdate() event method.

    Kind regards,

    -ChrisL

    Comment


      #3
      Thanks Chris, but is this in strategy builder? or do i have to code this...because i dont code :/

      How do i do it in strategy builder?
      Last edited by JohnyButton; 12-16-2022, 08:52 AM.

      Comment


        #4
        Hi Johny, thanks for the follow up. OnExecutionUpdate can not be used in the builder, but you can make an Int variable in the Inputs and Variables section, then set that variable in your Entry Actions list. We have several example on using the condition builder here:
        https://ninjatrader.com/support/help...gybuilder_cond ition_builder.htm

        Kind regards,

        -ChrisL
        ​​

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        46 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        33 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        50 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Working...
        X