Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

Plotting Day Wise Equity Curve using Amibroker

1 min read

We know that Amibroker provides an equity curve for the whole strategy. Is there a way where we can build a simple Day Wise PNL to get a better idea about which day’s strategy is performing better to fine-tune the trading system?

It helps traders to avoid non-performing days. For example, if Friday’s Signal performance is not good then one can eliminate trading the system on Fridays.

Here is the simple visualization of Day Wise PNL (Monday Equity Curve, Tuesday Equity Curve ….. Friday Equity Curve)

Sample Trading Amibroker AFL Template to build Day Wise Equity Curve

_SECTION_BEGIN("Simple Two EMA Crossover Trading System");

SetChartOptions(0,chartShowArrows|chartShowDates);
SetPositionSize(1*RoundLotSize,spsShares);

shortema = Optimize("Short EMA",3,1,50,1);
longema = Optimize("Long EMA",13,1,50,1);

ema1 = EMA(Close,shortema);
ema2 = EMA(Close,longema);



//Trading Strategy

Buy = Cross(ema1,ema2); //bullish ema crossover - short MA crossing up long MA
Sell = Cross(ema2,ema1); //bearish ema crossover - long MA crossing down short MA



SetTradeDelays(0,0,0,0);

BuyPrice = ValueWhen(Buy,Close);
SellPrice = ValueWhen(Sell,Close);


iBuy = Buy;
iSell = Sell;

Buy = iBuy AND DayOfWeek()==1;
Sell = iSell;

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);

e1 = Equity(1,0);

Buy = iBuy AND DayOfWeek()==2;
Sell = iSell;

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);

e2 = Equity(1,0);

Buy = iBuy AND DayOfWeek()==3;
Sell = iSell;

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);

e3 = Equity(1,0);

Buy = iBuy AND DayOfWeek()==4;
Sell = iSell;

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
e4 = Equity(1,0);

Buy = iBuy AND DayOfWeek()==5;
Sell = iSell;

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
e5 = Equity(1,0);

Plot(e1,"Eq-Monday",colorGreen,styleThick,styleOwnScale);
Plot(e2,"Eq-Tuesday",colorblue,styleThick,styleOwnScale);
Plot(e3,"Eq-Wednesday",colorRed,styleThick,styleOwnScale);
Plot(e4,"Eq-Thursday",colorYellow,styleThick,styleOwnScale);
Plot(e5,"Eq-Friday",colorPink,styleThick,styleOwnScale);


_SECTION_END();

Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in and Co-Creator of Algomojo (Algorithmic Trading Platform for DIY Traders)

Stoploss, Multi Target, and Trailing Stoploss Module – Amibroker…

After Intraday V2.0 Amibroker Module - a readymade drag and drop module to convert any trading strategy into the intraday trading system with alerts,...
Rajandran R
6 min read

Line Trading – Algomojo Automation Module for Amibroker Users

The line Trading Automation tool is designed for Manual traders who want to perform level-based trade execution faster and also bring some advanced trade...
Rajandran R
58 sec read

Plotting Day Wise Equity Curve using Amibroker

We know that Amibroker provides an equity curve for the whole strategy. Is there a way where we can build a simple Day Wise...
Rajandran R
1 min read

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More