Created
June 3, 2018 08:42
-
-
Save marketcalls/beaf613c697396bfaa2246b0e2676af1 to your computer and use it in GitHub Desktop.
Equity Drawdown - Marketcalls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////// | |
// Copyright by Rajandran R v1.0 03/06/2018 | |
// Website : www.marketcalls.in | |
//////////////////////////////////////////////////////////// | |
study(title="Equity Drawdown - Marketcalls") | |
Eq=close | |
MaxEQ = Eq > MaxEQ[1] ? Eq : nz(MaxEQ[1], Eq) | |
DD = 100 * ( Eq - MaxEQ ) / MaxEQ | |
MaxDD = DD < MaxDD[1] ? DD : nz(MaxDD[1], DD) | |
plot(DD, color=red, title="Drawdown", style=area, linewidth=2, transp=40) | |
plot(MaxDD, color=blue, title="Max Drawdown", style=line, linewidth=3, transp=40) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment