Simulated trading

Forums ProRealTime English forum ProOrder support Simulated trading

Viewing 15 posts - 16 through 30 (of 55 total)
  • #162767

    The EquityDD_OwnVariables_L.itf – Robo is working. I have used it on the DAX 1m and 5m-chart over several different candle periods.

    Feel free to use this robo as good start for further improvements or your own strategies and please tell if you fixed any errors or limitations.

    It would be nice to see successful trading strategies using this algo to pause trading and restart trading in a proper manner, avoiding trading in periods where the core strategy should not be trading.

    We stop our robots, once the max DD as of backtesting has been exceeded. Now it is possible to track simulated equity curve and see when the robot is back on track! Then we can restart it.

    Have fun and Good Trading!

    🙂 Peter

    #162770

    And could the bot be paused and started automatically with these indicators?

    #162777

    it is possible to track simulated equity curve and see when the robot is back on track! Then we can restart it.

    …having just missed a nice set of winning trades and just in time for the next set of losing trades. Simulated trading can keep you off the market during winning periods as easily as it can keep you on the market during losing periods! Yes simulated trading can make a back test look better by missing a few losing trades less than the winning trades it also misses but we can never know the distribution of winners and losers in the future which may be very different to the distribution of winners and losers in our historical data.

    #162779

    And could the bot be paused and started automatically with these indicators?

    Yes… but you may miss a whole load of winners and get back on the market just in time for a whole bunch of losers so it is not the holy grail that will make a bad or even average strategy any better. It could just as easily make it worse in the future with just the right distribution of winners and losers.

    A simple example. We have a strategy that stops trading if we have a loser and starts trading again if we have a simulated winner. The wins and losses come in the following order: LWLWLWLWLWLW. Our simulated trading just managed to hit every losing trade and miss every winning trade. Say we change it so that it stops trading after two losers in a row and you have to have two simulated winners in a row before it starts trading live again and then the winners and losers come like this: LLWWLLWWLLWWLLWW. Once again we get to trade every loser and miss every winner.

    It can be the same for equity curve simulated trading. We start with one big loser that puts us in 5% drawdown from our starting capital so we switch to simulated trading and the next six trades make 1% each but we missed them all but as we are back in a simulated positive equity we turn trading back to live and the next trade is a loser so we turn trading back to simulated and the next trade is a winner…but once again we missed it…. and so on and so on until our simulated trading empties our bank account.

    #162783

    Yes, I understand and I know.

    But so far my systems win 80-90% of trades.

    They carry out between 100 and 250 operations in 3 years.

    Losing trades are widely spread in those 3 years, with 2 consecutive trades with losses being the longest losing streak.

    I think maybe they would earn a little less money, but the trade would be much safer … maybe it would be worth it.

    #162798

    So you have very rare losing trades very evenly spaced throughout history and never more than 2 losing trades in a row…. and how exactly will simulated trading avoid you trading those losing evenly spaced trades?

    If you had said that you had 90% winners but sometimes a streak of 10 losers in a row then simulated trading might help avoid some of those losers… and also quite a few winners too.

    Your strategy does not sound like it would benefit in any way from simulated trading at all. Better to just put a QUIT in the strategy if there are three losers in a row and then manually decide if it has failed or something major has changed the way the markets are behaving.

    #162817

    And how to program an indicator with “Equity”, “DDlevel”, and “Runuplevel” of the Pedros code?

    Vonasi, I think the results will impress you.

    #163150

    It doesnt work.

    🙁

    #163245

    This code calculates

    • equity (curve)
    • max drawdown
    • number of max Drawdown candles

    Only Long trading so far. Room for improvement!

    You can use this code for your own robots to pause trading and simulate trading during this time. The information gathered from simulated trading might be helpful to decide when to re-start trading.

     

    #163331

    Added Runup and number of Runup Candles!

    Note: this code is only the part where virtual trading parameters are calculated!
    Live trading (“buy” and “sell” orders) in this code is only used to check on results of simulated trading and make the robot run!
    Without “buy” and “sell” orders the code would not start running!

    Using this code within an own robot means there is still some work to do!

    There are no variables yet when to stop live trading or re-start live trading!
    After re-starting live-trading I recommend to synchronise variable “equity” and PRT system variable “Strategyprofit” (equity=strategyprofit) and to reset relevant virtual trading variables respectively.

    🙂

     

    #163360

    Hi I’am starting to test your idea. First thing I run into is I don’t have exits on a long only strategy based on a crossing. It’s only based on %loss & %gain.

    So how would you tackle that? You can’t use a set command nor you can’t use positionperf  if your not on market.

    #163362

    You must convert the % profit or loss into a price value and then check at each candle if that candle has crossed that value (value  < high and value > low). Then do the calculation to work out what you would have lost or won exiting at that value and add that to your simulated equity.

    #163363

    Yes, the entry is easy to calculate, it’s more coding involved with the exit. Although I agree with Vonasis previous posts regarding this subject, I was too curious not to try it out on a couple of systems, one good and one bad.

    I tried some different approaches, e.g. the one with setting the strategy on hold after a certain amount of draw-down, then starting it again when it has reached a new high in the equity curve.

    I also optimized the variables involved, but not one combination led to a better equity curve than the original (without stopping the strategy).

    However, with the bad strategy, once it stopped it never started again (due to not reaching a new high in the equity curve. So that strategy actually made better result not trading at all. 🙂

    #163364

    This is the latest version so far (3d). I think I fixed the “DEFPARAM Preloadbars” problem. One additional problem was, that the level-variables have to be adjusted to possible capital variable settings!! Since I did this “initializing” of the variables all is perfectly fine. At least I did not see wrong results for equity, DDMax and RUmax anymore! All  good!?

    Please help testing this code before using it. If have any results different from PRT please tell! Thank you!

    #163366

    As I see it: Simulated trading to me is not a means to improve backtesting results but to pay heed to the fact, that there are periods on market, were robots fail. With simulated trading you can tell when the robot seems to be back on track (of course there will never be a guarantee about that) and then you can restart trading. Our concept as we intend to use it:

    1. We already do have good robots on the market and proper results of backtesting drawdowns and live trading drawdowns
    2. Let’s say max drawdown as of backtesting and/or live trading was 1.000€
    3. This maxDD was produced within 20.000 MaxDDCandles
    4. Now we start live trading with the simulated trading algo implemented!
    5. Suddenly our drawdown drops below 1.000€
    6. So we put live trading on hold.
    7. Instead, we (re-)start simulated trading.
    8. So simulated equity curve calculation starts from the very beginning as if the robot was just taken live. Profit/Loss=0.
    9. After 20.000 candles we look at the equity curve
    10. If there is a profit, we re-start live trading
    11. If there is still a loss, we restart simulated trading and wait for the next 20.000 candles to decide on live trading again!
    12. and so on …

      .
      .
      Of course this is just one possible idea how to use this code. I am sure there are plenty of other ways to use it.

      🙂 Peter

Viewing 15 posts - 16 through 30 (of 55 total)

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