This is a trading item or a component that was created using QuantShare by one of our members.
This item can be downloaded and used by QuantShare Trading Software.
Trading items are of different types. There are data downloaders, trading indicators, trading systems, watchlists, composites/indices...
You can use this item and hundreds of others for free by downloading QuantShare.
Top Reasons Why You Should Use QuantShare:
Works with US and international markets (stock, forex, options, futures, ETF...)
Offers you the tools that will help you become a profitable trader
Allows you to implement any trading ideas
Exchange items and ideas with other QuantShare users
Our support team is very responsive and will answer any of your questions
We will implement any features you suggest
Very low price and much more features than the majority of other trading software
This technical analysis indicator calculates the drawdown of any time-series beginning from the bar at which the provided signal array is TRUE. Unlike the default drawdown function, which calculates the drawdown from the first bar, the drawdown calculated by this function is reset each time the given signal array becomes true.
You can for example provide a buy signal as argument for this drawdown function and it will return the security drawdown since the entry bar (buy signal is true). We can then use this indicator as a sell rule or combine it with another sell rule.
buy = cross(close, sma(30));
sell = cross(sma(30), close) AND drawdowneq(buy, close) < -10
The above sell rule generates a sell signal when the close price crosses below the 30-Bar simple moving average and at the same time the position drawdown is lower than 10%.
Using a 10% trailing stop in the simulator will close the position even if the close price did not cross below the 30-Bar SMA.
Note that you normally should remove excessive signals from the buy rule (The cross function do not need that), by using the "RemoveSameSignals" indicator. Example: buy = RemoveSameSignals(buy);
Here is another example: Using intraday data, the following formula calculates today's drawdown:
drawdowneq(day() != ref(day(), 1), close);
There are no successive occurrences in the above signal formula and therefore the "RemoveSameSignals" function is not necessary.