Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Modified Darvas Technique for Amibroker (AFL)
In “Something Darvas, Something New: Modifying The Darvas Technique For Today’s Markets”, Daryl Guppy presents a modified version of the Darvas trading technique, which was introduced in the 1960s. This formula implements this technique in Amibroker.
Screenshots
Similar Indicators / Formulas
Indicator / Formula
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | Periods = 100; function DarvasHigh( Periods ) { HHVtemp = HHV ( High , Periods ); result = HHVTemp; for ( i = Periods + 4; i < BarCount ; i++ ) { result[ i ] = IIf ( H [ i - 3 ] >= HHVTemp[ i - 4 ] AND H [ i - 3 ] > H [ i - 2 ] AND H [ i - 3 ] > H [ i - 1 ] AND H [ i - 3 ] > H [ i ], H [ i - 3 ], result[ i - 1 ] ); } return result; } function NewDarvasHigh( Periods ) { dh = DarvasHigh( Periods ); return dh AND Nz ( dh ) != Ref ( Nz ( dh ), -1 ); } function NewDarvasLow( Periods ) { dh = DarvasHigh( Periods ); ndl = Ref ( L , -3 ) < Ref ( L , -2 ) AND Ref ( L , -3 ) < Ref ( L , -1 ) AND Ref ( L , -3 ) < L AND Ref ( H , -2 ) < dh AND Ref ( H , -1 ) < dh AND H < dh; return Nz ( ndl ) AND Ref ( Nz ( ndl ), -1 ) < 1; } function DarvasLow( Periods ) { return ValueWhen ( NewDarvasLow( Periods ), Ref ( L , -3 ) ); } function DarvasBoxEnd( Periods ) { end = BarsSince ( NewDarvasHigh( Periods ) ) < BarsSince ( Ref ( NewDarvasLow( Periods ), -1 ) ); return Nz ( end ) AND NewDarvasLow( Periods ); } function DarvasBoxHigh( Periods ) { dbe = DarvasBoxEnd( Periods ); dbhi = ValueWhen ( Nz ( dbe ) AND NOT IsNull ( Ref ( dbe, -1 ) ), DarvasHigh( Periods ) ); return IIf ( Nz ( dbhi ) == 0, H + 1e-6, dbhi ); } function DarvasBoxLow( Periods ) { dbe = DarvasBoxEnd( Periods ); dblo = ValueWhen ( Nz ( dbe ) AND NOT IsNull ( Ref ( dbe, -1 ) ), DarvasLow( Periods ) ); return IIf ( Nz ( dblo ) == 0, L - 1e-6, dblo ); } function DarvasPossSell( Periods ) { dsl = Low < DarvasBoxLow( Periods ); return Nz ( dsl ) AND Ref ( Nz ( dsl ), -1 ) < Nz ( dsl ); } Plot ( C , "Price" , colorBlack , styleCandle ); Plot ( DarvasLow( 100 ), "DL" , colorRed ); Plot ( DarvasHigh( 100 ), "DH" , colorGreen ); |
0 comments
Leave Comment
Please login here to leave a comment.
Back