Using the time filter to close - issues with data
-
Hello,
I am using a time filter to close after a certain number of bars. It works most of the time. It never appears to work on the daily chart. I think i discovered why. The reason is gaps in the data. If the data is missing a bar it throws it all off. How can i get the EA to close the trade after a certain number of bars if there are data issues?
Some of these trades go on for many many bars before they get closed when they are supposed to be closed at 5 for example. When i investigate why it appears a bar is missing. Do i need to use a different time filter? I am using the n bars one.
Any help would be appreciated!
Thanks!
-
@nscrilla once per bar formula to add 1 to variable, reset when needed by modify variable block, condition block checking if variable = number.
-
This was a good idea and i gave it a shot. It didn't appear to work for me.... If anything it works worse than it did.
-
@nscrilla This picture will show you what I mean, there are different ways and what you had done can work you just need to define when a count starts and resets.

-
You solved it for me! thanks!
-
@nscrilla Your welcome