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

Time Segmented Money Flow for Amibroker (AFL)
akerstkh
almost 11 years ago
Amibroker (AFL)

Rating:
5 / 5 (Votes 5)
Tags:
oscillator, amibroker

A Better OBV and Time Segmented Money Flow Indicator.

Full Description and Snapshot Here:
http://blessedfool.blogspot.sg/2014/02/stock-market-tools-12-better-obv-and.html

Similar Indicators / Formulas

Febo RSI ..real indicator
Submitted by abhinavsingh almost 13 years ago
Trading Volume Statistic
Submitted by tuanstock1 over 10 years ago
Ergodic Oscillator
Submitted by dljtrader almost 14 years ago
3 Days Track
Submitted by janet0211 over 14 years ago
Chande Momentum Oscillator
Submitted by klimpek almost 14 years ago

Indicator / Formula

Copy & Paste Friendly
//------------------------------------------------------------------------------
//  Formula Name  : OGTS Time Segmented Money Flow
//  Author        : KH Tang 
//  Company       : Wealth Resonance 
//  Last Update   : 15 Jan 2014
//  Date Updated  : 22 Nov 2013 // Update with opening price as direction*
//  Origin date	  : 5 Jun 2007 
//  Origin        : KH Tang 
//  Version       : 1.01
//  Level         : Volume Spread Analysis
//  Description   : Key Usages:
//                : 1.Tape Reading for Direction of Breakout in Trading Range
//                : 2.Tape Reading for Divergence in Trending
//	 	  : Note: Enhancement to include Opening price as direction.
//More notes on blog:
//http://blessedfool.blogspot.sg/2014/02/stock-market-tools-12-better-obv-and.html
//------------------------------------------------------------------------------

procedure BackgroundSetting()
{

SetChartBkGradientFill( ParamColor("BackgroundTop", colorSkyblue),
        ParamColor("BackgroudBottom", colorWhite),ParamColor("TitleBlock",colorWhite));
}


SetBarsRequired( -2, -2 );
_SECTION_BEGIN("Display Setting");
GraphXSpace = 10;
Backgroundsetting();
_SECTION_END();//Display Setting

//William C. Garrett's Approximation: 
//GPaths   = IIf(C>Ref(C,-1),((H-Ref(C,-1))+(H-L)+(C-L)),IIf(C<Ref(C,-1),(Ref(C,-1)-L)+(H-L)+(H-C),1));
//GUpShare = IIf(C>Ref(C,-1),((H-Ref(C,-1))+(C-L)),IIf(C<Ref(C,-1),(H-L),0));
//GDnShare = IIf(C>Ref(C,-1),(H-L),IIf(C<Ref(C,-1),(Ref(C,-1)-L)+(H-C),0));


//Expansion for clarity:
PathA1= Ref(C,-1)-L;
PathB1= H-L;
PathC1= H-C;
Path1 = PathA1+PathB1+PathC1;
UpShare1 = PathB1;
DnShare1 = PathA1+PathC1;

PathA2= H-Ref(C,-1);
PathB2= H-L;
PathC2= C-L;
Path2 = PathA2+PathB2+PathC2;
UpShare2 = PathA2+PathC2;
DnShare2 = PathB2;

Paths  = IIf(C<Ref(C,-1),Path1,	  IIf(C>Ref(C,-1),Path2,   1));
UpShare= IIf(C<Ref(C,-1),UpShare1,IIf(C>Ref(C,-1),UpShare2,0));
DnShare= IIf(C<Ref(C,-1),DnShare1,IIf(C>Ref(C,-1),DnShare2,0));

FlowFactor = Avg;

FlowIn  = UpShare/Paths*Volume*FlowFactor;
FlowOut = DnShare/Paths*Volume*FlowFactor;
NetFlow = FlowIn - FlowOut;
TotalFlow = Cum(NetFlow );


PlotType = ParamList("Type of Chart Plotting:","Cumulative|Time Segmented",1);
LBP = Param("LBP for Time Segmented Plot",26,10,50,1);
FastSmoothMF     = EMA(TotalFlow,int(LBP/2)); 
SlowSmoothMF   = EMA(TotalFlow,LBP);

DailyNetFlow= IIf(NetFlow==0,MA(Netflow,30),NetFlow);

if(PlotType=="Cumulative")
{
	Plot(TotalFlow ,"Garrett Money Flow",colorRed,styleThick);
}
else if (PlotType=="Time Segmented")
{
	TSMF=FastSmoothMF - SlowSmoothMF;
	Plot(TSMF,"Time Segmented Money Flow",colorRed,styleThick);
	Plot(0,"",colorBlack);
	TSMFsig = EMA(TSMF,9);
	Plot(TSMFsig,"Sig",colorBlue);
	
	Histogram = TSMF-TSMFSig;

	Plot(Histogram,"Histogram",colorBlack,styleHistogram);

}

1 comments

1. shariful

Great work bro KH Tang and thanks from core of heart for sharing your laborious work.

Leave Comment

Please login here to leave a comment.

Back