%B closes under 0.2 for 3 consecutive bars
Author: tastley1
Creation Date: 6/13/2009 5:29 PM
profile picture

tastley1

#1
How do I code the "3 bars in a row" ?
profile picture

Eugene

#2
Hi Tom,

When making coding requests, please make sure they are unambiguous. What is %b ? What is 0.2 - a percentage, a value of type double? Bollinger Band width comes to my mind, so if it's not the case, you'll need to describe it explicitly.
CODE:
Please log in to see this code.
profile picture

tastley1

#3
Hi Eugene,
You are absolutely right, my first post was ambiguous! I was trying to combine rule based and code based input to develop the following strategy:

Enter

If the price is above the 200 day MA
and
the % Bollinger band width closes under 0.2 for three consecutive days
Buy at close

Exit

When % Bollinger band width closes above 0.8

Thanks again for your help
profile picture

Eugene

#4
CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).