Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 12/3/2004 Posts: 30
|
I tried to use the PCF Julia demonstrated yesterday "Candle Body as % of Range."
When I scanned with this formula, if the result is 100% it should show a candle with no tail.
If the result is "0" it should be a doji.
In my results neither of these shows as it should.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I seem to be getting the correct results on my computer when using the formula given in the Writing Personal Criteria Formulas PDF from the 10/30/2012 - Writing Personal Criteria Formulas (PCFs) webinar.
Candle Body as % of Range
ABS(C-O)/(H-L)*100
The only issue I can see with the formula is the possibility of a division by zero error. We could correct that by adding a small value to the denominator (which would result in a value of 0 if the high and low were the same):
ABS(C - O) / (H - L + .0000001) * 100
Can you provide some specific examples where the formula is not returning the correct results?
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/3/2004 Posts: 30
|
BHI showed 100% Yet the candle is a doji.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
BHI is currently showing 97.42 for me on a Daily chart. The newest Daily bar definitely isn't a doji. Are you sure the Time Frame of the chart and your Indicator Formula are the same and that you are scrolled all the way to the right on the chart so you are viewing the most recent available bar for BHI?
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/3/2004 Posts: 30
|
Mine right now is 94.6 and the candle has a body with long wicks on both ends.
|
|
Registered User Joined: 12/3/2004 Posts: 30
|
My apology. Stupid me. I've been plotting Heiken-Ashi candles...not regular candles.
Very sorry to waste your time
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
It is an easy mistake to make. I'm sorry I did not think of that as a possible reason for the discrepency.
The Personal Criteria Formula Language always applies to the actual prices instead of the values of the Heiken-Ashi candles with one exception. If you create a Custom PCF Channel Indicator, it will use the Heiken-Ashi open, high, low and close instead of the actual open, high, low and close because the PCF Channel Indicator is a child indicator of the Price History Indicator.
All of the other Custom PCF Indicators are parent indicators. This is also true of Indicator Formulas and Condition Formulas which are not plotted on the chart.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 10/16/2005 Posts: 27
|
Hi Bruce,
Please help me write a PCF for these 2 situations:
A close between an 8 day Exponentional moving average and a Simple 20 day moving average, using candlestics.
Secondly, a price penetration of a resistance line such as the Upper Bollinger Band but closing below it.
Many thanks for your help
|
|
Registered User Joined: 10/16/2005 Posts: 27
|
One note of clarification on the first request of my previous positing, the closing price would be above the 8 EMA and below the 20 SMA.
Sorry for the oversite
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Checking for the close being between two moving averages can be done a variety of ways. If you want a specific order, you can specify this. For example, EMA8 below price and price below SMA20:
XAVGC8 < C AND C < AVGC20
You could reverse this order rather easily.
AVGC20 < C AND C < XAVGC8
One way to check for either direction would be to OR these two formulas together with parentheses around each section to force the desired order of operations.
(XAVGC8 < C AND C < AVGC20) OR (AVGC20 < C AND C < XAVGC8)
You can use a similar structure to the first two formulas to check for the top simple Bollinger Band 20, 2.00 being between the close and high.
C < BBTOP(2, 20) AND BBTOP(2, 20) < H
There would be no need to reverse this version or to check for another order because the close is always going to be less than or equal to the high.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |