Drawdown

 http://www.investopedia.com/terms/d/drawdown.asp#axzz1oIlAIpvu


Definition of 'Drawdown'
The peak-to-trough decline during a specific record period of an investment, fund or commodity. A drawdown is usually quoted as the percentage between the peak and the trough.


Investopedia explains 'Drawdown'
A drawdown is measured from the time a retrenchment begins to when a new high is reached. This method is used because a valley can't be measured until a new high occurs. Once the new high is reached, the percentage change from the old high to the smallest trough is recorded.

Drawdowns help determine an investment's financial risk. Both the Calmar and Sterling ratios use this metric to compare a security's possible reward to its risk.


 

 http://en.wikipedia.org/wiki/Drawdown_(economics)

Drawdown (economics)

From Wikipedia, the free encyclopedia
Jump to: navigation, search

The Drawdown is the measure of the decline from a historical peak in some variable (typically the cumulative profit or total open equity of a financial trading strategy).

Somewhat more formally, if X(t) is a random process [X(0) = 0, t \geq 0], the drawdown at any time, T, denoted D(T) is defined as

 D(T)=Max \lbrack 0, Max_{t \in (0,T)} X(t)- X(T) \rbrack

The Maximum Drawdown (MDD) up to time T is the maximum of the Drawdown over the history of the variable. More formally,

 MDD(T)=Max_{\tau\in (0,T)}\lbrack Max_{t \in (0,\tau)} X(t)- X(\tau) \rbrack

The following pseudocode computes the Drawdown ("DD") and Max Drawdown ("MDD") of the variable "NAV", the Net Asset Value of an investment. Drawdown and Max Drawdown are calculated as percentages:

MDD = 0
peak = -99999
for i = 1 to N step 1
  if (NAV[i] > peak) 
    peak = NAV[i]
  else
    DD[i] = 100.0 * (peak - NAV[i]) / peak
    if (DD[i] > MDD)
      MDD = DD[i]
    endif
  endif
endfor

López de Prado and Peijan (2008)[1] have shown that Value at Risk substantially underestimates an investment's loss potential when its returns are incorrectly assumed to iid follow a Normal Distribution.

In finance, the use of the maximum drawdown as an indicator of risk is particularly popular in the world of commodity trading advisors through the widespread use of three performance measures: the Calmar ratio, the Sterling ratio and the Burke ratio. These measures can be considered as a modification of the Sharpe ratio in the sense that the numerator is always the excess of mean returns over the risk-free rate while the standard deviation of returns in the denominator is replaced by some function of the drawdown.

When X(T) is a standard Brownian motion, the expected behavior of the MDD as a function of time is known. A standard Brownian motion is represented as

X(t)=\mu t+ \sigma W(t),

where W(t) is a standard Wiener process. Then when \mu >0 the MDD grows logarithmically with time, \mu =0 the MDD grows as the square root of time and \mu <0 the MDD grows linearly with time.

[edit] Further reading

[edit] References

  1. ^ López de Prado and Peijan (2008): "Measuring the Loss Potential of Hedge Fund Strategies", Journal of Alternative Investments (7)1, 7-31. http://ssrn.com/abstract=641702

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
# Set cash inside the strategy cerebro.broker = bt.brokers.BackBroker(coc=True) # 设置启动资金 cerebro.broker.setcash(10000.0) # 设置交易单位大小 # cerebro.addsizer(bt.sizers.FixedSize, stake=5000) # 设置佣金为千分之一 cerebro.broker.setcommission(commission=0.003) # 添加图表设置 cerebro.addobserver(bt.observers.Broker) cerebro.addobserver(bt.observers.Trades) cerebro.addobserver(bt.observers.DrawDown) # Set leverage #cerebro.broker.setcommission() # 添加分析指标 # 收益率 cerebro.addanalyzer(bt.analyzers.Returns, _name='_Returns') # 收益期间 cerebro.addanalyzer(bt.analyzers.TimeReturn, _name='_TimeReturn') # 计算最大回撤相关指标 cerebro.addanalyzer(bt.analyzers.DrawDown, _name='_DrawDown') # 回撤期间 cerebro.addanalyzer(bt.analyzers.TimeDrawDown, _name='_TimeDrawDown') # 计算年化夏普比率 cerebro.addanalyzer(bt.analyzers.SharpeRatio, _name='_SharpeRatio', timeframe=bt.TimeFrame.Days, annualize=True, riskfreerate=0) # 计算夏普比率 # 交易统计信息,如获胜、失败次数 cerebro.addanalyzer(bt.analyzers.TradeAnalyzer, _name='_TradeAnalyzer') # 运行回测 result = cerebro.run() # 输出回测结果 # 提取结果 print("--------------- 收益期间 -----------------") print(result[0].analyzers._TimeReturn.get_analysis()) print("--------------- 最大回撤相关指标 -----------------") print(result[0].analyzers._DrawDown.get_analysis()) print("--------------- 回撤期间 -----------------") print(result[0].analyzers._TimeDrawDown.get_analysis()) print(f"最终资金: {cerebro.broker.getvalue():,.2f} 元") print("收益率:",result[0].analyzers._Returns.get_analysis()['rtot']) print("夏普比率:",result[0].analyzers._SharpeRatio.get_analysis()['sharperatio']) # 绘制图表 cerebro.plot(iplot=False, style='candlestick', barup='red', bardown='green', volume=True, volup='red', voldown='green')这一代码显示IndentationError: unexpected indent
最新发布
06-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值