PureBytes Links
Trading Reference Links
|
First, plotting arrows is a convenient part of the AmiBroker automatic
analysis features. Once you have run the backtester, simply right click on
the data displayed and it will display trade arrows either for the actual
signal day or the trade day if different. The difference between trade and
signal day is set on the trades tab in the automatic analysis window. You
can also use the plotting features of the program to plot arrows without
using the backtester. However with what you are suggesting here, it would
be a good idea to test before using to understand the reward and risk
potential of what you suggest.
The remainder of the code you want is relatively simple, but most here will
not provide you help with code until you have read the help and tutorials
and made at least an attempt at writing the code for yourself.
But here's a start.
UpRevA = L < ref(L,-1);
UpRevB= C > ref(C,-1) or C > ref(H,-1);
Buy=UpRev1 and UpRev2;
You can combine it all into a single buy statement with an included iff as
we, but sometimes it's easier to keep the parts separate till it's running.
If you are going to use an if statement, remember that AmiBroker uses two
ii's in the iif statement.
Buy = iif(L < ref(L,-1) and (C > ref(C,-1) or C > ref(H,-1),1,0);
The help and tutorials are really very good.
Best of Luck.
Mike
_____
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of sesamys
Sent: Tuesday, October 24, 2006 7:23 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Coding help.
Gentelmen,
I need your help to transform this idea into AFL code.
Thanks in anticipation.
The idea is to plot an arrow above (or under) the bar indicating a
reversal day as per the belowmentioned:
1- Upside Reversal:
If Day n low < Day n-1 low.
AND Day n close > Day n-1 close or Day n-1 high.
2- Downside Reversal:
If Day n high > Day n-1 high.
AND Day n close < Day n-1 close or Day n-1 low.
3- Upside key reversal day.
IF Day n close < Day n-1 low.
AND Day n+1 close > Day n close and day n-1 close.
4- Downside key reversal day.
IF Day n close > Day n-1 close.
AND Day n+1 close < Day n close and day n-1 close.
Your help is highly appreciated.
Best regards.
Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.27/517 - Release Date: 11/3/2006
|