2/28/2024 0 Comments Maximum drawdown stock screenerI added the iteration number just for fun. Input : an array of floats of arbitrary size (the values we want the DD of) Maximum drawdown measures the decline of an investment from its peak (high) to trough (low) during a specific period of time. ![]() There a 2 functions : "maximum_relative_drawdown" and "maximum_dradown" (and "optimized_maximum_relative_drawdown" and "optimized_maximum_drawdown") with names speaking for themselves. ETF Screener Fund Screener Stock Screener. ![]() The drawdown chart below compares losses from any high point along the way for VUG and VTI. The longest duration of drawdown, calculated as the maximum. The maximum VUG drawdown for the period was -18.68, lower than the maximum VTI drawdown of -14.06. In the example we calculate the maxDDs of the last 10 close values. Maximum loss from peak to trough, calculated as: (trough-peak)/peak. There are 2 algorithms to calculate maxDD and relative maxDD%, one non optimized needs n*(n - 1)/2 comparisons for a collection of n datas, the other one only needs n-1 comparisons. I didn't find any builtin pinescript way to do it, so here it is. The drawdown chart below compares losses from any high point along the way for VOO and SPLG. ![]() The Stock Screeners section contains categories to control which stocks from the available markets are displayed based on company indicators. Some securities will include data preceding this date, if available. I needed a way to calculate the maxDD% of a serie of datas from an array (the different values of my balance account). The maximum VOO drawdown for the period was -11.62, roughly equal to the maximum SPLG drawdown of -11.60. The Max time period will display back to the beginning of the security or for most securities. Maximum Drawdown and Maximum Relative Drawdown% calculating functions. The maximum drawdown (MDD) is an alternative to VaR that can assess the tail risk and is commonly used as a risk indicator among investors (.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |