PureBytes Links
Trading Reference Links
|
Further to this I will add
that if you need to explore over a certain timeframe. The need to set
the n=3 days in the AA window makes this impossible. To get around this I set up
the time frame within the afl itself. This code is very messy as I have not
returned to it to simplify it and make it easier. But it worked after a few
attempts
/* DATE RANGESSET THE REQUIRED START AND FINISH DATES USING
DATENUM FORMAT
Input non-datenum number for first and/or Last Bar of chart (all
quotes)This does not affect the chart indicator */
FirstDate = 1<SPAN
class=085250813-11122003>021201;
LastDate = 1<SPAN
class=085250813-11122003>031201;
FirstBar = <FONT color=#0000ff
size=2>ValueWhen( <FONT color=#0000ff
size=2>DateNum()>=FirstDate <FONT
color=#ff0000 size=2>AND <FONT color=#0000ff
size=2>Ref(<FONT color=#0000ff
size=2>DateNum(),-<FONT color=#ff00ff
size=2>1)<FirstDate, <FONT color=#0000ff
size=2>BarIndex() );
LastBar = <FONT color=#0000ff
size=2>ValueWhen( <FONT color=#0000ff
size=2>DateNum()>=LastDate <FONT
color=#ff0000 size=2>AND <FONT color=#0000ff
size=2>Ref(<FONT color=#0000ff
size=2>DateNum(),-<FONT color=#ff00ff
size=2>1)<LastDate , <FONT color=#0000ff
size=2>BarIndex() );
Start = <FONT color=#0000ff
size=2>LastValue( <FONT color=#0000ff
size=2>IIf(<FONT color=#0000ff
size=2>IsFinite(FirstBar), <FONT color=#0000ff
size=2>ValueWhen( <FONT color=#0000ff
size=2>BarIndex()==FirstBar, <FONT
color=#0000ff size=2>BarIndex() ), <FONT
color=#ff00ff size=2>1) );
End = <FONT color=#0000ff
size=2>LastValue( <FONT color=#0000ff
size=2>IIf(<FONT color=#0000ff
size=2>IsEmpty(LastBar), <FONT color=#ff0000
size=2>BarCount-<FONT color=#ff00ff
size=2>1, <FONT color=#0000ff
size=2>LastValue( <FONT color=#0000ff
size=2>ValueWhen( <FONT color=#0000ff
size=2>BarIndex()==LastBar , <FONT
color=#0000ff size=2>BarIndex() ) ) )
);
I then included a statement
for checking the start and end dates, or you could use a
loop
ThisMajorTopDate = ( MajorTopTP * <FONT color=#0000ff
size=2>BarIndex() ) >= Start <FONT
color=#ff0000 size=2>AND ( MajorTopTP * <FONT
color=#0000ff size=2>BarIndex() ) <=
End;
Cheers,Graham<A
href="">http://groups.msn.com/asxsharetrading<A
href="">http://groups.msn.com/fmsaustralia
<FONT
face=Tahoma size=2>-----Original Message-----From: Graham
[mailto:gkavanagh@xxxxxxxxxxxxx] Sent: Thursday, 27 November 2003
12:01 PMTo: AB yahoo groupSubject: [amibroker] Reporting
in multiple rows
I have been trying to get a report from an
exploration of multiple results for multiple price ranges. Getting the report
was enough, but with 7 variable results and up to 10 price ranges the number
of columns became rediculous and frustratingly cumbersome to view. I came up
with a solution I will share, and maybe someone can help with something more
elegant than my rudimentory methods. I have not included the code in full as
it is about 600 lines, just the exploration report coding, so you could
put any variables in there. My report is just a single value at the end of
the exploration, so I have used the last n days to display the report. for
mine I set the AA window range as n=7 last quotations.<FONT
color=#008000>
Cheers,Graham<A
href="">http://groups.msn.com/ASXShareTrading<A
href="">http://groups.msn.com/FMSAustralia
bar = BarCount - 1 -
BarIndex();
x[BarCount-7] = LastValue(
AvMajorRisingMovePercentAll );y[BarCount-7] = LastValue(
AvMajorFallingMovePercentAll );x[BarCount-6] = LastValue(
AvMediumRisingMovePercentAll );y[BarCount-6] = LastValue(
AvMediumRisingPullBackPercentAll );x[BarCount-5] = LastValue(
AvMediumFallingMovePercentAll );y[BarCount-5] = LastValue(
AvMediumFallingPullbackPercentAll );x[BarCount-4] = LastValue(
AvMinorRRMovePercentAll );y[BarCount-4] = LastValue(
AvMinorRRPullbackPercentAll );x[BarCount-3] = LastValue(
AvMinorRFMovePercentAll );y[BarCount-3] = LastValue(
AvMinorRFPullbackPercentAll );x[BarCount-2] = LastValue(
AvMinorFRMovePercentAll );y[BarCount-2] = LastValue(
AvMinorFRPullbackPercentAll );x[BarCount-1] = LastValue(
AvMinorFFMovePercentAll );y[BarCount-1] = LastValue(
AvMinorFFPullbackPercentAll );
<FONT face=Arial
color=#000000 size=3>
A1 = ValueWhen(bar,BarCount-1);A2 =
ValueWhen(bar,BarCount-2);A3 = ValueWhen(bar,BarCount-3);A4 =
ValueWhen(bar,BarCount-4);A5 = ValueWhen(bar,BarCount-5);A6 =
ValueWhen(bar,BarCount-6);A7 = ValueWhen(bar,BarCount-7);
//Bars = bars used in the exploration//R=Rising /
F=Falling//First R/F = Major, second R/F = Medium//M = Move is in
direction of the next higher trend//P = Pullback against the next higher
trend//Move is on direction of the trend//Description is 6=Major /
5=MediumRR / 4=MediumFF / 3=MinorRR / 2=MinorRF / 1=MinorFR / 0=MinorFF
Filter = BarIndex()==A1 OR BarIndex()==A2 OR BarIndex()==A3 OR
BarIndex()==A4 OR BarIndex()==A5 OR BarIndex()==A6 OR
BarIndex()==A7;AddColumn(bar,"Descrpn",1);AddColumn(x,"M("+Price[LowLevel]+"-"+Price[HighLevel]+")",1.1);AddColumn(y,"P("+Price[LowLevel]+"-"+Price[HighLevel]+")",1.1);
z1=0;z2=0;//Values for Each Price Range between Dates
Selectedfor( n=LowLevel; n<=HighLevel-1; n++ ){
//this is the loop coding area
z1[BarCount-7] =
LastValue(AvMajorRisingMovePercent);z2[BarCount-7] =
LastValue(AvMajorFallingMovePercent);z1[BarCount-6] =
LastValue(AvMediumRisingMovePercent);z2[BarCount-6] =
LastValue(AvMediumRisingPullbackPercent);z1[BarCount-5] =
LastValue(AvMediumFallingMovePercent);z2[BarCount-5] =
LastValue(AvMediumFallingPullbackPercent);z1[BarCount-4] =
LastValue(AvMinorRRMovePercent);z2[BarCount-4] =
LastValue(AvMinorRRPullbackPercent);z1[BarCount-3] =
LastValue(AvMinorRFMovePercent);z2[BarCount-3] =
LastValue(AvMinorRFPullbackPercent);z1[BarCount-2] =
LastValue(AvMinorFRMovePercent);z2[BarCount-2] =
LastValue(AvMinorFRPullbackPercent);z1[BarCount-1] =
LastValue(AvMinorFFMovePercent);z2[BarCount-1] =
LastValue(AvMinorFFPullbackPercent);
AddColumn( z1, "M("+Price[n]+"-"+Price[n+1]+")",
1.1 );AddColumn( z2, "P("+Price[n]+"-"+Price[n+1]+")", 1.1 );
}Send
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to
suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Yahoo! Groups Sponsor
ADVERTISEMENT
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
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
|