Hi Fran55. I don’t know if I understood correctly. What you want is that the system does simulated operations while it remains in drawdown? That is, when a loss operation occurs, would you only operate with real money again if with simulated operations it exceeds the maximum achieved by the system with real money? It seems like a good idea, but I don’t know if it’s possible.
It seems like a good idea
Not really. From my earlier tests with simulated trading I found that there was every possibility that you can have a series of losing trades and then stop real trading and switch to simulated trading. Then you have a series of winners that you totally miss out on. Then the strategy switches from simulated trading to real trading and you get a loser so it turns real trading off again and the next trade is a winner but you miss it… and so on and so on until you go bust.
Hi Vonasi. I think that doesn’t have to be that way. The difference lies in having a system that hits 60% of the operations (one guess), or having a system that hits 90% of the operations (another guess). With such a high level of success, I don’t think there would be a problem. Still, the code would be workable in .prt?
Because we can never know how the winners and losers are distributed you could get lucky and hit all the winners while real trading and miss all the losers while simulated trading or it could be the complete opposite. We could adjust our criteria for switching too and from simulated trading but this is just curve fitting to the distribution of winners and losers in our back testing data.
The standard model for simulated trading is to compare our equity curve to an average of the equity curve but even with this we just end up curve fitting the average period and/or average type to try to hit as many winners in the back test data as possible.
Better to just have a strategy that takes all trades and that has been properly robustness tested and passed those tests than waste time to curve fit a simulated trading idea in my opinion.
Yes the code to do what Fran55 wants is possible as has been shown by the simulated trading codes that Nicolas and I have created. Will I be spending my time creating another simulated trading code….. no. 🙂
Entiendo a Vonasi.
Supongo que los resultados generales empeorarían.
Aun así, creo que la diferencia sigue siendo tener un sistema cuyos resultados son mediocres en sí mismos, de tener un sistema cuya capacidad de éxito es muy alta.
En cualquier caso, lo había pensado para evitar pérdidas consecutivas, con ello mejoraría sustancialmente el drawdown al menos.
I understand Vonasi.
I guess the overall results would get worse.
Even so, I think the difference is still having a system whose results are mediocre in themselves, from having a system whose capacity for success is very high.
In any case, he had thought about it to avoid consecutive losses, with this he would substantially improve the drawdown at least.
Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums.
Thank you 🙂
Sorry, i dont see the traduction of french language to spanish language.
This is my error.
Because we can never know how the winners and losers are distributed you could get lucky and hit all the winners while real trading and miss all the losers while simulated trading or it could be the complete opposite. We could adjust our criteria for switching too and from simulated trading but this is just curve fitting to the distribution of winners and losers in our back testing data.
I agree with Vonasi. For a well craved strategy, this simulated trade doesn’t seems help much. I was playing around with the simulated trade before, adding short version, adding trailing, but at the end, I see more curve fitting behavior than before. The example of Nicolas looks good because it is a long only version, adding simulated trade, help to avoid some market pull back period, but if you add a short version simulated trade, this change the whole strategy, you starts to miss some trades that were supposed to win, so the result not better.
I get it.
But, even if, I wish I could prove your mistake.
And that all depends on which strategy the code is applied to.
I’m sure it would greatly improve drawdown and time to market without diminishing financial performance too much.
I leave this coding to the users’ wishes, seeing Nicolas’s codes does not seem difficult, but I simply don’t know how to do it
Thank you.
MaxProfit10 = max(MaxProfit,StrategyProfit)
If MaxProfit10 > StrategyProfit Then
Trading = 1
ENDIF
MaxProfit10 = max(MaxProfit,StrategyProfit)
If MaxProfit10 < StrategyProfit Then
Trading = 0
ENDIF
if trading = 0 and not onmarket then
buyprice = close
tradeonmarket = 1
endif
if onmarket and close > positionprice or onmarket and close > high[1] then
sell at market
Maxprofit10 < Strategyprofit = Maxprofit10 < Strategyprofit + (close - buyprice)
endif
if tradeonmarket and close > buyprice or tradeonmarket and close > high[1] then
tradeonmarket = 0
Maxprofit10 < Strategyprofit = Maxprofit10 < Strategyprofit + (close - buyprice)
endif
MaxProfit10 = max(MaxProfit,StrategyProfit)
If MaxProfit10 > StrategyProfit Then
Trading = 1
ENDIF
MaxProfit10 = max(MaxProfit,StrategyProfit)
If MaxProfit10 < StrategyProfit Then
Trading = 0
ENDIF
if trading = 0 and not onmarket then
buyprice = close
tradeonmarket = 1
endif
if onmarket and close > positionprice or onmarket and close > high[1] then
sell at market
Maxprofit10 < Strategyprofit = Maxprofit10 < Strategyprofit + (close - buyprice)
endif
if tradeonmarket and close > buyprice or tradeonmarket and close > high[1] then
tradeonmarket = 0
Maxprofit10 < Strategyprofit = Maxprofit10 < Strategyprofit + (close - buyprice)
endif
This no function!
Tony40 – Please re-read the forum rules before posting again – including the one that says:
- Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.
I have tidied up your post.
See attached image if you don’t know where the ‘Insert PRT Code’ button is.
Regarding your code it would be helpful if you explained what you are trying to achieve with it as the code itself is rather confusing without an understanding of what it is supposed to do.
I don’t know if I understood correctly. What you want is that the system does simulated operations while it remains in drawdown? That is, when a loss operation occurs, would you only operate with real money again if with simulated operations it exceeds the maximum achieved by the system with real money? It seems like a good idea, but I don’t know if it’s possible.
if trading and not onmarket then
buy positionsize contracts at market
buyprice = close
tradecount = tradecount + 1
endif
if trading = 0 and not onmarket then
buyprice = close
tradeonmarket = 1
endif
if onmarket and close > positionprice or onmarket and close > high[1] then
sell at market
equitycurve = equitycurve + (close - buyprice)
endif
if tradeonmarket and close > buyprice or tradeonmarket and close > high[1] then
tradeonmarket = 0
equitycurve = equitycurve + (close - buyprice)
endif
IF StrategyProfit > StrategyProfit[1] THEN
Trading = 1
Endif
IF StrategyProfit < StrategyProfit[1] THEN
Trading = 0
Endif
No function, but it if the begining.
or:
If strategyprofit > maxprofit THEN
Trading = 1
This is the bot to applicate de simulated code.
What you want is that the system does simulated operations while it remains in drawdown.
That is, when a loss operation occurs, would you only operate with real money again if with simulated operations it exceeds the maximum achieved by the system with real money.
Simply, no loss time.