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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        90 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        137 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        120 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        72 views
        0 likes
        Last Post PaulMohn  
        Working...
        X