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 ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

ATR corrected by MA and MACD for Amibroker (AFL)

Copy & Paste Friendly
_SECTION_BEGIN("ATR corrected by MA and MACD");

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));

if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
 ToolTip=StrFormat("Open: %g\nHigh:  %g\nLow:   %g\nClose:  %g (%.1f%%)\nVolume: "+NumToStr( V, 1 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
}


period = Param("Period", 13, 1, 240, 1); 
mult = Param("Multiplier", 1.7, 1, 240, 0.1); 
   
f=ATR(period); 
  
VS[0] = Close[0]; 
trend[0] = 0; 
HighC[0]=0; 
Lowc[0]=0; 
  
for( i = period+1; i < BarCount; i++ ) 
{ 
  
vs[i] = vs[i-1]; 
trend[i] = trend[i-1]; 
highC[i] = HighC[i-1]; 
lowc[i] = lowc[i-1]; 
  
if ((trend[i]>=0) && ( C[i] <VS[i] )) 
{ 
trend[i] =-1; 
HighC[i] = C[i]; 
lowc[i] = C[i]; 
} 
  
if ((trend[i]<=0) && (C[i] >VS[i])) 
{ 
trend[i]=1; 
HighC[i] = C[i]; 
lowc[i] = C[i]; 
} 
  
if (trend[i]==-1) 
{ 
if (C[i]<lowc[i]) lowc[i] = C[i]; 
VS[i]= lowc[i]+ (mult*f[i]); 
} 
  
  
if (trend[i]==1) 
{ 
if (C[i]>HighC[i]) HighC[i] = C[i]; 
VS[i]= HighC[i]-(mult*f[i]); 
} 
  
} 
  
Cond1=(MA(MA(C,15),15) > MA(MA(C,30),30)); 
Cond2=MA(C,15) > MA(C,30);  
Cond3=Cross(Trend , 0);
Cond4=MACD() > Signal() OR (MACD()/Signal() >.7 AND MACD()/Signal() < 1);
Cond5=MA(MACD(),1) > MA(MACD(),2) ;
Cond10=Cond1 AND Cond2 AND Cond3 AND Cond4 AND Cond5;

Cond11=((MA(MA(C,15),15)/MA(MA(C,30),30)) < 1.02 AND (MA(MA(C,15),15)/MA(MA(C,30),30)) > .98); 
Cond12=(  (MA(C,15)/MA(C,30) < 1.02) AND (MA(C,15)/MA(C,30) > .98)   );
Cond13=(Trend > 0) ;
Cond14= (MACD()/Signal() >.7 AND MACD()/Signal() < 1.5);
Cond15=MA(MACD(),1) > MA(MACD(),2) ;
Cond20=Cond11 AND Cond12 AND Cond13 AND Cond14 AND Cond15;

Buy= Cond10 OR Cond20; 
Sell=Cross(0, trend); 


  
Plot(Close,"Close",colorBlack,styleCandle); 
Plot(VS, "Vol Stop",IIf(trend==1,10,11 ),styleThick); 
  
mkol = IIf( Trend==1, 10, 11); 
Plot(5, "ribbon", mkol, styleOwnScale|styleArea|styleNoLabel, 0, -5); // Weekly trend 
  
shape = Buy * shapeUpArrow + Sell * shapeDownArrow; 
PlotShapes( shape, IIf( Buy, colorBrightGreen, colorRed ), 0, IIf( Buy, Low-f, High+f)); 
_SECTION_END(); 
Back