Simulated trading

Forums ProRealTime English forum ProOrder support Simulated trading

Viewing 15 posts - 1 through 15 (of 55 total)
  • #162711

    Please,  i need code to simulate trading when the system are on drawdown.

     

    I see articles, but not a real code to this.

     

    I think Vonasi equivocate, this a great idea.

    #162712

    Up with simulated trading.

    Down with not simulated trading.

     

    #162715

    I think Vonasi equivocate, this a great idea.

    My views on it have varied but I think my overwhelming thoughts on simulated trading is that it can be just another thing to curve fit. A decision has to be made on what is to be used as the filter that switches trading on and off and we inevitably choose this by curve fitting the filter to history to see what worked best.

    #162716

    Just started to analyse this problem.

    Coded a Trading system with graphical output of Equity Curve, Drawdowns and Drawdown Candles to better understand how PRT works and calculates variables.

    Next step is to replace system variables with own variables to enable simulated trading.

    I hope the code helps! 🙂

    #162718

     

    #162721

    A first idea:

    When the system reaches a 5% drawdown from Maxprofit, it stops operating with real money and begins to simulate operations.

    Only return to real money trading if it exceeds Maxprofit.

    #162728

    https://www.prorealcode.com/blog/learning/how-to-improve-a-strategy-with-simulated-trades-1/

    Maybe we could study this old idea and article by Nicolas with the idea of doing it with Maxprofit and drawdown instead of moving average equity curve.

    I think the base of Nicolas’ code is good and could be reprogrammed with Pedro’s code.

    #162729

    I honestly think that not enough interest has been given to simulated operations, except for a few Vonasi codes.

    I think that simulated operations can be very important in many strategies, although the idea of Nicolas in his code with moving average equity curve I do not think it is the best.

    The Maxprofit and drawdown thing could work very well.

    But I am sure that the members of this forum could have very good and different ideas.

    #162730

    Using an average of the equity curve or just stopping trading after too many losses or even just one big loss are all not viable working options.

    The problem with averaging an equity curve is that you curve fit the average period to history to get the best result but the future does not care about what period of equity average worked best in the past.

    The problem with stopping trading after a few losses or even just one big loss is that the next few trades could all be winners and then your simulated trading tells you to get back on the market just in time for the next series of losers or the next big loser. You can just as easily simulate your way to hitting every loser and missing every winner as you can simulate your way to hitting more winners than if you took every trade.

    It’s better to create a robust strategy than look to something like simulated trading to turn a donkey into a racehorse I think…. plus simulating strategies with things like partial closure and trailing stop losses can be a lot of work to create with very complicated code and also not totally accurate due to not knowing exact entry and exit prices because spread, slippage and fees of real trades can not be known.

    #162739

    Maybe it could be easier than it seems.

    We program two indicators:

    The first calculates the Maxprofit of the system, and when an operation fails, it PAUSES the system or operates with the minimum accepted by the broker (example, Dax € 0.5).

    The second calculates the Maxprofit of the system, but when the first indicator fails an operation it continues calculating the performance of the simulated operations. When the second indicator crosses above the first indicator the system returns to real money trading or trading the usual € pip amount.

    #162745

    Yes it is perfectly doable and really only requires one indicator and one strategy…. but you have to ensure that the indicator and the strategy stay in synch – which is harder than you think. When the strategy and the indicator have a position open is is possible for the indicator to keep its position open and the strategy to close its position due to the difference between real spread and simulated spread. Then the strategy could open a new position whilst the simulation is still holding the old position. Also with varying spread and real life slippage and fees simulated profit and loss can be very different to actual profit and loss so we could be basing our decision to keep trading switched on when losses are actually much bigger than we think.

    It is better to have a simulated indicator that looks at and analyses every possible trade that there could be (so even ones that the real strategy missed because it already had a position open) and then use this as a filter to turn on or off trading. With this method we can see much more quickly if a strategy idea is quite simply failing or stops working due to a change in the character of the market. Simulating every possible trade in an indicator can be difficult to code if a strategy is very complicated.

    #162754

    OK, an idea.

    In Pedro’s code:

    Program 2 indicators, the first to operate with real money only when EQUITY is above DDLEVEL.

    The second to keep track of simulated operations, and when Equity is again above DDLEVEL in simulated operations, it will return to real operations.

    In this way we have two exactly the same performance indicators

    #162759

    Tony40 – Please try not to use rude words in the forums. Your post has been deleted.

    #162761

    You don’t need two indicators. You need one strategy and one indicator or just one strategy with simulated trading built in.

    Personally I’d go for one indicator that records the reults of every possible trade (even ones that the strategy would miss because it was already on the market) and then one strategy that just uses an on/off signal called from the indicator…. but as I said before I don’t see much if any benefit to adding simulated trading to a strategy as it can just as easily keep you in for every loser and out for every winner as it can improve performance.

    #162763

     

Viewing 15 posts - 1 through 15 (of 55 total)

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