[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] rotational trading, access of price data



PureBytes Links

Trading Reference Links

Joe,

There's absolutely no problem at all in doing what you are proposing 
to do. I'm not sure Dave understood what you were suggesting.  I'm 
somewhat familiar with Hurst's work, but I've never read the course 
or studied FLD's. I've only heard of them.

Dave did give you the correct answer, however. 'Ref' is the key 
function.

//------------------------------------------------------
// Use the below plotting FLD's
//------------------------------------------------------
p1=40;
Plot(Ref(C,-p1),"FLD",colorRed,styleLine);
//------------------------------------------------------

You don't have to use the colors or linetypes I showed above. The 
code I show takes the price from 40 days ago and plots it 
today. 'Projecting' it from then until now. You aren't using future 
data at all, only past data. I think this is what you wanted to do, 
correct? 

If you wanted to project the 40 day MA from 40 days back then you 
could do this:

//------------------------------------------------------
p1=40;
Plot(Ref(MA(C,p1),-p1),"FLD",colorRed,styleLine);
//------------------------------------------------------


-ace

--- In amibroker@xxxxxxxxxxxxxxx, "jplatt" <jplatt@xxxx> wrote:
> Dave,
> 
> Thanks for the feedback on "price data forward shifted".
> 
> You're right.....I am new to AB and have no coding ability 
whatever and at age 80, come Feb.19, I have no realistic hope of 
ever climbing that mountain.
> 
> I am also unable to play a piano but nevertheless I spend  a lot 
of time  enjoying the work that accomplished pianists do 
provide....even pay them for it in the form of buying 
recordings,etc......kind of analogous to buying software.
> 
> I can appreciate what you're saying about the AB problems that 
would be encountered with price shifting and the fact that AB wasn't 
designed with that in mind.
> 
> I seem to have given the impression that I'm trying to get a peek 
at future editions of the Wall Street Journal (not that I wouldn't 
like to).
> 
> Actually there is nothing esoteric about  forward shifted data or 
FLD lines
> as they're called. Almost everyone that's involved with cycle 
work, from Walter Bressert on down, is aware of the phenomenon.
> 
> I have used the bow compass routine described earlier for many 
years dating back to 1975 when I was first introduced to Hurst's 
work.
> 
> The FLD's are based on Hurst's "Nominal Cyclic Model" and there is 
one for every cycle length. Briefly the cycles, daily form, are 2.5, 
5, 10, 20, 40, and 80 days. There are weekly cycles as well but I'll 
omit those.
> 
> Let's say that I'm interested in the 80 day cycle and prices have 
been dropping for several weeks. I believe (because of other cyclic 
considerations) that an 80 day cycle low is approaching and I would 
like to have confirmation that it has occurred and further would 
like to have a good indication of the likely extent of the price 
move, based on that particular cycle.
> 
> I would set the bow compass at 40 days (one half the cycle length) 
and proceed to draw a downward sloping price projection on the right 
side of the chart.
> 
> If an upward price move occurs as expected then I would mark where 
the  upward current prices and downward sloping FLR coincide. 
According to cycle theory the intersection cross would confirm that 
an 80 day cycle low had indeed been confirmed and prices are exactly 
at the midpoint of the total eventual move or at "mid channel"..
> 
> This is a rather abbreviated description... actually I would draw 
an FLD for each cycle, which would form a cascading pattern. The 
best of all worlds is when all the different length FLD's are in 
cascade position and the upward break of each one forecasts an up 
move long enough to break the next highest FLD, etc, etc.
> 
> Admittedly when I first heard of the methodology it 
sounded "esoteric" to say the least but I have seen it work so many 
times that I've had to admit the obvious.
> 
> I've digressed quite a way from AB but when I read that you were 
able to write AB code for shifting MA's forward I couldn't help but 
wonder if price shifting could be done in like manner.
> 
> I realize that there is little to no interest in price shifting 
and the problems encountered would be considerable which is probably 
the reason I've never seen software handling the process.
> 
> thanks Dave,
> 
> ........Joe Platt
> 
> 
> 
> 
>  
> 
> 
>   ----- Original Message ----- 
>   From: Dave Merrill 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Monday, December 29, 2003 11:49 PM
>   Subject: RE: [amibroker] Shifting MA's
> 
> 
>   Joe, please excuse if I'm over-whacking the obvious here, but I 
think you said you were new to AB, so I wanted to make sure you 
understood some important basics.
> 
>   Just because you can write a formula that directly refers to 
future data doesn't mean that that's a valid thing to do. The most 
obvious example, Ref(array, offset) can take a negative offset, 
meaning the number of bars BACK to look, or a positive offset, 
meaning the number of bars IN THE FUTURE to look. While there are 
situations where it may make sense to do that (pattern analysis 
etc), obviously you can't trade signals based on future data, 
because as good as AB is, the future bars it would have to look at 
don't exist yet today, which is when you need the signal. Systems 
that peek into the future can backtest amazingly well (see the Zig 
function), but can't be traded in real life; it'd be like looking 
past the right edge of the chart. There are a bunch of ways to 
reference future data in AB, and it's mostly up to you do understand 
how your formulas work and avoid it. The Check btn in the backtester 
will try to warn you, if it can tell, but understanding is your real 
tool here.
> 
>   Directly referencing future data is fundamentally different from 
extrapolating an estimate of it, which at the root of it is what 
we're all trying to do -- guess the future by looking at the past. 
As long as you don't actually read data from future bars to generate 
today's indicators, any way you can think of to make today's 
decisions is ok. As to how you might do that, well, that's trading 
system design (;-).
> 
>   I'm probably going on and on here explaining the painfully 
obvious. The point is just that until you're really confident of 
your AFL skills and fully understand the limited situations when 
it's ok, I'd strongly suggest not referencing future data, ever. 
> 
>   Make sense?
> 
>   Dave
>     Dave..
> 
>     It's certainly interesting that you can write code for 
projecting MA's ahead of current price bars....into the future so to 
speak.
> 
>     That makes me think that you might  be able to also project 
other data into the future as well. What I have in mind specifically 
is price data and my interest arises from the fact that 
the "projection of price data" into the future and the manipulations 
that can be done with it, account in large measure for the 
development of Jim Hurst's "Cycle Analysis Program".
> 
>     Jim Hurst is regarded by many to be the father of cyclic 
analysis.
> 
>     Maybe I could use an example to more clearly show what I'm 
driving at.
> 
>     Suppose you had a printed copy of a daily chart of say the 
Nasdaq.....could be anything actually. Then you take an ordinary 
drafting room "bow compass" and adjust the points (needle point on 
one end and pencil point on the other end) to say 40 days. 
> 
>     Then with the needle point of the compass you trace over the 
current price bar centers starting with the last bar and working 
backward....simple enough and by keeping the two compass points 
horizontal as you trace over the price data with the needle point 
you also leave a "line trail" that's made by the pencil point.
> 
>     That trail is, in effect, a projection of  current daily 
prices 40 days into the future and that's what I would like to be 
able to convince the computer to do.
> 
>     It was not unusual in Hurst's program for several price 
projections, of different lengths, to be drawn and shown together in 
what he called "cascading patterns".
> 
>     He called the projections FLD LINES for "future lines of 
demarcation" and were the foundation of most of his work.
> 
>     His program was detailed in 10, elaborately done, lessons 
which could only be described as a labor of love.
> 
>     I frequently use the bow compass projection routine but it 
would be great if there were AB code available that could do the job.
> 
>     Does it sound possible?
> 
>     thanks for listening,
> 
>     ...........Joe Platt
> 
> 
>       ----- Original Message ----- 
>       From: Dave Merrill 
>       To: amibroker@xxxxxxxxxxxxxxx 
>       Sent: Monday, December 29, 2003 11:10 AM
>       Subject: RE: [amibroker] Shifting MA's
> 
> 
>       ma_shifted = Ref(ma_original, 4);
> 
>       I'm probably misunderstanding what you're trying to do, but 
that makes the average appear 4 bars before the data from which it 
was created, looking into the future. Not a tradable design.
> 
>       Dave
>         How can I shift a moving average horizontally to the 
right? I am 
>         trying to move the moving average of the close 4 bars to 
the right.
> 
>         Thanks in advance.
> 
>         Bill
> 
> 
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   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
> 
>     a.. To visit your group on the web, go to:
>     http://groups.yahoo.com/group/amibroker/
>       
>     b.. To unsubscribe from this group, send an email to:
>     amibroker-unsubscribe@xxxxxxxxxxxxxxx
>       
>     c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms 
of Service.


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/