Stock Portfolio Organizer
The ultimate porfolio management solution.
Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
BrainTrend for Amibroker (AFL)
Copy & Paste Friendly
Back
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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | SetChartBkColor (16); //========================Initiation======================== bts= ParamToggle ( "BrainTrend1 signal" , "No|Yes" ,1); btst= ParamToggle ( "BrainTrend1 stop" , "No|Yes" ,0); btsl= ParamToggle ( "BrainTrend1 stop line" , "No|Yes" ,1); period= Param ( "Period" ,14,6,20,1); x1=53; x2=47; d=2.3; f=7; s=1.5; range= ATR (f); Range1 = ATR (f)/d; Range2 = ( ATR (f)*s)/4; range3= ATR (10); R = (( HHV ( H ,period) - C ) /( HHV ( H ,period) - LLV ( L ,period))) *-100; EMA1= EMA (R,Period); EMA2= EMA (EMA1,5); Difference= EMA1 - EMA2; ZeroLagEMA= EMA1 + Difference; value2= abs (ZeroLagEMA); function PercentR( periods ) { return -100 * ( HHV ( H , periods ) - C )/( HHV ( H , periods ) - LLV ( L , periods ) ); } for ( i = period+10; i < BarCount ; i++ ) { C [0]=0; Value2[0]=0; p[0]=0; Plot1[0]=0; Plot2[0]=0; Val1=0; Val2=0; temp[0]=0; Value3[0]=0; tm[0]=0; p1[i]=0; bt1[0]=0; bt2[0]=0; r[0]=0; bt1a[0]=0; bt2a[0]=0; istop[0]=Val1[0]; stop[i]=Val1[0]; bstop[0]=0; sstop[i]=0; //==================================Indicators============================ { if (value2[i] < x2 AND abs ( Close [i]- Close [i-2]) > range1[i]) p[i] = 1 ; else { if (value2[i] > x1 AND abs ( Close [i]- Close [i-2]) > Range1[i]) p[i] = 2 ; else p[i]=0; } } if ((value2[i] < x2 AND p[i] == 1) OR (value2[i] < x2 AND p[i] == 0)) { if ( abs ( Close [i]- Close [i-2]) > Range1[i]) { Plot1[i]= H [i]; Plot2[i]= L [i]; } else { Plot1[i]=Plot1[i-1]; Plot2[i]=Plot2[i-1]; } } else { if ((value2[i] > x1 AND p[i] == 2) OR (value2[i] > x1 AND p[i] == 0)) { Plot1[i]= L [i]; Plot2[i]= H [i]; } else { Plot1[i]=Plot1[i-1]; Plot2[i]=Plot2[i-1]; } } //==================KBrain Signal ==================================== { if (value2[i] < x2 AND ( abs ( Close [i]- Close [i-2]) > Range1[i])) { if (p[i] == 1 OR p[i] == 0) Value3[i]= L [i]-range3[i]; val1[i]=Value3[i]; p[i]=1; temp[i]=1; } else { temp[i]=temp[i-1]; } { if (value2[i] > x1 AND ( abs ( Close [i]- Close [i-2]) > Range1[i])) { if (p[i] == 2 OR p[i] == 0) Value3[i]= H [i]+range3[i]; val2[i]=Value3[i]; p[i]=2; temp[i]=2;; } } } { if (temp[i]==1 AND Plot1[i]>0 AND tm[i] != 1) tm[i]= 1; if (temp[i]==2 AND Plot2[i]>0 AND tm[i] != 2) tm[i]=2; } //===============================stop======================================== { if (value2[i] < x2 AND ( abs ( Close [i]- Close [i-2]) > Range1[i]) AND p[i] !=2) { value3[i]= L [i]-range3[i]; va1[i]=Value3[i]; p1[i]=2; r[i]=Va1[i]; bstop[i]=Va1[i]; bt2[i]=bt2[i-1]; } if (value2[i] > x1 AND ( abs ( Close [i]- Close [i-2]) > Range1[i]) AND p[i] !=1) { Value3[i]= H [i]+range3[i]; va2[i]=Value3[i]; p1[i]=1; r[i]=Va2[i]; sstop[i]=Value3[i]; bt1[i]=bt1[i-1]; } } if (val1[i] == 0 AND val2[i] == 0 AND p[i] == 0 ) { bstop[i]=bstop[i-1]; sstop[i]=sstop[i-1]; } if (bstop[i]<bstop[i-1] AND tm[i]==1 AND tm[i-1]==1) bstop[i]=bstop[i-1]; if (sstop[i]>sstop[i-1] AND tm[i]==2 AND tm[i-1]==2) sstop[i]=sstop[i-1]; } //=============================SYSTEM====================================== Mycolor= IIf (p==1, colorLime , IIf (p==2, colorRed , colorBlue )); PlotOHLC ( Open , High , Low , Close , "" , Mycolor, styleCandle | styleThick ); PlotShapes ( shapeUpArrow * (bts AND tm==1 AND Ref (tm,-1)==2), colorYellow , 0, bstop, 0 ); PlotShapes ( shapeDownArrow * (bts AND tm==2 AND Ref (tm,-1)==1), colorYellow , 0, sstop, 0 ); PlotShapes ( IIf (btst AND p==1, shapeSmallCircle , Null ), colorLime ,0,bstop,0); Plot ( IIf (btsl AND tm==1,bstop, Null ), "" , colorOrange ,1); PlotShapes ( IIf (btst AND p==2, shapeSmallCircle , Null ), colorCustom12 ,0,sstop,0); Plot ( IIf (btsl AND tm==2,sstop, Null ), "" , colorLightYellow ,1); Buy = Cover =(bts AND tm==1 AND Ref (tm,-1)==2); Sell = Short =(bts AND tm==2 AND Ref (tm,-1)==1); SellPrice = ValueWhen ( Sell , C ,1); BuyPrice = ValueWhen ( Buy , C ,1); Long= Flip ( Buy , Sell ); Shrt= Flip ( Sell , Buy ); _SECTION_END (); //=================TITLE================================================================================================ _SECTION_BEGIN ( "Title" ); if ( Status ( "action" ) == actionIndicator ) ( Title = EncodeColor ( colorWhite )+ "www.nifty-fut.blogspot.com" + " - " + Name () + " - " + EncodeColor ( colorRed )+ Interval (2) + EncodeColor ( colorWhite ) + " - " + Date () + " - " + "\n" + EncodeColor ( colorLime ) + "Op-" + O + " " + "Hi-" + H + " " + "Lo-" + L + " " + "Cl-" + C + " " + "Vol= " + WriteVal ( V )+ "\n" + EncodeColor ( colorYellow )+ WriteIf ( Buy , " GO LONG / Reverse Signal at " + C + " " , "" )+ WriteIf ( Sell , " EXIT LONG / Reverse Signal at " + C + " " , "" )+ "\n" + EncodeColor ( colorWhite )+ WriteIf ( Sell , "Total Profit/Loss for the Last Trade Rs." +( C - BuyPrice )+ "" , "" )+ WriteIf ( Buy , "Total Profit/Loss for the Last trade Rs." +( SellPrice - C )+ "" , "" )+ WriteIf (Long AND NOT Buy , "Trade : Long - Entry price Rs." +( BuyPrice ), "" )+ WriteIf (shrt AND NOT Sell , "Trade : Short - Entry price Rs." +( SellPrice ), "" )+ "\n" + WriteIf (Long AND NOT Buy , "Current Profit/Loss Rs." +( C - BuyPrice )+ "" , "" )+ WriteIf (shrt AND NOT Sell , "Current Profit/Loss Rs." +( SellPrice - C )+ "" , "" )); _SECTION_END (); |