Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsSinceExitExecution() and ChangeOrder()

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

    BarsSinceExitExecution() and ChangeOrder()

    Hello

    In managed order approach, I use ChangeOrder() to modify stop two tick above long entry price with several conditions.

    How can I use BarsSinceExitExecution() n bars from initial stop but not in case BE+2. Is it possible change signal name? If not, how could be done?

    Thanks

    #2
    Hello Impeesa,

    Thanks for your post.

    If I understand correctly you have an entry with an initial stop. If this trade progresses and you have certain conditions met, you change the stop to BE+2. You are asking about how to create a next entry condition using BarsSinceExitExecution() but only if it hits your initial stop?

    If I have understood correctly, the answer here would be to create a bool variable that you set when you do the change order. You can use the state bool then to allow or prevent using BarsSinceEntryExecution(). A generic example:

    if (BarsSinceEntryExecution() >= 5 && myBool == true && your other entry conditions)
    {
    // do something
    myBool = false; // reset the bool
    }


    Comment


      #3
      Hello, Paul

      You are ok. I want to create a next entry condition using BarsSinceExitExecution() but only if it hits your initial stop.

      But in generic example provided, you use BarsSinceEntryExecution().

      I can not see how use a bool for my initial purpose...

      Comment


        #4
        Hello Impeesa,

        Thanks for your reply.

        Correct, I made a mistake using BarsSinceEntryExecution and meant to write that as BarsSinceExitExecution.

        When your code executes the change order, that is where you would set a bool variable that would be used to prevent the entry that uses BarsSinceExitExecution.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        47 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        23 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
        51 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