Registered User Joined: 12/29/2013 Posts: 71
|
Hi Bruce, I have pcf for a Bullish Macd cross,
XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) > 0 AND XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) +XAVG(XAVGC26.1,9) <= 0
I wold like to add a Dot above the candle when condition is true.
Can you help?
Thanks L.C.
|
|
Registered User Joined: 5/23/2006 Posts: 75
|
QUOTE (lc29470)
Hi Bruce, I have pcf for a Bullish Macd cross,
XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) > 0 AND XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) +XAVG(XAVGC26.1,9) <= 0
I wold like to add a Dot above the candle when condition is true.
Can you help?
Thanks L.C.
abs(XAVGC12 - XAVGC26 - XAVG(XAVGC12,9) + XAVG(XAVGC26,9) > 0 AND XAVGC12.1 - XAVGC26.1 - XAVG(XAVGC12.1,9) +XAVG(XAVGC26.1,9) <= 0) * H * 1.005
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If you have TC2000 v17, I would use the following Formula in a Custom PCF Indicator plotted in the same pane and scale as price.
1.005 * H / ABS(XUP(MACD12.26, XAVG(MACD12.26, 9)))
I would use the following Formula instead in earlier versions of TC2000.
1.005 * H / ABS(XAVGC12 - XAVGC26 > XAVG(XAVGC12,9) - XAVG(XAVGC26,9) AND XAVGC12.1 - XAVGC26.1 <= XAVG(XAVGC12.1,9) - XAVG(XAVGC26.1,9))
For the most part this will work the same as the formula provided by mdhuang. The difference is that using division in the order given will produce an division by zero error when false while using multiplication will produce 0 when false.
The advantage to producing the division by zero error is that no dot plots at all. If you use multiplication there will be a line of dots at zero where false instead.
How to Overlay an Indicator
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/29/2013 Posts: 71
|
Thank you Bruce, and mdhuang.
Bruces 1st PCF worked fine.
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
QUOTE (Bruce_L)
If you have TC2000 v17, I would use the following Formula in a Custom PCF Indicator plotted in the same pane and scale as price.
1.005 * H / ABS(XUP(MACD12.26, XAVG(MACD12.26, 9)))
I would use the following Formula instead in earlier versions of TC2000.
1.005 * H / ABS(XAVGC12 - XAVGC26 > XAVG(XAVGC12,9) - XAVG(XAVGC26,9) AND XAVGC12.1 - XAVGC26.1 <= XAVG(XAVGC12.1,9) - XAVG(XAVGC26.1,9))
For the most part this will work the same as the formula provided by mdhuang. The difference is that using division in the order given will produce an division by zero error when false while using multiplication will produce 0 when false.
The advantage to producing the division by zero error is that no dot plots at all. If you use multiplication there will be a line of dots at zero where false instead.
How to Overlay an Indicator
Bruce,
I am not able to get this pcf from above to work
1.005 * H / ABS(XAVGC12 - XAVGC26 > XAVG(XAVGC12,9) - XAVG(XAVGC26,9) AND XAVGC12.1 - XAVGC26.1 <= XAVG(XAVGC12.1,9) - XAVG(XAVGC26.1,9))
It plots a value.
Thank you for any help.
Don
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Yes, it plots a value because it is an Indicator Formula and that is what it is designed to do. It plots dots on the chart when used as a Custom PCF Indicator with the Plot Style set to Dots. It plots dots at 1.005 times the high when tthe condition portion of the formula is true and nothing when the condition portion of the formula is false (because it produces a diviion by zero error in such cases).
If you only want the Condition Formula portion of the Indicator Formula, it would be the following.
XAVGC12 - XAVGC26 > XAVG(XAVGC12,9) - XAVG(XAVGC26,9) AND XAVGC12.1 - XAVGC26.1 <= XAVG(XAVGC12.1,9) - XAVG(XAVGC26.1,9)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
Bruce,
Thank you for helping me understand.
I really like the trick of plotting a dot 1.005 times the high.
Very useful.
Don
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
Bruce,
I am wondering how universally the trick above can be applied.'
Can this trick be used to convert any Boolean into a dot plotted on the chart?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I believe it is a universal solution. I can't think of any Booleans for which it wouldn't work, but could be missing something.
(value at which to plot the dot) / ABS(boolean)
It would probably be considerd preferable to use the following format in TC2000 v17, but it is actually a bit longer and doesn't work in earlier versions of TC2000.
(value at which to plot the dot) / IIF(boolean, 1, 0)
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 7/29/2010 Posts: 417
|
Bruce,
Many thanks for helping me understand this valuable trick.
Don
|
|
Registered User Joined: 10/7/2004 Posts: 2
|
Bruce
If I write a formula using new functions in 17, will that cause problems if I open 12?
Thanks DT
|
|
Registered User Joined: 10/7/2004 Posts: 2
|
Bruce
Just noticed that your date is my date. ??
DT
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Not sure what the "your date is my date" remark means.
It kind of depends what you mean by problems. If the formula has syntax which won't work in TC2000 v12, than the item using that formula isn't going to work in v12 (so a Custom PCF Indicator won't plot for example).
But even though things might not be backwards compatible, it shouldn't mess up TC2000 v12 to open something containing v17 specific features. Those features just shouldn't function.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/5/2013 Posts: 9
|
hi bruce
need help with a pcf
price opening at or very near ema.The closer the better
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The percentage that the open is away from the current EMA20 can be written as follows.
100 * (O / XAVGC20 - 1)
So checking for this being 0.1% or less could be written as follows.
100 * (O / XAVGC20 - 1) <= .1
The percentage that the open is away from the EMA20 at the time of the open can be written as follows.
100 * (O / ((2 * O + 19 * XAVGC20.1) / 21) - 1)
And checking for this being less than say 0.2% could be written as follows.
100 * (O / ((2 * O + 19 * XAVGC20.1) / 21) - 1) < .2
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 1/28/2005 Posts: 6,049
|
QUOTE (Bruce_L)
Not sure what the "your date is my date" remark means.
Your Joined date is the same.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Thanks for pointing it out (not sure why I didn't see it myself). I woould say that is quite a coincidence, but it is probably the most common joined date in the forums. It is the date the forums were first populated using all of the customers at the time. It just used the date of the import instead of checking to see when a user had actually become a customer, so anybody around that date or earlier has that date as a joined date.
There are a few earlier joined dates, but these are all for people involved in setting up and testing the forum before it went live.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/5/2013 Posts: 9
|
The percentage that the open is away from the EMA20 at the time of the open can be written as follows.
100 * (O / ((2 * O + 19 * XAVGC20.1) / 21) - 1)
And checking for this being less than say 0.2% could be written as follows.
100 * (O / ((2 * O + 19 * XAVGC20.1) / 21) - 1) < .2
hi bruce keep getting error message with formula on line 4 .couild you check this again for me
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The error was caused by a problem with the parentheses which should be fixed above.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 11/5/2013 Posts: 9
|
sorry for been a pain bruce but results not quite what i am looking for
I need price on daily charts to open almost sitting on 20ema.
in most of the results price is quite far away frim ema 20
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You can adjust the .2% at the end of the formula to something smaller. The following would check for 0.05% instead of 0.2%
100 * (O / ((2 * O + 19 * XAVGC20.1) / 21) - 1) < .05
That said, how are you determining if the symbol opened near the moving average?
Keep in mind the value of the moving average can change significantly throughout the trading day. If you are comparing the open to the current value of the moving average, you would use something like the following (for 0.05%).
100 * (O / XAVGC20 - 1) <= .05
This won't tell you if it actually opened near the moving average (because the moving average has changed), but it will tell you if it is near the moving average now (which is all you can actually check visually now).
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |