Using “Bars Since Order Closed”

2 replies


Subscriber, bbp_participant, community, 21 replies.

Visit profile

6 years ago #113584

I’m wanting to use this strategy control so a new order will not be opened right away after the close of a prior order. I would like to specify a number of bars to wait before opening another order if the trade parameters are still valid but, I’m running into an issue during testing. I have the trade parameters of “Order Position(Magic Number) is Flat” and “Bars since order closed (Magic Number) >= 4” along with my other trade rules.  When I run the backtest it never opens an order. When I remove the “Bars since order closed” parameter the EA works, however, it opens an order right after the initial one closes since sometimes the trading rules are still valid after the close.  I’m using a trailing stop that trails the high/low of the prior bar after 10 pips of profit.  I’m thinking that the “bar count” doesn’t go into effect until that first initial order, but I can never get to that point since it’s never opening a order when both parameters are used. How can I set this up to get the EA to wait the specified number of bars before attempting to open a new order?  Thank you in advance for your help and/or comments. 



Subscriber, bbp_participant, community, 11 replies.

Visit profile

6 years ago #130596

I’m having the same issue. Finding on one of my EAs that following a loosing trade it opens a consecutive or more losing trades on the next bar. Like you I had tried “If BarsSinceOrderclosed(1000) > 2 Then Assign variable ……”

hoping someone has the answer.



Subscriber, bbp_participant, community, 14 replies.

Visit profile

6 years ago #130734

Having the same issue with BarsSinceOrderOpened. it wont open any orders


Viewing 3 posts - 1 through 3 (of 3 total)