Professional Documents
Culture Documents
com
// eCorrelationTable.afl
WLNum = Param("WatchlistNr",0,0,255,1);
CorrPd = 21;
list = GetCategorySymbols( categoryWatchlist, WLNum);
SetOption("NoDefaultColumns",True);
Filter = DateNum()==Status("rangetodate");
//SetSortColumns( 2 );
AddTextColumn(Name(),"Corr("+NumToStr(Corrpd,1.0)+")",1.0,width=70);
Ticker1= Name();
timeFrameSet( inDaily );
plus200dma = thdma+(thdma*percent);
Minus200dma = thdma-(thdma*percent);
plus100dma = ohdma+(ohdma*percent);
Minus100dma = ohdma-(ohdma*percent);
plus50dma = fhdma+(fhdma*percent);
Minus50dma = fhdma-(fhdma*percent);
plus34dma = tfdma+(tfdma*percent);
Minus34dma = tfdma-(tfdma*percent);
plus21dma = todma+(todma*percent);
Minus21dma = todma-(todma*percent);
MASTATUS =
WriteIf(above21dma OR below21dma,"Around 21MA",
WriteIf(above34dma OR below34dma,"Around 34MA",
WriteIf(above50dma OR below50dma,"Around 50MA",
WriteIf(above100dma OR below100dma,"Around 100MA",
WriteIf(above200dma OR below200dma,"Around 200MA",
WriteIf(V13dmat21dma,"Below 21MA",
WriteIf(V21dmat34dma,"B/n 21MA-34MA",
WriteIf(V34dmat50dma,"B/n 34MA-50MA",
WriteIf(V50dmat100dma,"B/n 50MA-100MA",
WriteIf(V100dmat200dma,"B/n 100MA-200MA",
WriteIf(Vgreat200dma,"Above 200MA",
WriteIf(Vbelow13dma,"Below 13MA"," "))))))))))));
Filter = 1;
AddColumn(C,"Close",1.1,IIf(C>Ref(C,-1),colorGreen,colorRed));
/////////////////////////////////////////////////////////
//
//
// Ali shafiei
//
// Ver: 1.00.beta
//
//
//
//
//
//
//
// http://jurikres.com/catalog/ms_dmx.htm //
//
//
// by Manish.
//
//
//
//
//
/////////////////////////////////////////////////////////
/////////////////
// AFL START //
/////////////////
//////////////////////
// Main Variables //
//////////////////////
i = 0;
// Display Colors
// Main Color
Color_buy = colorLime ;
Color_bull = colorGreen ;
Color_bull1 = colorDarkYellow ;
Color_bear1 = colorLightOrange ;
Color_bear = colorOrange ;
Color_sell = colorRed ;
Color_prev = colorGold ;
Color_acc = colorPaleTurquoise ;
Color_null = colorLightGrey ;
// Background Colors
BColor_vpa = colorBlack ;
BColor_mas = colorDefault ;
BColor_mam = colorDefault ;
BColor_mal = colorDefault ;
// Alternate Colors
Color_acc1 = colorBlueGrey ;
// 52 High Low
High52 = HHV(High,250);
Low52 = LLV(Low,250);
// T3 Function
function T3(price,periods)
s = 0.84;
e1=EMA(price,periods);
e2=EMA(e1,Periods);
e3=EMA(e2,Periods);
e4=EMA(e3,Periods);
e5=EMA(e4,Periods);
e6=EMA(e5,Periods);
c1=-s*s*s;
c2=3*s*s+3*s*s*s;
c3=-6*s*s-3*s-3*s*s*s;
c4=1+3*s+s*s*s+3*s*s;
Ti3=c1*e6+c2*e5+c3*e4+c4*e3;
return ti3;
////////////////////////////////////////////////
////////////////////////////////////////////////
// PARAMETERS
// VARIABLES
IIf(TtD_Param == "Year to
Date",FDayYear,0))));
IDX_Close = Foreign(IDX_Param,"Close");
// FORMULA
// P/L % Change
(Sum(ROC(C,1),TtD_Period) *
Sum(ROC( IDX_Close,1),TtD_Period))) /
((TtD_Period * Sum((ROC(IDX_Close,1)^2
),TtD_Period)) -
_SECTION_END();
///////////////////////////
///////////////////////////
// FORMULA
SetChartOptions(0,chartShowArrows|chartShowDates);
wbf=Param("WRB factor",1.5,1.3,2.5,.1);
nbf=Param("NRB factor",0.7,0.3,0.9,0.1);
TL=LinRegSlope(MA(C, DTL),2);
Vrg=MA(V,Vlp);
St = StDev(Vrg,Vlp);
rg=(H-L);
arg=Wilders(rg,30);
wrb=rg>(wbf*arg);
nrb=rg<(nbf*arg);
upbar=C>Ref(C,-1);
dnbar=C<Ref(C,-1);
Cloc=C-L;
x=rg/Cloc;
x1=IIf(Cloc==0,arg,x);
Vb=V>Vrg OR V>Ref(V,-1);
ucls=x1<2;
dcls=x1>2;
Vlcls=x1>4;
Vhcls=x1<1.35;
j=MA(C,5);
TLL=LinRegSlope(j,40) ;
Tlm=LinRegSlope(j,15) ;
tls=LinRegSlope(j,5);
mp=(H+L)/2;
// VOLUME VARIABLES
// TrendScore Count
// Indicators
// SPREAD VARIABLES
// Indicators
// CLOSE VARIABLES
// TrendScroe Count
// Indicators
// VOLUME ZONE
// FORMULA
C1 = Ref(C, -1);
ud = C > O; dd = C <= O;
VType = IIf(ud,
IIf(dd,
// VOLUME ZONE
// VARIABLES
// TrendScore Count
// Indicators
VPAz_Status = WriteIf(rising,"Accumulation",
WriteIf(falling,"Distribution","Flat"));
VPAz_Color = IIf(rising,Color_acc,
IIf(falling,Color_prev,Color_null));
// VOLUME STATUS
// PARAMETERS
Pp1=Param("Number Of Days",30,1,200,1);
Pp2=Param("Volume Of Days",15,1,200,1);
// FORMULA
numDays = Pp1;
dwWideSpread = 1.8;
dwNarrowSpread = 0.8;
dwSpreadMiddle = 0.5;
dwHighClose = 0.7;
dwLowClose = 0.3;
volNumDays = Pp2;
dwUltraHighVol = 2;
spread = H-L;
/* Basic patterns... */
upThrustBar = downClose AND H > Ref(H,-1) AND (C == L) AND downClose AND (NOT
narrowRange);
//noDemandBar = narrowRange AND LowVolume AND upBar AND (V < Ref(V,-1)) AND (V <
Ref(V,-2));
noSupplyBar = narrowRange AND LowVolume AND downBar AND (V < Ref(V,-1)) AND (V <
Ref(V,-2));
bullishsign=moderateVol+UpThrustBar;//OR moderateVol+upBar;
// VARIABLES
// TrendScore Count
// Indicators
WriteIf(StoppingVolume,"Stopping Volume",
WriteIf(noSupplyBar,"No Supply",
WriteIf(support,"Support",
WriteIf(noDemandBar,"No Demand",
WriteIf(absorption,"Absorption",
WriteIf(upThrustBar,"Up Thrust",
WriteIf(bullishsign,"-=STRONG=-
","Neutral"))))))));
VPAst_Color = IIf(Weakness,Color_sell,
IIf(StoppingVolume,Color_bear,
IIf(noSupplyBar,Color_bear1,
IIf(support,Color_bear,
IIf(noDemandBar,Color_prev,
IIf(absorption,Color_bull1,
IIf(upThrustBar,Color_bull,
IIf(bullishsign,Color_buy,Color_null))))))));
_SECTION_END();
//////////////////////////
//////////////////////////
// PARAMETERS
// FORMULA
EMAsSell = Cross(EMA(C,EMAs2Pds),EMA(C,EMAs1Pds));
EMA_rc = C > EMA (C,EMAmPds) AND C < EMA(C,EMAlPds) AND EMA(C,EMAmPds) <
EMA(C,EMAlPds);
EMA_ac = C > EMA (C,EMAmPds) AND C > EMA(C,EMAlPds) AND EMA(C,EMAmPds) <
EMA(C,EMAlPds);
EMA_bl = C > EMA (C,EMAmPds) AND C > EMA(C,EMAlPds) AND EMA(C,EMAmPds) >
EMA(C,EMAlPds);
EMA_pr = C < EMA (C,EMAmPds) AND C > EMA(C,EMAlPds) AND EMA(C,EMAmPds) >
EMA(C,EMAlPds);
EMA_ds = C < EMA (C,EMAmPds) AND C < EMA(C,EMAlPds) AND EMA(C,EMAmPds) >
EMA(C,EMAlPds);
EMA_br = C < EMA (C,EMAmPds) AND C < EMA(C,EMAlPds) AND EMA(C,EMAmPds) <
EMA(C,EMAlPds);
// VARIABLES
// TrendScore Count
IIf(EMAsBuy,i+1,i);
IIf(EMAmBuy,i+1,i);
IIf(EMAlBuy,i+1,i);
IIf(EMA_rc,i+3,i);
IIf(EMA_ac,i+2,i);
IIf(EMA_bl,i+1,1);
WriteIf(EMAsSell, "-=SELL=-",
WriteIf(EMAsBull, "Bullish",
WriteIf(EMAsBear, "Bearish","Neutral"))));
IIf(EMAsBull, Color_bull,
IIf(EMAsBear, Color_bear,
IIf(EMAsSell, Color_sell,Color_null))));
WriteIf(EMAmSell, "-=SELL=-",
WriteIf(EMAmBull, "Bullish",
WriteIf(EMAmBear, "Bearish","Neutral"))));
IIf(EMAmBull, Color_bull,
IIf(EMAmBear, Color_bear,
IIf(EMAmSell, Color_sell,Color_null))));
WriteIf(EMAlSell, "-=SELL=-",
WriteIf(EMAlBull, "Bullish",
WriteIf(EMAlBear, "Bearish","Neutral"))));
IIf(EMAlBull, Color_bull,
IIf(EMAlBear, Color_bear,
IIf(EMAlSell, Color_sell,Color_null))));
WriteIf(EMA_ac, "Accumulation",
WriteIf(EMA_bl, "Bullish",
WriteIf(EMA_pr, "Preventive",
WriteIf(EMA_ds, "Distribution",
WriteIf(EMA_br, "Bearish","Neutral"))))));
IIf(EMA_ac, Color_acc1,
IIf(EMA_bl, Color_bull,
IIf(EMA_pr, Color_prev,
IIf(EMA_ds, Color_bear1,
IIf(EMA_br, Color_bear,Color_null))))));
_SECTION_END();
////////////////////////
////////////////////////
_SECTION_BEGIN("IBuy Signal");
// FORMULA
// VARIABLES
// TrendScore Count
IIf(I_buy,i+2,i);
IIf(I_bull,i+1,i);
// Indicators
I_Status = WriteIf(I_buy,"-=BUY=-",
WriteIf(I_bull,"Bullish",
WriteIf(I_bear,"Bearish",
WriteIf(I_sell,"-=SELL=-","Neutral"))));
I_Color = IIf(I_buy,Color_buy,
IIf(I_bull,Color_bull,
IIf(I_bear,Color_bear,
IIf(I_sell,Color_sell,Color_null))));
_SECTION_END();
/////////////////////
// Price Smoothing //
/////////////////////
// FORMULA
// VARIABLES
// TrendScore Count
IIf(T3_buy,i+1,i);
// Indicators
T3_Status = WriteIf(T3_buy,"-=BUY=-",
WriteIf(T3_sell,"-=SELL=-","Neutral"));
T3_Color = IIf(T3_buy,Color_buy,
IIf(T3_sell,Color_sell,Color_null));
_SECTION_END();
////////////////////
// Bollinger Band //
////////////////////
_SECTION_BEGIN("Bollinger Bands");
// FORMULA
// VARIABLES
// TrendScore Count
IIf(BB1,i+1,i);
// Indicators
WriteIf(BB2,"Below Bottom",
WriteIf(IsNull(MA(C,20)),"N/A","Neutral")));
BB_Color = IIf(BB1,Color_bull,
IIf(BB2,Color_bear,Color_null));
_SECTION_END();
//////////
// MACD //
//////////
_SECTION_BEGIN("MACD Signal");
// FORMULA
MACDBull = MACD(12,26)>Signal(12,26,9);
// VARIABLES
// TrendScore Count
IIf(MACDBull,i+1,i);
// Indicators
MACD_Status = WriteIf(MACDBull,"Bullish",
WriteIf(IsNull(MACD(12,26)),"N/A","Bearish"));
MACD_Color = IIf(MACDBull,Color_bull,
IIf(IsNull(MACD(12,26)),Color_null,Color_bear));
_SECTION_END();
/////////////////
// RSI of MACD //
/////////////////
// PARAMETERS
RSItPds=Param("Period",14,7,33,1);
RSItOb_Parm=Param("OverBought Level",70,-200,200,5);
RSItOs_Parm=Param("OverSold Level",30,-200,200,5);
// FORMULA
Var=MACD();
Up=IIf(Var>Ref(Var,-1),abs(Var-Ref(Var,-1)),0);
Dn=IIf(Var<Ref(Var,-1),abs(Var-Ref(Var,-1)),0);
Ut=Wilders(Up,RSItPds);
Dt=Wilders(Dn,RSItPds);
RSIt=100*(Ut/(Ut+Dt));
//RSItNu = RSIt < RSItOs_Parm AND RSIt > RSItOb_Parm AND RSIt >
Ref(RSIt,-1);
//RSItNd = RSIt < RSItOs_Parm AND RSIt > RSItOb_Parm AND RSIt <
Ref(RSIt,-1);
// VARIABLES
// TrendScore Count
IIf(RSItOs, i+1,i);
// Indicators
RSIt_Status = WriteIf(RSItOs,"OverSold",
WriteIf(RSItOb,"OverBought","In Range"));
RSIt_Color = IIf(RSItOs,Color_bull,
IIf(RSItOb,Color_sell,Color_null));
_SECTION_END();
///////////
// Aroon //
///////////
//_SECTION_BEGIN("AROON Signal");
//// PARAMETERS
// ArPeriod=Param("Period",14,7,33,1);
//// FORMULA
// LLVBarsSince=LLVBars(L,ArPeriod)+1;
// HHVBarsSince=HHVBars(H,ArPeriod)+1;
// AroonDown=100*(ArPeriod-LLVBarsSince)/(ArPeriod-1);
// AroonUp=100*(ArPeriod-HHVBarsSince)/(ArPeriod-1);
// AroonOsc=AroonUp-AroonDown;
// Aroon=AroonOsc>0;
//// VARIABLES
// IIf(Aroon,i+1,i);
// AROON_Status = WriteIf(Aroon,"Bullish",
// WriteIf(IsNull (RSI(14)),"N/A","Bearish"));
// AROON_Color = IIf(Aroon,Color_bull,
// IIf(IsNull(RSI(14) ),Color_null,Color_bear));
//_SECTION_END();
/////////
// WAD //
/////////
// PARAMETERS
// WADPds=Param("Period",20,7,33,1);
// FORMULA
// VARIABLES
// WAD_Color = IIf(wadup,Color_bull,
// IIf(wadbl,Color_bear,
// IIf(wadbr,Color_bull1,
// IIf(waddn,Color_bear1,Color_null))));
//_SECTION_END();
/////////////
// Coppock //
/////////////
_SECTION_BEGIN("Coppock Indicator");
// FORMULA
CKr1=ROC(C,14);
CKr2=ROC(C,11);
CK=EMA((CKr1+CKr2),10);
// VARIABLES
// TrendScore Count
IIf(CK_upt,i+2,i);
IIf(CK_ups,i+1,i);
// Indicators
WriteIf( CK_dwt,"DownTrend","Flat"))));
IIf( CK_ups,Color_bull,
IIf( CK_dws,Color_bear,
IIf( CK_dwt,Color_sell,Color_null))));
_SECTION_END();
////////////////
// Stochastic //
////////////////
_SECTION_BEGIN("Stochastic %D %K Signal");
// FORMULA
StochKBull = StochK(14,3)>StochD(14,3,3);
// VARIABLES
// TrendScore Count
IIf(StochKBull,i+1,i);
// Indicators
WriteIf( IsNull(StochK(14,3)),"N/A","Bearish"));
STOCH_Color = IIf(StochKBull,Color_bull,
IIf( IsNull(StochK(14,3)),Color_null,Color_bear));
_SECTION_END();
//////////
// ARSI //
//////////
_SECTION_BEGIN("ARSI Signal");
// PARAMETERS
ARSI_Pds = Param("Period",14,7,33,1);
// FORMULA
Chg = C - Ref( C, -1 );
RS = UpMove/DnMove;
ARSI = 100-(100/(1+RS));
//ARSISell = ExRem(ARSISell,ARSIBuy);
// VARIABLES
// TrendScroe Count
IIf(ARSIOs,i+1,i);
// Indicators
ARSI_Status = WriteIf(ARSIOs,"OverSold",
WriteIf(ARSIOb,"OverBought","In Range"));
//WriteIf(ARSIBuy,"-=BUY=-",
//WriteIf(ARSI>ARSIOs,"OverSold",
//WriteIf(ARSIUt,"Improving",
//WriteIf(ARSIDt,"Declining",
//WriteIf(ARSI<ARSIOb,"OverBought",
//WriteIf(ARSISell,"-=SELL=-",""))))));
ARSI_Color = IIf(ARSIOs,Color_bull,
IIf(ARSIOb,Color_sell,Color_null));
//IIf(ARSIBuy,Color_buy,
//IIf(ARSI>ARSIOs,Color_bull,
//IIf(ARSIUt,Color_bull1,
//IIf(ARSIDt,Color_bear1,
//IIf(ARSI<ARSIOb,Color_bear,
//IIf(ARSISell,Color_sell,Color_null))))));
_SECTION_END();
/////////
// RSI //
/////////
//_SECTION_BEGIN("RSI Signal");
// PARAMETERS
// RSIPds=Param("Period",14,7,33,1);
// RSIOb=Param("OverBought Level",70,-200,200,5);
// RSIOs=Param("OverSold Level",30,-200,200,5);
// FORMULA
// VARIABLES
// IIf(R1,i+1,i);
// RSI_Status = WriteIf(R1,"Improving",
// WriteIf(R2,"Declining",
// WriteIf(IsNull(RSI(14)),"N/A","Neutral")));
// RSI_Color = IIf(R1,Color_bull1,
// IIf(R2,Color_bear1,Color_null));
//_SECTION_END();
/////////
// MFI //
/////////
_SECTION_BEGIN("MFI Signal");
// PARAMETERS
MFIPds=Param("Period",14,7,33,1);
MFIOb=Param("OverBought Level",80,-200,200,5);
MFIOs=Param("OverSold Level",20,-200,200,5);
// FORMULA
M1=MFI(MFIPds)>MFIOb;
M2=MFI(MFIPds)<MFIOs;
// VARIABLES
// TrendScroe Count
IIf(M2,i+1,i);
// Indicators
MFI_Status = WriteIf(M1,"OverBought",
WriteIf(M2,"OverSold",
WriteIf(IsNull(MFI(MFIPds)),"Null","Neutral")));
MFI_Color = IIf(M1,Color_sell,
IIf(M2,Color_buy,Color_null));
_SECTION_END();
/////////////////////////////////
/////////////////////////////////
_SECTION_BEGIN("ADX Signal");
// INITIALIZATION
SetBarsRequired(100000, 100000);
// JSB_InitLib();
// PARAMETERS
// FORMULA
// VARIABLES
// TrendScore Count
IIf(ADX_Buy,i+2,i);
IIf(ADX_bull,i+1,i);
// IIf(ADXst,i+1,i);
// Indicators
ADX_Status = WriteIf(ADX_Buy,"-=BUY=-",
WriteIf(ADX_bull,"Bullish",
WriteIf(ADX_bear,"Bearish",
WriteIf(ADX_Sell,"-=SELL=-","Neutral"))));
ADX_Color = IIf(ADX_Buy,Color_buy,
IIf(ADX_bull,Color_bull,
IIf(ADX_bear,Color_bear,
IIf(ADX_Sell,Color_sell,Color_null))));
//ADXc_Status = WriteIf(ADXwk,"Weak",
// WriteIf(ADXst,"Good",
// WriteIf(ADXvs,"Strong",
// WriteIf(ADXex,"EXCELENT",
// WriteIf(ADXchoppy,"Choppy","Neutral")))));
//ADXc_Color = IIf(ADXwk,Color_sell,
// IIf(ADXst,Color_bull1,
// IIf(ADXvs,Color_bull,
// IIf(ADXex,Color_buy,
// IIf(ADXchoppy,Color_prev,Color_null)))));
_SECTION_END();
///////////////////////
///////////////////////
TrendScore = IIf(V>Vp2,3,0) +
IIf(V>Vp1,2,0) +
IIf(V>VRG,1,0) +
IIf(rg>(arg*2),2,0) +
IIf(rg>arg,1,0) +
IIf(rising,1,0) +
IIf(bullishsign,3,0) +
IIf(upThrustBar,2,0) +
IIf(absorption,1,0) +
IIf(EMAsBuy,1,0) +
IIf(EMAmBuy,1,0) +
IIf(EMAlBuy,1,0) +
IIf(EMA_rc,3,0) +
IIf(EMA_ac,2,0) +
IIf(EMA_bl,1,0) +
IIf(I_buy,2,0) +
IIf(I_bull,1,0) +
IIf(T3_buy,1,0) +
IIf(BB1,1,0) +
IIf(MACDBull,1,0) +
//IIf(Aroon,1,0) +
IIf(CK_upt,2,0) +
IIf(CK_ups,1,0) +
IIf(StochKBull,1,0) +
IIf(RSItOs,1,0) +
IIf(ARSIOs,1,0) +
//IIf(R1,1,0) +
IIf(M2,1,0) +
IIf(ADX_Buy,2,0);
IIf(ADX_bull,1,0);
//IIf(ADXst,1,0);
//////////////////////
// Exploration Code //
//////////////////////
_SECTION_BEGIN("Explorer");
// PARAMETERS
// FILTER
Filter = 1;
// DISPLAY COLUMNS
AddColumn (C,"P.Close",1.2,IIf(C>Ref(C,-1),
colorGreen,colorRed));
AddColumn (V,"Volume",1,IIf(V>Ref(V,-1),
colorGreen,colorRed));
AddTextColumn (MACD_Status,"MACD",1,
colorWhite,MACD_Color);
AddTextColumn (RSIt_Status,"MACD(RSI)",1,
colorWhite,RSIt_Color);
//AddTextColumn (AROON_Status,"Aroon",1,
colorWhite,AROON_Color);
AddTextColumn (ARSI_Status,"ARSI",1,
colorWhite,ARSI_Color);
//AddTextColumn (RSI_Status,"RSI",1,
colorWhite,RSI_Color);
AddTextColumn (MFI_Status,"MFI(14)",1,
colorWhite,MFI_Color);
_SECTION_END();
//Volume Price Analysis AFL - RAJASWAMY 1.2
//Added Exploration - detailed 241209
//========================
WriteIf(utbar , "Up-thrusts are designed to catch stops and to mislead as many traders as possible.
They are normally seen after there has been weakness in the background. The market makers know that
the
market is weak, so the price is marked up to catch stops, encourage traders to go long in a weak market,
AND panic traders that are already Short into covering their very good position.","")+
WriteIf(utcond3,"This upthrust bar is at high volume.This is a sure sign of weakness. One may even
seriously
consider ending the Longs AND be ready to reverse","")+WriteIf(utbar OR utcond3," Also note that A wide
spread
down-bar that appears immediately after any up-thrust, tends to confirm the weakness (the market
makers are
locking in traders into poor positions).
With the appearance of an upthrust you should
certainly be paying attention to your trade AND your stops. On many upthrusts you will find that the
market will
'test' almost immediately.","")+WriteIf(utcond1 , "A wide spread down bar following a Upthrust Bar.
This confirms weakness. The Smart Money is locking in Traders into poor positions","");
WriteIf(utcond2 , "Also here the volume is high( Above Average).This is a sure sign of weakness. The
Smart Money is
locking in Traders into poor positions","")+WriteIf(stdn, "Strength Bar. The stock has been in a down
Trend. An upbar
with higher Volume closing near the High is a sign of strength returning. The downtrend is likely to
reverse soon. ","")+
WriteIf(stdn1,"Here the volume is very much above average. This makes this indication more stronger.
","")+
WriteIf(bycond,"The previous bar saw strength coming back. This upbar confirms strength. ","")+
WriteIf(Hutbar," A pseudo Upthrust. This normally appears after an Up Bar with above average volume.
This looks like an upthrust bar
closing down near the Low. But the Volume is normally Lower than average. this is a sign of weakness.If
the Volume is High then weakness
increases. Smart Money is trying to trap the retailers into bad position. ","")+
WriteIf(Hutcond, "A downbar after a pseudo Upthrust Confirms weakness. If the volume is above average
the weakness is increased. ","")+
WriteIf(Lvtbar2,"The previous bar was a successful Test of supply. The current bar is a upbar with higher
volume. This confirms strength","")+
WriteIf(dbar,"A wide range, high volume bar in a up trend closing down is an indication the Distribution is
in progress. The smart money
is Selling the stock to the late Comers rushing to Buy the stock NOT to be Left Out Of a Tang gia move.
","")+
WriteIf(Lvtbar2,"The previous bar was a successful Test of supply. The current bar is a upbar with higher
volume. This confirms strength","")+
WriteIf(tcbar,"The stock has been moving up on high volume. The current bar is a Downbar with high
volume. Indicates weakness and probably end of the up move","")+
WriteIf(eftup,"Effort to Rise bar. This normally found in the beginning of a Markup Phase and is Tang gia
sign.These may be found at the top of an Upmove as the Smart money makes a
last effort to move the price to the maximum","")+
WriteIf(eftdn,"Effort to Fall bar. This normally found in the beginning of a Markdown phase.","")+
WriteIf(nsbar,"No Supply. A no supply bar indicates supply has been removed and the Smart money can
markup the price. It is better to wait for confirmation","")+
WriteIf(stvol,"Stopping Volume. This will be an downbar during a Giam gia period closing towards the Top
accompanied by High volume.
A stopping Volume normally indicates that smart money is absorbing the supply which is a Indication that
they are Tang giaon the MArket.
Hence we Can expect a reversal in the down trend. ","")+
WriteIf(ndbar, "No Demand
Brief Description:
Any up bar which closes in the middle OR Low, especially if the Volume has fallen off,
is a potential sign of weakness.
if(ShowSR)
{
for(i=1; i<=SRBack; i++)
{
x0 = GetXSupport(L, SRPer, i);
x1 = BarCount-1;
y0 = GetYSupport(L, SRPer, i);
x = LineArray(x0, y0, x1, y0, 0);
Plot(x, "", IIf(LastValue(C) > x, colorGreen, colorRed), styleLine|styleDashed|styleThick);
x0 = GetXResistance(H, SRPer, i);
y0 = GetYResistance(H, SRPer, i);
x = LineArray(x0, y0, x1, y0, 0);
Plot(x, "", IIf(LastValue(C) > x, colorGreen, colorRed), styleLine|styleDashed|styleThick);
}
}
//==================================================
=======================================
//ploting the chart shapes
_SECTION_BEGIN("Indications");
PlotShapes( shapeSmallSquare*(utbar AND NOT scond) , colorRed, 0, H, 10 );
PlotShapes(shapeSmallCircle*trbar, colorBlue, 0, H, 20 );
PlotShapes(shapeSmallDownTriangle*scond, colorRed, 0, H,-20);
PlotShapes(shapeSmallSquare*stdn, colorLime, 0, L, -20 );
PlotShapes(shapeSmallSquare*stdn1, colorLime, 0, L, -20 );
PlotShapes(shapeSmallSquare*lvtbar1, colorLime, 0, L, -20 );
PlotShapes(shapeSmallUpTriangle*lvtbar2, colorYellow, 0, L, -20 );
PlotShapes(shapeHollowSmallCircle*stvol, colorLime, 0, L, -10 );
PlotShapes(shapeSmallUpTriangle*bycond, colorLime, 0, L, -20 );
PlotShapes(shapeSmallSquare*(Hutbar) , colorBlue, 0, H, 10 );
PlotShapes(shapeSmallDownTriangle*(Hutcond) , colorBlue, 0, H, -20 );
PlotShapes(shapeSmallDownTriangle*tcbar , colorYellow, 0, H, -20 );
PlotShapes(shapeSmallUpTriangle*stdn2, colorAqua, 0, L, -20 );
PlotShapes(shapeSmallSquare*(dbar) , colorBlue, 0, H, 10 );
PlotShapes(shapeSmallSquare*lvtbar, colorCustom12, 0, L, -20);
PlotShapes(shapeSmallSquare*(ndbar) , colorBlue, 0, H, 10 );
PlotShapes(shapeSmallCircle*nsbar, colorLime, 0, L, -20 );
PlotShapes(shapeSmallCircle*eftup, colorTurquoise, 0, mp, 0 );
PlotShapes(shapeSmallCircle*eftdn, colorYellow, 0, mp, 0 );
_SECTION_END();
//==================================================
==================================================
==================================================
================================
//TITLE
_SECTION_BEGIN("Title");
if( Status("action") == actionIndicator )
(
Title = EncodeColor(colorWhite)+ "Volume Price Analysis" + " - " + Name() + " - " +
EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
" - " + Date() +" - " +EncodeColor(colorLime)+ "Volume= "+WriteVal(V)+"--
"+EncodeColor(colorYellow)+"\n"+
WriteIf (utbar, " An Upthrust Bar. A sign of weakness. ","")+
WriteIf (utcond1, " A downbar after an Upthrust. Confirm weakness. ","")+
WriteIf (utcond2 AND NOT utcond1, " A High Volume downbar after an Upthrust. Confirm weakness.","")+
WriteIf (utcond3, "This upthrust at very High Voume, Confirms weakness","")+
WriteIf (stdn1, "Strength seen returning after a down trend. High volume adds to strength. ","")+
WriteIf (stdn0 AND NOT stdn, "Strength seen returning after a down trend. ","")+
WriteIf (stdn AND NOT stdn1, "Strength seen returning after a long down trend. ","")+
WriteIf (Lvtbar, "Test for supply. ","")+
WriteIf (Lvtbar2, "An Upbar closing near High after a Test confirms strength. ","")+
WriteIf (bycond, "An Upbar closing near High. Confirms return of Strength. ","")+
WriteIf (dbar, "A High Volume Up Bar closing down in a uptrend shows Distribution. ","")+
WriteIf (Hutbar, "Psuedo UpThrust. A Sign of Weakness. ","")+
WriteIf (Hutcond, "A Down Bar closing down after a Pseudo Upthrust confirms weakness. ","")+
WriteIf (Lvtbar1, "Test for supply in a uptrend. Sign of Strength. ","")+
WriteIf (stdn2, "High volume upbar closing on the high indicates strength. ","")+
WriteIf (Tcbar, "High volume Downbar after an upmove on high volume indicates weakness. ","")+
WriteIf (ndbar, "No Demand. A sign of Weakness. ","")+
WriteIf (nsbar, "No Supply. A sign of Strength. ","")+
WriteIf (eftup, "Effort to Rise. Tang gia sign ","")+
WriteIf (eftdn, "Effort to Fall. Giam gia sign ","")+
WriteIf (eftupfl, "Effort to Move up has failed. Giam gia sign ","")+
WriteIf (stvol, "Stopping volume. Normally indicates end of Giam gianess is nearing. ","")+
("\n Volume: ")+WriteIf(V>Vp2,EncodeColor(colorLime)+"Very
High",WriteIf(V>Vp1,EncodeColor(colorLime)+" High",WriteIf(V>Vrg,EncodeColor(colorLime)+"Above
Average",
WriteIf(V<Vrg AND V>Vn1,EncodeColor(colorRed)+"Less than Average",WriteIf(V<Vn1,"Low","")))))+
(EncodeColor(colorYellow)+" Spread: ")+WriteIf(rg >(arg*2),EncodeColor(colorLime)+"
Wide",WriteIf(rg>arg,EncodeColor(colorLime)+" Above Average",EncodeColor(colorRed)+" Narrow"))+
(EncodeColor(colorYellow)+" Close: ")+WriteIf(Vhcls,EncodeColor(colorLime)+"Very
High",WriteIf(ucls,EncodeColor(colorLime)+"High",WriteIf(mcls,EncodeColor(colorYellow)+"Mid",
WriteIf(dcls,EncodeColor(colorRed)+"Down","Very Low"))))+
("\n Trend: ")+WriteIf(tls>0,EncodeColor(colorLime)+" Short Term-UP",EncodeColor(colorRed)+" Short
Term-Down")+
WriteIf(tlm>0,EncodeColor(colorLime)+" MID Term-UP",EncodeColor(colorRed)+" Mid Term-Down")+
WriteIf(tll>0,EncodeColor(colorLime)+" Long Term-Up",EncodeColor(colorRed)+" Long term-Down"));
_SECTION_END();
//==================================================
==================================================
==================================================
======================================
_SECTION_BEGIN("Exploration");
Lq=V;
Lqok=Lq>100000;
Filter= (utbar OR utcond2 OR utcond3 OR stdn OR stdn0 OR stdn1 OR stdn2 OR eftup OR eftdn OR
stvol OR Hutbar OR Hutcond
OR tcbar OR Lvtbar2 OR dbar OR bycond) AND Lqok;
tcolor = IIf(stdn OR stdn1, 42,IIf(bycond , colorPaleGreen,IIf(stdn2, colorPaleGreen,
IIf(utbar OR utcond1, 33,IIf(utcond2 OR utcond3, 25,IIf(eftup, colorLime,IIf(eftdn,colorRed,IIf(hutbar,33,
IIf(hutcond,colorOrange,IIf(stdn0,42,IIf(stvol,42, IIf(utcond1,colorOrange,
IIf(dbar,33,IIf(tcbar,33,colorWhite))))))))))))));
AddTextColumn(
WriteIf (utbar, "Sign of weakness. ",
WriteIf (utcond1, "Confirmed weakness. ",
WriteIf (utcond2 AND NOT utcond1, "Confirms weakness.",
WriteIf (utcond3, "Confirms weakness",
WriteIf (stdn1, "strength returning. ",
WriteIf (stdn0 AND NOT stdn, "strength returning. ",
WriteIf (stdn AND NOT stdn1, "strength returning. ",
WriteIf (Lvtbar, "Test for supply. ",
WriteIf (Lvtbar2, "confirms strength. ",
WriteIf (bycond, "Confirms return of Strength. ",
WriteIf (dbar, "Distribution. ",
WriteIf (Hutbar, "Sign of Weakness. ",
WriteIf (Hutcond, "Confirms weakness. ",
WriteIf (Lvtbar1, "Sign of Strength. ",
WriteIf (stdn2, "Indicates strength. ",
WriteIf (Tcbar, "Indicates weakness. ",
WriteIf (ndbar, "A sign of Weakness. ",
WriteIf (stvol, "End of Giam gianees near ",
WriteIf (eftup, "Tang gia sign ",
WriteIf (eftdn, "Giam gia sign ",
WriteIf (eftupfl, "Giam gia sign ",""))))))))))))))))))))), "Signal" , 1, colorDefault, tcolor,110);
AddTextColumn(
WriteIf (utbar, " An Upthrust Bar. ",
WriteIf (utcond1, " A downbar after an Upthrust. ",
WriteIf (utcond2 AND NOT utcond1, " A High Volume downbar after an Upthrust.",
WriteIf (utcond3, "This upthrust at very High Voume.",
WriteIf (stdn1, "Strength seen returning after a down trend. ",
WriteIf (stdn0 AND NOT stdn, "Strength seen returning after a down trend. ",
WriteIf (stdn AND NOT stdn1, "Strength seen returning after a long down trend. ",
WriteIf (Lvtbar, "Test for supply. ",
WriteIf (Lvtbar2, "An Upbar closing near High. ",
WriteIf (bycond, "An Upbar closing near High.",
WriteIf (dbar, "A High Volume Up Bar closing down in a uptrend. ",
WriteIf (Hutbar, "Psuedo UpThrust. ",
WriteIf (Hutcond, "A Down Bar closing down after a Pseudo Upthrust. ",
WriteIf (Lvtbar1, "Test for supply in a uptrend. ",
WriteIf (stdn2, "High volume upbar closing on the high. ",
WriteIf (Tcbar, "High volume Downbar after an upmove on high volume. ",
WriteIf (ndbar, "No Demand. A sign of Weakness. ",
WriteIf (stvol, "Stopping volume. ",
WriteIf (eftup, "Effort to Rise. ",
WriteIf (eftdn, "Effort to Fall. ",
WriteIf (eftupfl, "Effort to Move up has failed. ",""))))))))))))))))))))), "Condition" , 1, colorDefault, tcolor,250);
_SECTION_END ();
//================================================== ===================
//background stock name (works only on Amibroker version 5.00 onwards.
//================================================== ===================
_SECTION_BEGIN("Name");
GfxSetOverlayMode(1);
GfxSelectFont("Tahoma", Status("pxheight")/6 );
GfxSetTextAlign( 6 );// center alignment
//GfxSetTextColor( ColorRGB( 200, 200, 200 ) );
GfxSetTextColor( ColorHSB( 42, 42, 42 ) );
GfxSetBkMode(0); // transparent
GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/12 );
GfxSelectFont("Tahoma", Status("pxheight")/12 );
GfxTextOut( "VPA", Status("pxwidth")/2, Status("pxheight")/3 );
GfxSelectFont("Tahoma", Status("pxheight")/36 );
GfxTextOut( "www.vpanalysis.blogspot.com", Status("pxwidth")/2, Status("pxheight")/2 );
_SECTION_END();
Score = 0;
/*AROON*/
/////////////////AROON////////////////////
Period = 14;
LLVBarsSince = LLVBars(L, Period) + 1;
HHVBarsSince = HHVBars(H, Period) + 1;
r=RSI(14) < 70 AND Ref (RSI(14),-1) > 70 AND Ref (RSI(14),-2) > 70;
r2= RSI(14) > 70 AND Ref (RSI(14),-1) < 70 AND Ref (RSI(14),-2) < 70;
r_status= WriteIf(r, "Declining", WriteIf(r2, "Improving", "Trung lap"));
r_Col=IIf(r, colorGreen, IIf(r2, colorRed, colorLightGrey));
//Bollinger Bands
bb= C > BBandTop( C, 20, 2) AND Ref (C,-1) < Ref(BBandTop( C, 20, 2),-1);
bb1= C < BBandBot( C, 20, 2) AND Ref (C,-1) > Ref(BBandBot( C, 20, 2),-1);
bb_status= WriteIf(BB, "AboveTop", WriteIf(r2, "BelowBottom", "Trung lap"));
bb_Col=IIf(r, colorGreen, IIf(r2, colorRed, colorLightGrey));
/* TOTAL SCORE */
Score = SubScore1 + SubScore2 + SubScore3 + SubScore4 + SubScore4a + SubScore6 + SubScore7 +
SubScore8 + SubScore9 + SubScore9a + SubScore10;
Score_Col=IIf(Score > 0, bkcolor = colorGreen, bkcolor = colorRed);
/* RESULTS */
Filter = MA(Volume,21) > 40000;
AddColumn( Close, "Close " );
AddColumn( Volume, "Volume " );
AddTextColumn(bb_status, "BBand", 1, colorWhite, bb_Col);
AddTextColumn(SubScore1_status, "Med MA",1, colorWhite, SubScore1_Col);
AddTextColumn(SubScore2_status, "Long MA",1, colorWhite, SubScore2_Col);
AddTextColumn(SubScore3_status, "Med MA vs. Long MA",1, colorWhite, SubScore3_Col);
AddTextColumn(SubScore6_status, "MACD ",1, colorWhite, SubScore6_Col);
AddTextColumn(Subscore7_status, "MACD/Signal ",1, colorWhite, SubScore7_Col);
AddTextColumn(SubScore8_status, "AROON",1, colorWhite, SubScore8_Col);
AddTextColumn(SubScore10_status, "Stochastic",1, colorWhite, SubScore10_Col);
AddTextColumn(r_status,"RSI-14",1, colorWhite, r_Col);
AddTextColumn(MFI_status, "MFI", 1, colorWhite, MFI_Col);
AddColumn(Score, "Score ",1.0, colorWhite, Score_Col);