• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars Since Exit

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

    Bars Since Exit

    I've researched this quite a bit on the forum, and have written this as part of a Strategy Builder group. This strategy seems to work in everything except the 'Bars Since Exit' group. I have a "IF ALL" section with several indicators, and use the group below written under an 'IF ANY' condition. Do I have to put the other items under Conditions in a separate group to make this work or is there something else I'm not understanding here? Also this group follows the other conditions if that makes any difference. Should it be first?

    BarsSinceExitExecution(0, @"LONG EXIT" , 0) = -1
    BarsSinceExitExecution(0, @"LONG EXIT" , 0) >= 10
    BarsSinceExitExecution(0, @"Trail stop" , 0) = -1
    BarsSinceExitExecution(0, @"Trail stop" , 0) >= 10

    #2
    Hello RadarRusty,

    Thanks for your post.

    If I understand correctly you have several other conditions that must be true in addition to any one of the 4 BarsSinceExit() conditions shown for some action to occur and I assume that the action is not occurring.

    As a debugging method, you might try reducing to just two BarsSinceExitExecution() one to check for -1 and the other to check for >= 10 and do not use any signal names. This then would allow the method to respond to any exit. If you then get your action side to work then you can take a closer look at the signal names used.

    If you still do not get the action side to work then you would want to take a closer look at the other conditions to see if one of them is not as expected. The best way to do this is to put each condition in its own set and for the action print an output that shows when each condition is true (alternatively, you could draw a differently colored dot on the chart on each bar where the condition is true (setting the dot at a different Y value do you can see them all) and when all the dots line up you know that the conditions for your multi-condition set would aslo be true.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      So if I understand here, I don't have to have a signal name included?? I thought that was a requirement, and I thought it had to be named exactly as the exit was named. The other conditions work because the programs enters an order when I want, but then enters again too soon after an exit. I will try without names when I get back to my trading computer.

      Thanks!

      Comment


        #4
        Hello RadarRusty,

        Thanks for your reply.

        You would only need the signal name if you wanted to work with a very specific exit. Here is a link to the helpguide section on the method: https://ninjatrader.com/support/help...texecution.htm The example shown does not use any signal names so it would apply then to any exit.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thanks Paul. I'll change this and give it a try. If I have further trouble, I'll add to this post.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by lunardiplomacy, Today, 07:57 AM
          0 responses
          1 view
          0 likes
          Last Post lunardiplomacy  
          Started by Tagliareni, Yesterday, 08:10 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by SDaCosta30, Today, 04:19 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Started by memonolog, Today, 02:39 AM
          5 responses
          22 views
          0 likes
          Last Post memonolog  
          Started by memonolog, Today, 07:07 AM
          0 responses
          5 views
          0 likes
          Last Post memonolog  
          Working...
          X