N Consecutive bars Rule: how to use Close price?
Author: xramx
Creation Date: 7/22/2014 7:45 AM
profile picture

xramx

#1
I was really please to recently discover the "for n consecutive bars" rules in Community.Rules. I have been experimenting with variation of strategies based on "Closed below its SMA for 5 days". (5 is a variable) I've been using excel for the tests because I could not fnd a rules way of expressing "for 5 days". (Btw, it's really slow in excel for long backtests.)

Coming across "Indicator is Below an Indicator for n Consecutive Bars" seemed to be the WLP answer I was looking for. So, in the "New Strategy From Rules" process, I added this new rule and selected SMA as indicator 2. For indicator 1 I wanted the closing price, but looking everywhere I couldn't find it. Must have clicked the half the 300+ indicators, scanned the Indicator lists in the Wiki ... no luck.

If it's there and I missed it, a pointer to it would be much appreciated. If not there, is there any other rule that might let me do the same test?

Ram

profile picture

Eugene

#2
Look for these conditions from the "Price/Volume Action":

Price increases a consecutive number of bars
Price decreases a consecutive number of bars
profile picture

xramx

#3
Those rules don't reference the SMA. I was looking for the rule ..

"Price is below its SMA for 5 consecutive bars".
profile picture

Eugene

#4
Since single-period SMA of any price = Price, then you can simply use the same rule ("Indicator is Above/Below an Indicator for n Consecutive Bars") but take SMA(1) as the first indicator.
profile picture

xramx

#5
That is pretty clever!

Thank you.
profile picture

maninjapan

#6
I am actually looking for this exact thing. However I don't see "for n consecutive bars" in any of the folders in the conditions tab. Do I need to download the Community Rules from somewhere? I had a look in my extension manager, but don't see it there....

Thanks
profile picture

Eugene

#7
Community.Rules is not an extension and we can't deliver it the familiar way. See the link for download and installation instructions. You have an authorized Wiki account to download it.
profile picture

Cone

#8
Community.Rules don't qualify as an "Extension", it's just an xml file to add to the existing Rules sets.

Click on Wealth-Lab Wiki, Login to Wiki (it's a separate login), then find "Rules" under the Addin Examples sections. Follow the instructions contained therein.
profile picture

maninjapan

#9
Great, got it guys! Thank you very much!!!
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).