4 down days in a time range
Author: techtrader007
Creation Date: 6/4/2011 7:54 AM
profile picture

techtrader007

#1
Good morning,

any idea how do I program following condition:

The price drops 4 out of 5 days. This means closing prices were lower than the day before for 4 out of the past 5 days.

Thanks for any help.
profile picture

Eugene

#2
Hi,
Here's an illustration:

Edit: wrong CumDown code removed
CODE:
Please log in to see this code.

profile picture

Cone

#3
You really can't get there with CumDown since that indicator works based on the value of the specified series n bars ago. If you want to count the actual down closes over the past 5 periods -

CODE:
Please log in to see this code.


So, the condition would be:

CODE:
Please log in to see this code.
profile picture

Eugene

#4
I stand corrected. Thanks Robert.

Uploaded a modified version of my code (not using CumDown) together with Robert's code.
profile picture

techtrader007

#5
thank you very much.
profile picture

Eugene

#6
These conditions are now also available as easy-to-use Strategy Rules in Community.Rules:

* Price (Volume) Action > Price increases (decreases) a number of bars within period
* General Indicators > Indicator increases (decreases) a number of bars within period
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).