Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Wait with new order - Bars Since Entry

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

    Wait with new order - Bars Since Entry

    Hello i tried that the strategy have to wait 5 bars after the Entry execution to take a new trade with this code:

    if((BarsSinceEntryExecution(0, "TradeEntry", 1) > 5 || BarsSinceEntryExecution(0, "TradeEntry", 1) == -1) || (BarsSinceExitExecution(0, "TradeEntry", 1) > 2 || BarsSinceExitExecution(0, "TradeEntry", 1) == -1))

    But it isnt working. Does anyone have some ideas?

    Thanks
    R

    #2
    Hello Lopat,

    That is possibly due to also including exit executions, you would need to use a print to output the values for both BarsSinceEntryExecution and BarsSinceExitExecution to know why that condition is false. BarsSinceEntryExecution is used only as a 2 part condition normally, for example this is how you would check for 5 bars:


    Code:
     if (BarsSinceEntryExecution() > 5|| BarsSinceEntryExecution() == -1)

    Comment


      #3
      Thank you for your fast response. I want to try this in a mtf strategy. So i have to you this one:

      BarsSinceExitExecution(int barsInProgressIndex, string signalName, int exitExecutionsAgo)

      But i cannot do that it is working... Do you have an example?

      Comment


        #4
        Hello Lopat,

        What did you try and was there an error or what was not working?

        The overload you are using is asking for the BarsInProgress which is the series that you submitted the orders to along with the signal name and the number of executions ago that you wanted to check. The values could change depending on your use case.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        52 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        70 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        43 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        47 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X