TC2000.com• Download software • Tutorial videos • Subscription & data-feed pricing • Class schedule
TC2000Brokerage.com• New account application • Trading resources • Margin rates • Stock & option commissions
Worden Discussion Forum » Customer Training & Support » Ask a Trainer - TC2000 version 12/18 » PCF Language
Bruce does the new language allow you to create the Inerita indicator?
The Kelly Criterion?
If you can create the Kelly Id like it for 21 periods.
Id like a 22 bar version using C vs C1.
A 21 bar version using candle style O vs C of the same bar.
Thanks
An Indicator Formula for the Inertia Indicator can be created by substituting in the desired values for the (s)tandard deviation, (e)xponential moving average and (m)oving linear regression periods.
3 * FAVG(XAVG(STDDEV(H, s), e) / XAVG(STDDEV(H, s) + STDDEV(L, s), e), m) - 2 * AVG(XAVG(STDDEV(H, s), e) / XAVG(STDDEV(H, s) + STDDEV(L, s), e), m)
I do not understand the Kelly Criterion part of the question. I have heard of the Kelly Criterion but have never heard of it being used as an indicator or have any idea how such an indicator might be calculated.
Do you want to consider each individual bar as a bet, use that info to calculate odds and average returns and then return what percentage of your portfolio you should invest for a single day based on these past returns?
Kelly % = W - [(1 - W) / R]
Ive used the formula above.
In O vs C mode a stock that opens at 100 and closes at 101 would be considered a dollar "win."
In C vs C1 mode a stock where yesterdays close was 100 and todays close was 101 would be a dollar "win."
W is basically percentage of winning days.
R is basically profit factor.
I picked 21 days because it was a month.
To avoid equal, you can call an equal close a loss.
I can work with that. Maybe the following for a 22 bar C v C1.
100 * (CountTrue(C > C1, 22) / 22 - ((1 - CountTrue(C > C1, 22) / 22) / ((SUM(IIF(C > C1, C - C1, 0), 22) + IIF(CountTrue(C > C1, 22) = 0, 1, 0)) * SUM(IIF(C < C1, C1 - C, 0), 22))))
And the following for a 21 bar O vs C?
100 * (CountTrue(C > O, 21) / 21 - ((1 - CountTrue(C > O, 21) / 21) / ((SUM(IIF(C > O, C - O, 0), 21) + IIF(CountTrue(C > O, 21) = 0, 1, 0)) * SUM(IIF(C < O, O - C, 0), 21))))
I dont remember the recommended settings.
I tried S=10, E=14, M=20, for starters.
All this plots is a straight horizontal line with a value of .5.
3 * FAVG(XAVG(STDDEV(H, 10), 14) / XAVG(STDDEV(H, 10) + STDDEV(L, 10), 14), 20) - 2 * AVG(XAVG(STDDEV(H, 10), 14) / XAVG(STDDEV(H, 10) + STDDEV(L, 10), 14), 20)
That comes from me thinking I already have the new syntax memorized when I obviously don't. The STDDEV() syntax does not accept a formula argument. It only has period and bars ago parameters and always uses C as the basis of the standard deviation calculations.
Which means the generalized way to write the formula using the new syntax still needs to manually expand the standard deviation calculations to some extent.
3 * FAVG(XAVG(ABS((SUM(H ^ 2, s) - SUM(H, s) ^ 2 / s) / s) ^ .5, e) / XAVG(ABS((SUM(H ^ 2, s) - SUM(H, s) ^ 2 / s) / s) ^ .5 + ABS((SUM(L ^ 2, s) - SUM(L, s) ^ 2 / s) / s) ^ .5, e), m) - 2 * AVG(XAVG(ABS((SUM(H ^ 2, s) - SUM(H, s) ^ 2 / s) / s) ^ .5, e) / XAVG(ABS((SUM(H ^ 2, s) - SUM(H, s) ^ 2 / s) / s) ^ .5 + ABS((SUM(L ^ 2, s) - SUM(L, s) ^ 2 / s) / s) ^ .5, e), m)
So the formula is going to be longer than originally suggested.