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

Signal Averaging with an AB Exploration



PureBytes Links

Trading Reference Links

AmiBroker has lots of surprises :-) here is something for the advanced
guys/girls. This is something that, in the olden days (I was there!), you
could only do with super computers. Now it is soooo easy - if you have AB.

Those among us from the scientific community will remember signal averaging
as a valuable method to extract signals from a noisy background. These
techniques can be, but rarely are, successfully applied to stock prices. The
idea is to identify an event, this could a buy signal, a cap-up, a certain
price change, a RSI threshold, definable point on an indicator, etc. and
average normalized prices leading up to and following the event. This will
visually show you the average price behavior around your signal and may
indicate whether you are trading on a very short duration pattern or a
smooth (more robust) price pattern. I'll leave it up for you to figure out
how to use it to your own advantage.

The code is marvelously simple:

Filter = Buy; //Substitute whatever even you want to analyze here
AddColumn(Ref(Open,-7)/Open,"O-7",1.2);
AddColumn(Ref(Open,-6)/Open,"O-6",1.2);
AddColumn(Ref(Open,-5)/Open,"O-5",1.2);
AddColumn(Ref(Open,-4)/Open,"O-4",1.2);
AddColumn(Ref(Open,-3)/Open,"O-3",1.2);
AddColumn(Ref(Open,-2)/Open,"O-2",1.2);
AddColumn(Ref(Open,-1)/Open,"O-1",1.2);
AddColumn(Ref(Open,-0)/Open,"O-0",1.2);
AddColumn(Ref(Open,1)/Open,"O+1",1.2);
AddColumn(Ref(Open,2)/Open,"O+2",1.2);
AddColumn(Ref(Open,3)/Open,"O+3",1.2);
AddColumn(Ref(Open,4)/Open,"O+4",1.2);
AddColumn(Ref(Open,5)/Open,"O+5",1.2);
AddColumn(Ref(Open,6)/Open,"O+6",1.2);
AddColumn(Ref(Open,7)/Open,"O+7",1.2);

In the center column will be your entry price, normalized to "1". To the
left and right you calculate the before and after normalized prices - in %
if you wish.

Copy your results to Excel, calculate the column averages (sum the columns,
divide them by the number of rows), and chart this average. Attached and
example of how 147 buy signals average out for one of my systems. You'll
note that "on the average" my entry point is perfect with about an average
of 4.5% profit per trade in 7 days following entry.

Btw, the whole thing can also be done in a DLL and the results plotted
directly in AB. If one of the C++ experts on this list wants to polish up my
SigAve() please send me a private email at psytek@xxxx . My only
condition would be that I receive a copy of any improvements you make to
it - you may share it on the list if you like. I am not confident enough
about my programming skills to do that (yet) :-(

Take care have fun.
Herman

Attachment:
jpg00100.jpg

Attachment: Description: "Description: JPEG image"