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

Pattern Formula ( Key Reversal Up Pattern )



PureBytes Links

Trading Reference Links

I have included 3 formulas for Amibroker, ( KEY REVERSALS )
1. Key Reversals_i ( Paste in the Indicator Builder )
2. Key Reversals Up Pattern Commentary ( Paste in the Guru Commentary)
3. Key Reversals Up Pattern Exploration and System ( Paste in Automatic
Analysis )

If someone could optimize the system signals and rules for buy and sell
and revert back with details.
that would be appreciated.

Guru Commentary

Will give # of times the pattern has occured, Total number of bars in
the test, % of time the pattern occured, # of times the pattern was
profitiable, and % of profitiability.

Automatic Analysis

There are 2 operations here,
1. hit explore and your will have a spreadsheet showing the information
as in Commentary
2. hit backtest and the system test will be run.

Indicator builder

Code highlights the Key reversals.

Thank you
Anthony







// Key reversals Pattern

MaxGraph=8;
KR= (C > Ref(C,-1) AND (L < Ref(L,-1) AND (C < H)));
barcolor=IIf(KR,4,6);
Graph0=C;
Graph0Style=128;

Graph0BarColor=ValueWhen(barcolor!= 0,barcolor);

// Key reversal Up

// Enter long
Long= L <Ref(L,-1) AND C > Ref(C,-1) AND C < H;
// Close long
Clong=H >= Ref(H,-1);

// Set Maximum loss: long only
// 2 %
Buy=Long;
Sell=Clong;
// # of patterns
pat=L < Ref(L,-1) AND C > Ref(C,-1) AND C < H;
pat1=Cum(pat);

//# of bars
bars=Cum(1);

//% Pattern
Cond1=(Cum(pat)/Cum(1))*100;

// # wins
Cond2=Cum(Ref(pat,-1) AND H >= Ref(H,-1));
// % wins
Cond3=(Cum(Ref(pat,-1) AND H >= Ref(H,-1))/Cum(pat))*100;
Filter=pat > 0;
//NumColumns=5;
//Column0Name="#Pat";
//Column0=pat1;
//Column1Name="#Bars";
//Column1=bars;
//Column2Name="%Pat";
//Column2=Cond1;
//Column3Name="#wins";
//Column3=Cond2;
//Column4Name="%wins";
Column4=Cond3;
"";
"............................KEY REVERSAL UP PATTERN............ ";
"______________________________________________";
"";
" MARKET BEING EVALUATED : " +Name();
"";
" DATE :........................................." +Date();
"";
" PATTERN OCCURED :......... " +WriteVal(PAT1,1);
"";
" TOTAL BARS IN TEST :......... " +WriteVal(BARS,1);
"";
" % PATTERN OCCURED :......... " +WriteVal(COND1,1.2)+"%";
"";
" # OF WINS :............................ " +WriteVal(COND2,1);
"";
" % OF WINS :........................... "+WriteVal(COND3,1.2)+"%";

// Key reversal Up Pattern Exploration
// coded by Anthony Faragasso
// December 2001 TASC


// Enter long
Long= L <Ref(L,-1) AND C > Ref(C,-1) AND C < H;
// Close long
Clong=H >= Ref(H,-1);

// Set Maximum loss: long only
// 2 %
Buy=Long;
Sell=Clong;
Short=Sell;
Cover=Buy;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
// # of patterns
pat=L < Ref(L,-1) AND C > Ref(C,-1) AND C < H;
pat1=Cum(pat);

//# of bars
bars=Cum(1);

//% Pattern
Cond1=(Cum(pat)/Cum(1))*100;

// # wins
Cond2=Cum(Ref(pat,-1) AND H >= Ref(H,-1));
// % wins
Cond3=(Cum(Ref(pat,-1) AND H >= Ref(H,-1))/Cum(pat))*100;
Filter=pat > 0;
NumColumns=5;
Column0Name="#Pat";
Column0=pat1;
Column1Name="#Bars";
Column1=bars;
Column2Name="%Pat";
Column2=Cond1;
Column3Name="#wins";
Column3=Cond2;
Column4Name="%wins";
Column4=Cond3;


// Key reversals Pattern
// coded by Anthony Faragasso
// December 2001 TASC

MaxGraph=8;
KR= (C > Ref(C,-1) AND (L < Ref(L,-1) AND (C < H)));
barcolor=IIf(KR,4,6);
Graph0=C;
Graph0Style=128;

Attachment: Description: "Graph0BarColor=ValueWhen(barcolor!= 0,barcolor);"

Attachment: Description: ""