Originally Posted by Zheka
Zorro's example on "Equity curve trading" that you are following is wrong: your "total_equity" and "max_equity" are series, i.e. are updated at each BAR (have no connection to each Trade).
(When a system is out of the market - guess what will happen?)

Because of this, in your loop you make comparisons of exactly the same values and increment Count "closed_trades" number of times.

To implement this correctly, you have several options:

- use static series and update it manually at trade exit: ( http://manual.zorro-trader.com/shift). Then you do not need a for(closed_trades) loop.
- at trade exit (in a tmf) save Equity to a TradeVar and separately keep track of the max Equity(no need for a series). Then you access TradeVars and compare these in for(trades) loop and increment Count as needed.




I haven't had much time lately. I have tried the above but haven't had any success. It could be the way I have coded everything but more investigation is needed. Your first option (static series) looks to be the most straight forward so I'm focusing on that for now.

Thanks for the ideas.

Last edited by Qw3rty; 08/15/20 06:11.