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

Detailed Equity Curve for Amibroker (AFL)
kaiji
over 12 years ago
Amibroker (AFL)

Rating:
5 / 5 (Votes 2)
Tags:
amibroker, equity curve

While equity curve line and equity curve area graphs are on a trade by trade basis the detailed equity graphs is on a bar-by-bar basis. You see the original equity curve and the accumulated MAE, MFE as a low or high of a new equity curve. So you see that drawdowns intraday could be much higher.

Author: Dubi

Similar Indicators / Formulas

Kavach Of Karna v2
Submitted by hbkwarez over 8 years ago
Advanced Elliott Waves
Submitted by MarcosEn about 11 years ago
3_6Day GuaiLiLv
Submitted by motorfly almost 11 years ago
Williams Alligator System
Submitted by durgesh1712 about 11 years ago
Interactive Linear Regression Channel
Submitted by InternetWorm almost 11 years ago
*Level Breakout system*
Submitted by Tinych about 11 years ago

Indicator / Formula

Copy & Paste Friendly
SetCustomBacktestProc(""); 

/* While equity curve line and equity curve area graphs are on a trade by trade basis
the detailed equity graphs is on a bar-by-bar basis. */ 

if( Status("action") == actionPortfolio ) 
{ 
    bo = GetBacktesterObject(); 

	NumTrades = AccumMAE = AccumMFE = 0;
	bo.PreProcess();
	for (bar = 0; bar < BarCount; bar++)	// Loop through all bars
	{
		bo.ProcessTradeSignals(bar);
		for ( sig=bo.GetFirstSignal(bar); sig; sig=bo.GetNextSignal(bar) )
		{
			if (sig.isEntry())
			{
				NumTrades++;
				VarSet("Bar" + NumTrades, bar);
				//_TRACE("Symbol " + sig.Symbol + " TradeEQ: " + VarGet("Bar" + NumTrades));
			}
		}
	}
	
	NumTrades = 0;
	
	for( trade = bo.GetFirstTrade(); trade; trade = bo.GetNextTrade() ) 
	{ 
		NumTrades++;
		TradeBar = VarGet ("Bar" + NumTrades);
		if ( TradeBar != 0 )
		{
			AccumMAE = AccumMFE = 0;
			AccumMAE = VarGet ("AccumMAE" + TradeBar);
			AccumMFE = VarGet ("AccumMFE" + TradeBar);
			if ( AccumMAE != 0 )
				AccumMAE = AccumMAE + (trade.GetMAE() * trade.EntryPrice * trade.Shares * trade.PointValue / 100);
			else
				AccumMAE = trade.GetMAE() * trade.EntryPrice * trade.Shares * trade.PointValue / 100;
				
			if ( AccumMFE != 0 )
				AccumMFE = AccumMFE + (trade.GetMFE() * trade.EntryPrice * trade.Shares * trade.PointValue / 100);
			else
				AccumMFE = trade.GetMFE() * trade.EntryPrice * trade.Shares * trade.PointValue / 100;
				
			VarSet("AccumMAE" + TradeBar, AccumMAE);
			VarSet("AccumMFE" + TradeBar, AccumMFE);
		}

	} 
	bo.PostProcess();
	
	Eq = Foreign("~~~EQUITY", "C");
	EqO = Ref(Eq,-1);
	EQLow = EQHigh = 0;
	for (bar = 0; bar < BarCount; bar++)	// Loop through all bars
	{	
		//_TRACE("Eq " + Eq[bar]);
		iMAE = VarGet("AccumMAE" + bar);
		iMFE = VarGet("AccumMFE" + bar);
		if (iMAE != 0)
			EQLow[bar] = Eq[bar] + iMAE;
		else 
			EQLow[bar] = Eq[bar];
		if (iMFE != 0)
			EQHigh[bar] = Eq[bar] + iMFE;
		else 
			EQHigh[bar] = Eq[bar];
	}
	AddToComposite( Eq, "~~~EQUITY NEW", "C", atcFlagDefaults | atcFlagEnableInPortfolio ); 
	AddToComposite( EqO, "~~~EQUITY NEW", "O", atcFlagDefaults | atcFlagEnableInPortfolio ); 
	AddToComposite( EQLow, "~~~EQUITY NEW", "L", atcFlagDefaults | atcFlagEnableInPortfolio ); 
	AddToComposite( EQHigh, "~~~EQUITY NEW", "H", atcFlagDefaults | atcFlagEnableInPortfolio ); 
} 

1 comments

1. timingpundit

Worked perfectly.

Leave Comment

Please login here to leave a comment.

Back