Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Detailed Equity Curve for Amibroker (AFL)
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
Indicator / Formula
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
Leave Comment
Please login here to leave a comment.
Back
Worked perfectly.