PureBytes Links
Trading Reference Links
|
Treliff,
I have attached 3 afls to this response and sent a copy to your yahoo
email in the hopes that you will be sure to get a copy - I think we are
on different time zones so we may only get respond once a day - I live
in Houston -6 GMT
1. I have used the log versions and the 2 bar average of kase ideas in
my afl
2. The non Log form is the Random Walk Index which is an Amibroker built
in function see RWI, RWIHI, RWILO. I was looking for the code to see
how it was coded but have not been able to find it. I think a small
modification to RWI code would be the Kase indicator. I'll bet it has
the loop you are looking for.
2. The Param approach is not my understanding to look back problem. My
understanding is that at each bar you look back 8 to 65 bars do the
calcs and then pick the max. I have implemented this without using a
loop but if things become more complicated, a loop may be required and a
cleaner code.
3. The think the look back is searching for the peaks for an uptrend and
a trough for a down trend and the oscillator takes the difference
between the two to determine which is controlling. The bigger the
difference the stronger the trend either up or down. Is that what you
are saying below? Could you elaborate on your concern. I think Kase is
looking for peak not trends.
Kase now uses a loop, within a certain range of lookbacks (15-100
in
Wayne's code I think), to find the strongest down-trend and the
strongest up-trend, and takes the max to determine THE trend.
Though
a huge improvement over fixed-lookback indicators, I still hesitate
because if the strongest downtrend is established as 2.8 while
looking back 98 bars, and the strongest uptrend as 2.7 looking back
15 bars, then this would be defined as a downtrend. Seems
questionable to me.
4. I see what you are saying about looping with a weighting system. I
am not a mathematician so I don't always know the proper statistical way
to go about approaching a problem, but here is the way I see it. There
are 2 things going on at the same time, 1) variation about the mean -
the Brownian motion or the Random Walk and then 2) there is the trend.
I think the goal is to try to separate the variation from the trend.
Statistically, mathematically, how do we do this?
5. One thing about Kases work that I have not run across is the use of
volume. It seems that we have a limited amount of information to work
with - Open, high ,low ,close and we do get volume. There is talk in
the Kase reference document(www.fini.com/kase/k0.ntm) that talks about
using ticks to create your bars during a day. I guess I have been
wondering how to use volume in this method. I use Esignal for Forex
data and they provide a volume but my understanding that it is not
really volume but something like tick count which is as close as they
could get to "volume" because there is no central place to really get
the volume in the Forex market.
6. Another issue that I have been thinking about in the Forex market is
that activity varies considerably during the 24 hr day. At times when
say the Asian and European markets are both open there is more
volatility than when just the US market is open. Should there be some
way to account for time of day. Should volatility be measure for 9
periods back as suggested by Kase or should you take the volatility at
the same time of day for say 9 days back. Statistically would that help
separate variation from trend.
7. one of the things that I noticed in the code provided by Wayne was in
the Kase DevStops- the look back period was dev1 was 30 and dev2 was 10
and dev3 was 21. I think those were picked up from the Kase manual. I
think that L1=30 is the look back length for all the devs. The L2 = 10
and L3 = 21 is to be used in 2 moving averages that tell you when to
change your plot of stops from long positions to short positions. What
do you think? Kase recommends 30 bars for intraday and 20 bars for
daily, Is there a statistical reason for this. It all gets back to
"fixed look back" periods.
Thanks for the thought provoking information.
Please look at my afls and see if there are any questionable
interpretations of Kase ideas.
Byron
-----Original Message-----
From: treliff [mailto:treliff@xxxxxxxxx]
Sent: Wednesday, March 10, 2004 12:51 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: I need some loop-... / KASE indicators
Byron, Kase's book is even less revealing than her articles when it
comes to math and codes. I purchased it after reading the
articles but don't regret that in view of the value of her ideas.
The good thing is, her smoke and mirrors force you to really dig in
and fully understand the reasoning before even attempting to write a
code.
Sometimes she sounds pretty obnoxious, like when referring to "the
out-moded MACD" (not to mention those silly moving
avg's) but
in my opinion she has a right to speak.
Re. her PeakOscillator (I did not study her Dev.Stop yet) it is
worth noting that it appears she has replaced her initial trend
measurement based on ATR, with one that uses what is called
Historical Volatility. Specifically where in previous articles (and
in the book) she uses e.g.
(C-Ref(C,-n)) / ATR*sqrt(n)
in later articles she uses
log(C/Ref(C,-n)) / StDev(log(C/Ref(C,-1),n)*sqrt(n)
(Note: in fact she uses H or L instead of C in the left side of the
equation and splits in an UP and DOWN index.)
I find the second approach much more interesting (but don't confuse
interesting with profitable:-). Wayne's code (thanks Wayne) seems to use
the ATR approach, but that could probably be easily
converted. The programming is not my strongest side but at first
glance it seems this code uses Param in order to "loop".
Instead of focusing on code though I'd like to share some thoughts on
the Kase approach. To recapitulate:
Using any bar as starting point and looking back n periods there is
this undeniable "n-period statistical trend" that is defined
as the
2nd formula above and measures how far the market has moved in
relation to its volatility: if this formula = 1 than the market
moved within exactly 1 standard deviation, which should happen about
67% of the time etc. As a math-man, I find this a very, very strong
concept, by far the best when it comes to trend measurement.
Kase now uses a loop, within a certain range of lookbacks (15-100 in
Wayne's code I think), to find the strongest down-trend and the
strongest up-trend, and takes the max to determine THE trend. Though
a huge improvement over fixed-lookback indicators, I still hesitate
because if the strongest downtrend is established as 2.8 while
looking back 98 bars, and the strongest uptrend as 2.7 looking back
15 bars, then this would be defined as a downtrend. Seems
questionable to me.
My thought therefore was to take all trends (the 15-bar trend, 16- bar
trend etc) and weigh these in a sensible manner, which implies
preferably not with fixed weights, but also in some loop-style
manner and let the market speak. The code I needed help with was the
first step in this direction.
I am interested in any further thoughts, ideas and test results,
also re. the original KASE codes as initiated by Wayne.
Rgds,
Treliff
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Attachment:
KSDI.afl
Description: Binary data
Attachment:
Kase Stops.afl
Description: Binary data
Attachment:
Description: "Description: Binary data"
Attachment:
Description: "kasecd.afl"
Attachment:
Description: "Attachment:"
|