Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

PCF Language Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
diceman
Posted : Friday, January 27, 2017 3:12:43 PM
Registered User
Joined: 1/28/2005
Posts: 6,049

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

 

 

 

 

 

 

 

Bruce_L
Posted : Monday, January 30, 2017 12:52:25 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

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?



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
diceman
Posted : Monday, January 30, 2017 2:03:27 PM
Registered User
Joined: 1/28/2005
Posts: 6,049

Kelly % = W - [(1 - W) / R]

 

  • Kelly % = Kelly percentage
  • W = Win percentage probability (total number of winning trades/total number of trades)
  • R = Win to loss ratio (total amount gained by winning trades/total amount lost by losing trades)

 

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.

 

 

Thanks

 

 

 

 

Bruce_L
Posted : Monday, January 30, 2017 2:41:02 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

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))))



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
diceman
Posted : Thursday, February 2, 2017 11:49:12 AM
Registered User
Joined: 1/28/2005
Posts: 6,049

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)

 

 

Thanks

 

Bruce_L
Posted : Thursday, February 2, 2017 12:19:05 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

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.

3 * FAVG(XAVG(ABS((SUM(H ^ 2, 10) - SUM(H, 10) ^ 2 / 10) / 10) ^ .5, 14) / XAVG(ABS((SUM(H ^ 2, 10) - SUM(H, 10) ^ 2 / 10) / 10) ^ .5 + ABS((SUM(L ^ 2, 10) - SUM(L, 10) ^ 2 / 10) / 10) ^ .5, 14), 20) - 2 * AVG(XAVG(ABS((SUM(H ^ 2, 10) - SUM(H, 10) ^ 2 / 10) / 10) ^ .5, 14) / XAVG(ABS((SUM(H ^ 2, 10) - SUM(H, 10) ^ 2 / 10) / 10) ^ .5 + ABS((SUM(L ^ 2, 10) - SUM(L, 10) ^ 2 / 10) / 10) ^ .5, 14), 20)


-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.