Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars Since Exit - Wizard

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

    Bars Since Exit - Wizard

    I am building a strategy in the strategy wizard and it seem to work great. That is until I use “bars since exit”. I am trying to not enter another trade until at least 10 bars have closed. I am testing for a single day and the strategy recognizes 19 trades. However, two trades are entered immediately upon the close of a previous trade. I am trying to eliminate those two trades. When I use the “bars since exit”, the strategy finds 0 trades.

    Note: I am using a “user defined variable” as “exitbars” so that I can change this in the optimizer. So, my command says left side “bars since exit” middle “>” and right side “exitbars”. Under user defined inputs “exitbars” = 10.

    This is frustrating. I feel that the strategy is working perfectly except this minor (major) issue. Any help would be greatly appreciated. Thanks!

    #2
    Hello tdrogersnt,

    Thank you for your note.

    The first trade for the strategy would need to occur before BarsSinceExit() would properly work in this case. If all entries must have a set number of bars after and exit, then no trades are placed as there is no first trade. So we need to ensure that first trade is placed. You can use a bool for this, such as the following:
    Code:
    private bool firsttrade = true;
    ...
    if(firsttrade)
    {
    // Place first trade
    firsttrade = false;
    }
    Now the first trade will be placed and you can use BarsSinceExit() for the remaining entries. Please let me know if you have any questions.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    646 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    367 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X