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

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
    }


    Paul H.NinjaTrader Customer Service

    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.

        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,290 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        8 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        8 responses
        61 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Option Whisperer, Today, 09:55 AM
        0 responses
        8 views
        0 likes
        Last Post Option Whisperer  
        Started by halgo_boulder, 04-20-2024, 08:44 AM
        2 responses
        24 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X