Equity Curve Trading

trading strategies and money management discussion, code, results

Moderator: moderators

rank: <50 posts
rank: <50 posts
Posts: 11
Joined: Tue Aug 29, 2006 11:07 am
Reputation: 0
Gender: None specified

Equity Curve Trading

Postby fxyorky » Tue Oct 02, 2007 7:54 am

I am looking for an equity curve indicator (?) for tradestation. One that will automatically filter trades. I couldn't find one, can someone point me in the right direction.



Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

rank: <50 posts
rank: <50 posts
Posts: 41
Joined: Fri Feb 02, 2007 3:36 pm
Reputation: 0
Location: a beautiful pirate island in the mediteranean sea
Gender: Male

some thoughts on equity curve trading

Postby peter_77_peter » Tue Oct 02, 2007 11:13 am

Hi everybody,
well i`d be interested as well if anybody knows about good solutions / best practices for equity trading within tradestation.

I`ve done some research on this topic some weeks ago:

1. If a Trading System puts a stop loss to every trade and has a position sizing that limits the risk of each trade to a fixed percent on the equity accumulated with this system, than there is still the possibility that you will be hit at your stop loss lets say x times in a row, resulting in a big accumulative equity drawdown of your trading system.

2. Therefore, if you have a portfolio of trading systems, you have to "put a stopp loss / risk calculation" not only to every trade of every system, but as well to every system as a whole, lets say, stop system x if it generates a drawdown of y percent of its equity. Otherwise your losses as a whole are not controlled and could sum up getting total.

3. The main reason for this is simply to calculate the risk of the system as a whole, to get out before it causes losses you consider as not tolerable. The other reason is to use this risk variable to adjust the position size of money you invest in this particular system. (i.E. You could adapt the position size / money you invest in this system in a way that this system equity stop loss would be a fixed percent of your whole equity that you spread on your diverse markets / systems.) Besides that, if you don´t believe in optimization, and believe in trend following, than you accept that your systems will face drawdowns on a regular basis, then you don`t twiddle all parameters within a drawdown but wait for the recovery of your system. In this situation an equity stop is helping to control / cut these regular drawdowns.

4. The above is mainly what I call an "equity stop loss". Equity trading then would be to design a condition that starts the trading of your system again whenever there would be some event like, "equity rising yxz". The Problem with this is, first, you would restart trading your system at a drawdown / defined max risk, and everything can happen, thought, you can reach deeper drawdowns, and they would be beyond your last risk management criteria. This is like "new trade new game" on system level. Any Strategy that tells you, buy more if equity does this and that, or buy less if equity does this and that, is a fitting trap in my eyes, that is, maybe the percentual winners outcome within backtesting gets kind of significant if you have a big enough trade base, but the distribution of winners and losers is likely to not reproduce itself. Therefore it is likely that you will "get out of rhythm", that is adding more to loosers, cutting short winners, when you would really equity trade the system that looks well within backtesting. You just don´t know whether your next trade will be loosing or winning and you cannot do anything about that. When you believe in trend following then you could apply the same trend identification that you use for "every trade" based on price, as well for your system as a whole based on equity, I think this is a nice idea in theory, put practically this smells like a different kind of fitting to me.

---> So what I suggest is: The only thing you can do is cut losses of your equity applying an equity stop loss therefore you can calculate the risk / and the position of money to allocate with this system. When you are winning then a fixed percent risk of your system`s equity that you can afford with every trade within this system gets more and more in absolute terms, that is a small antimartingale effect which might produce geometric grow. I think everything else is unrealistic in terms of "you would need a crystal ball to do it" therefore results in fitting if you still attempt to do it.

