Average on equity

Viewing 11 posts - 1 through 11 (of 11 total)
  • #9562

    Hi.

    There’s a way to have average on equity line inside a trading system code?

    Thanks.

    Andrea

    #9563

    Of course, you can add any value arrays in AVERAGE function. Just compute your equity variable and average it on n periods.

    #9564

    Thanks.

     

    How can i compute my equity variabile?

    #9567

     

    #9569

    Thanks

    #14917

    Hi

    Thank you for the code. What I have to do if I want that the strategy only trade if the equity curve is above the moving average (of the Equity curve)?  I tried it with this one but it doesn`t work:

     

    #14932

    I’m sorry, I forgot something important. It’s more complicated than I thought. I have inserted a picture to illustrate it.

    If the equity curve is above the MA, then the system trades (it`s online).  If the equity curve is below the MA then the system must be offline. The problem is, however, that the strategy have to make “fictitious order” (without really buying contracts) so you can get back in the system as soon as the strategy is again over the MA. Hope you understand what I mean.

    #16544

    Hi, did you work a way around this problem?

    #16551

    No :(((

    #16558

    I did not test the code Skubidu made, but from my own experience, trading the equity curve is a dead-end. I used to make a lot of tries and experimentation on this on other trading software languages, with fictitious orders but the result is almost always the same :

    1. you miss a lot of good trades, your strategy is “broken”..
    2. even if a fictitious trade made good gain for the equity curve to be above the average, the next trade could a looser and same thing happen again: you need to make new fictitious trade, etc.

    It results at the end that your strategy is not a looser one, but not a winner one. The equity curve of the overall strategy backtest is almost like a flat line.

    However, this is something very interesting for educational purpose, I may write something about it in the blog.

    #16881

    For your information, Wisko have solved the problem of not displaying correctly the equity curve for the IG accounts users, you can have a look it here:

    http://www.prorealcode.com/blog/trading-strategy-profit-curve/#comment-2189

    Here is the full code he get from PRT to fix this issue:

    Hope it helps here too 🙂

     

Viewing 11 posts - 1 through 11 (of 11 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login