Welcome Features News Download Registration Support FAQ Wish list Links
Advanced stock charting and analysis program

AFL Library

This is read-only version of AFL library entry. Ability to add user formulas and comment is only available from members-only area.

Details:

Formula name: The Three Day Reversal
Author/Uploader: Prashanth - prash454 [at] Rediffmail.com
Date/Time added: 2005-08-30 23:42:41
Origin:
Keywords:
Level: basic
Flags: system

DISCLAIMER: Most formulas present in AFL on-line library are submitted by the users and are provided here on an "as is" and "as available" basis. AmiBroker.com makes no representations or warranties of any kind to the contents or the operation of material presented here. We do not maintain nor provide technical support for 3rd party formulas.
Description:

The three day reversal is a very simple pattern. When the trend is Up or Long – The Three Day Drop and When the trend is Down or Short – The 3 Day Rise.

Formula:

// 3 Day Reversal by Prashanth

// Knowing the Current Trend

P1 = Param("Period",10,0,100,1);

MyPDI= PDI(P1);//Positive Directional Indicator
MyMDI= MDI(P1);//Negative Directional Indicator (Minus)

// Trend Conditions
Cond1 = MyPDI > MyMDI;
Cond2 = MyPDI < MyMDI;

//Sell Conditions

Cond3 = Ref(C,-1) > Ref(C,-2) AND Ref(C,-2) > Ref(C, -3) AND Ref(C, -3) >
Ref(C, -4);
Cond4 = C < Ref(C,-1) AND C < Ref(O, -1);
A = H - C;
B = ( ( 100 * A ) / C );
D = (100 * 0.50 ) / H;
E = (100 * 0.50 ) / L;

Cond5 = O > (H - D); // AND B < 0.50; 
Cond6 = C <= (L + E);

Short = Cond1 AND Cond3 AND Cond4 AND Cond5 AND Cond6;
Cover = C > ShortPrice;


// Buy Conditions

Cond7 = C > Ref(C,-1);
Cond8 = O <= (L + E);
Cond9 = C >= (H - D);

Buy = Cond2 AND Cond7 AND Cond8 AND Cond9;
Sell = C < BuyPrice;
// ApplyStop(stopTypeLoss, stopModePercent, 3, 1);



Buy = ExRem(Buy, BarsSince(Buy) > 5);
Sell = ExRem(Sell, BarsSince(Sell) > 5);

Comments:

WT
mwtaqi [at] gmail.com
2006-05-26 10:49:58
Its not showing any thing instead a blank white back ground.
AbdulAziz Al Ghrair
alghrair [at] gmail.com
2006-08-11 08:50:07
It gives the result under backtesting only


About | Privacy | Terms of Use | Contact information
Copyright © 2001 AMIBROKER.COM