5. how wo implement / backtest equity curve trading within tradestation? Well Implementing an equity stop is trivial, you just have to define a model for your equity, i.e. you say, your modell for equity is: yourcapital - your gross loss + your gross win - yourposition fees (and slippage) updating this after every liquidation of a position. (I`ve said model because, some might want to calculate their equity in a different way, i.e. not discrete after each trade, using open profits/losses for their (in parts not realised as such) equity, so choose whatever model seems suitable for you if you know the reasons for your choice). Then you can define equity highs/lows, and whenever your equity reaches a valley that is deeper than x percent of the recent peak, then you stop trading your system. Actually then you can monitor the system without trading it, decide whether you think you have to change something, or whether you still believe in your system and wait for more suitable markets. The bad thing about this is, you cannot backtest it. If you really want to backtest this, then you would have to write a kind of little trading simulation, like, if your equitystop is true you do papertrading with your system until condition "paperequity is yxz" is met where you would start "really trading your system again", therefore you would have to replicate your tradingsystems code just writing the prices you would have bought / sold to into variables without really buying / selling, updating your papergrossloss / papergrossprofit / papercommissions / paperslippage on that basis, continuing your equity model virtually without really trading it (in all phases where your equity stop is hit, until you start real trading again where you would switch back to the real execution part of your systems code, setting your equity back to the real value / resetting your paper equity). A great way to to this better would be to know a way to tell tradestation not to execute the orders, but still do actualisation/updating of the tradestation intern variables, so you would not have to rebuild all these variables on your own. I have not found a way doing this.

6. I decided for myself that my trading systems are complicated enough, I want to keep things easy, so I just added an equity stop to the system, and will make up my mind watching my systems without execution of the orders.

7. There is a tool that says it does equity trading for tradestation:


You can test it for free but,if you look closer, then you see that it cannot really do equity trading on a real time basis, probably for the above given reasons:



"Can I use MSA with my automated trading system in TradeStation?

MSA is designed as a stand-alone Windows program. However, it does include a TradeStation function called PSCalc (described in the appendix to the user's guide) that can be used to automate the basic position sizing methods of MSA in TradeStation strategies. This function is not intended to duplicate the full functionality of MSA and does not include the dependency rules and equity curve crossover rules."


Besides that there are some interesting articles on their site about equity crossovers, about position sizing, about monte carlo analysis (which says something about "the distribution topic" I´ve mentioned at 4.). These mentioned articles are easy visible from the above quoted links.


If anybody has made experience within this field of system trading, or knows about solutions/tools, or other valueable contribution of know how, then I would really appreciate that, because I think the topic itself is important, because of the consistency:

---> whatever you do to calculate SL / Risk / Size of every single trade of your System you should do as well to the system itself,

(compare the pirates discussion on possible exit strategies for calculating SL / risk / position size for each trade at: http://kreslik.com/forums/viewtopic.php?t=706 )

---> therefore you can put the logic of equity trading like this: if price should be considered the "mother" indicator for every single trade, then equity is the "mother" indicator of your system itself.

What do you pirates think on all that???

best regards from spain,

rank: 150+ posts
rank: 150+ posts
Posts: 410
Joined: Tue Oct 17, 2006 10:53 pm
Reputation: 0
Gender: Male

Postby 4x=0 » Sat Oct 27, 2007 9:56 pm

I highly recommend using Microsoft Excel 2007 for generating an equity curve. I download my trade data from my broker and then the fun begins. Can you export data from Tradestation to excel? I hope so..

Once the data is in excel You have ultimate flexibility! I am able to plot an equity curve, and also "filter" the data to display trades only taken in February, or March, or First Quarter of 2007, or what have you. There are no limits. After "filtering" the curve will also reflect the changes. I just had a lot of fun with this and printed my equity curve for each month that my account has been open, also for each quarter.

Not to mention you can sort by currency pair, you can filter out the top 10 trades, or all trades above average. I also calculate my curve with and without commissions deducted. Yes, this is how I spend my Saturdays!

User avatar
rank: 10000+ posts
rank: 10000+ posts
Posts: 13025
Joined: Sun May 14, 2006 9:31 pm
Reputation: 1645
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified

Postby TheRumpledOne » Sat Oct 27, 2007 10:24 pm

"Yes, this is how I spend my Saturdays!"

May the Gods have mercy on your soul.


Please do NOT PM me with trading or coding questions, post them in a thread.

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

Return to “strategy trading & money management”