Yearly Performance Table - Demo — Strategy by Ku_Hero
By Ku_Hero
Performance Metrics
- Author: Ku_Hero
- Symbol: OANDA:XAUUSD
- Timeframe: 1 day
- Profit Factor: ,
Description
Yearly Performance Table - DemoThis strategy is a usage example for the YearlyPerformanceTable library, which adds a year-by-year table (net profit, max drawdown, trades, profit factor, win rate) and an optional monthly net-profit table to a strategy. The trading rule below only exists to produce trades for the table. It is not a recommended trading method and it is not presented as a profitable system.EXAMPLE RULE- Long when the 20-period SMA crosses above the 50-period SMA, short on the opposite cross. The position is reversed on each cross, so the strategy is always in the market once the first cross has occurred.- No stop loss or take profit. No time-of-day or session conditions.- "Start date" / "End date" inputs only limit the backtest period. From the end date on, no new entries are made and an open position is closed.DEFAULT PROPERTIES AND WHY- Initial capital 10,000, account currency USD: a modest account size, the same amount on every symbol.- 10% of equity per trade, margin 100% (no leverage): position size stays small relative to the account.- Commission 0.02% per order and slippage 2 ticks: rough costs so that the backtest is not cost-free. Adjust them to your market and broker. On symbols with very low historical prices, a fixed 2-tick slippage is large relative to price and can distort old years.- Pyramiding 0: one position at a time.HOW THE LIBRARY IS USED HERE import Ku_Hero/YearlyPerformanceTable/1 as ypt ... ypt.run(showYearly = showY, showMonthly = showM, valueMode = modeStr, yearlyPosition = _pos(yPosStr), monthlyPosition = _pos(mPosStr), textSize = tSize, maxYears = nYears, timezoneName = tzStr)run() is called once per bar from the global scope, after the order calls. In your own strategy, use the version number shown in the library's import line.INPUTS- Example rule: fast / slow MA length, start date, end date.- Table: show yearly / monthly table, values in currency or percent, table positions (top left can overlap the chart legend), text size, number of years shown, time zone (blank = exchange time zone).LIMITATIONSThe table uses closed trades only, and its drawdown is a closed-trade (balance) drawdown, not the Tester's equity drawdown. See the library's description for the exact definitions (drawdown, profit factor, open positions). The numbers depend on the symbol, timeframe, period and the example parameters.This is a usage example. It does not give trading signals and does not predict future results. Past results of a backtest do not indicate future results.