Is there a Drawdown indicator?
Author: mikesblack
Creation Date: 5/4/2016 9:31 PM
profile picture

mikesblack

#1
Which indicator is most like a draw down? Mike
profile picture

Eugene

#2
Yes, there's a study (method) in Community Components:

Gain and Drawdown
profile picture

mikesblack

#3
Thank you. Are there any coding examples in trading systems that use this?
profile picture

Cone

#4
I don't think so. How do you want to use it? pd.DrawdownSeries is a DataSeries like any other.
profile picture

Eugene

#5
Perhaps Mike is looking for what appears to be strategy/portfolio's drawdown indicator? In this case I've just updated the relevant KB article with an example of building and visualizing the portfolio drawdown % series:

WealthScript Techniques | Interacting Dynamically with Portfolio Level Equity

Scroll down to "Run an existing Strategy from disk and display its portfolio equity curve".
profile picture

mikesblack

#6
I'm mostly interested in using it as a buy indicator. E.G. SomeValue = 20 %. If drawdown of SPX > someValue. Buy at market, or if symbol - SPX drawdown > someValue.. Buy at market. Thanks for your feedback Eugene and Robert.
profile picture

Eugene

#7
The DrawdownSeries of GainAndDrawdown is just a DataSeries. Check out the WealthScript Programming Guide > DataSeries > Accessing a Single Value from a DataSeries
profile picture

mikesblack

#8
Thanks Eugene, I will.
profile picture

mikesblack

#9
I created a system with what I believe is a drawdown indicator for the .SPX. Code below.
Can you check if I am correct?
Can you help write a simple system that takes a look at the SPX and buys at market if in a drawdown of someValue is reached and sell at market when making new equity highs? It would help to make sure I'm using the code example correctly.
CODE:
Please log in to see this code.
profile picture

Eugene

#10
QUOTE:
and sell at market when making new equity highs?


CODE:
Please log in to see this code.
profile picture

mikesblack

#11
Thank you!
profile picture

mikesblack

#12
unfortunately, no signals or trades on the S and P 500 all data.
CODE:
Please log in to see this code.
profile picture

Eugene

#13
Solution:

http://www.wealth-lab.com/Forum/Posts/38133, post #12
http://www.wealth-lab.com/Forum/Posts/38184, post #2

Let's trust the old adage saying that repetition is the mother of learning. Hopefully this time you get it right. But I fail to see why did you remove a curly brace that had been positioned correctly: that line of code didn't require any modification.
profile picture

mikesblack

#14
Yes it is. Thanks for the feedback.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).