Split of Capital across a Portfolio in ProBacktest environment ?
Forums › ProRealTime English forum › ProOrder support › Split of Capital across a Portfolio in ProBacktest environment ?
- This topic has 5 replies, 4 voices, and was last updated 3 years ago by
Nicolas.
-
-
08/23/2022 at 3:49 AM #199444
Hello, Ladies and Gentlemen,
I wish that this message finds you well and prosperous.
Let me first precise that I’m new to the ProRealTime community, and maybe my query is posted in a wrong place of this forum.
Should this be the case, please accept my apologies for I have broken some rules inadvertently, and kindly redirect me to the appropriate section.
To the point now.
I’d like to test extensively through the ProBacktest module a strategy I have coded.
To keep things simple, the total theoretical capital I’d like to put in use is $100,000.
In an aim to diversification as well as all-terrains testing, I’d like to apply this strategy to, say, 30 instruments picked into different markets ranging from currencies to commodities, going through indexes (neither stocks nor cryptocurrencies will be part of the session : my system is not suitable to such instruments).
Each instrument selected to be subject to test would therefore virtually receive and allocation of $100,000 / 30 instruments = $3,333.
So, my (maybe silly) question is as follows.
How am I supposed to :
A) Fill the “Initial capital” field of the ProBacktest window before I hit the “ProBacktest my system” button ? Should I input $100,000 or $3,333 ?
B) Input the value assigned to the amount to be traded within the “Creation by programming” window dedicated to the Code ? Should I input : Capital = 100000 or Capital = 3333 ?
In fact, this is not really a big deal when it come to test the strategy piece by piece, since each instrument can be tested on its own with whatever desired parameters, even though it will only give some twisted idea of the big picture put together (the whole is not necessarily the sum of its parts).
But it may become an issue when the 30 instruments are later launched all together within the Automatic Trading playground.
I mean, at this second stage, if I have previously input $100,000 and Capital = 100000 at step A) and B) respectively for each instrument targeted, will the system automatically split such capital into 30 tradable units being part of a whole ?
Or will it consider that I have 30 x $100,000 to play with when I launch the Automatic Trading test session for 30 instruments simultaneously (which I presume shall result in the ProRealTime platform to reject 29 of my attempts out of 30 since the paper trading account is capped to $100,000 anyway) ?
Moreover, as you have certainly guessed already, answer to this question is paramount to define the Risk applicable to each trade (i.e. a Risk of, say, 0.5% applied to $100,000 has nothing to do with the same amount of risk applied proportionally to $100,000 / 30).
Finally, this parameter is also important with respect to the sufficient capital required to trade certain instruments, as well as from a required margin standpoint, not to talk about the spread (especially when it applies to lower timeframes).
Thanking You in advance for the assistance you’ll kindly provide to a newbie, I’m looking forward to hearing from you soon on this matter.
Kind Regards,
MF
08/23/2022 at 10:29 AM #199452A) $3,333 as all strategies are unaware of any other running strategy, so you have to hard code the capital for EACH strategy.
B) same as A).
08/24/2022 at 3:14 AM #199496Hello, M. Gozzi,
Thank You so much for your swift and straight to the point answer on my query.
That’s more or less what I was suspecting after I played around with ProRealTime for a couple of days : since the backtests are so to speak processed in silo mode, it’s not possible to test a strategy over a portfolio as a whole…
By ways of extension, this means that any strategy test with an instrument has to be treated as if it was performed over a separate trading account with no possibility to mutualize neither the gains, nor the losses, across the portfolio.
Conclusion : the many “little separate trading accounts” may well run belly up very quickly if the risk level acceptable to the whole portfolio is applied to them individually, without having the possibility to be backed up by the full portfolio equity (0.5% out of $100,000 represent 15,00% out of $3,333 : I have not heard yet of any stand-alone strategy capable of supporting such a risk burden very long !).
On the opposite, if one wants to go this way, one can apply 0.5% of risk to each “little separate trading account”.
Let’s do the math again : we then find out that 0.5% out of $3,333 represent (rounded) 0.017% out of $100,000, which is quite acceptable to the full portfolio (to say the least !).
… But with such a low level of commitment, I doubt that one will book many profits, except if the objective is to become rich after 1 century or 2 if one’s lucky, and if the R/R Ratio of the whole strategy is actually greater than 2 over the long haul (in fact, 3 or higher : a common misconception is that a 1:2 R/R Ratio is fine to net good money on the markets. Bad news is that a 1:2 R/R Ratio is most of the time barely enough to cover the trading costs only : slippage, swap, commissions, taxes and miscellaneous account maintenance fees inclusive, and to buy a coffee and a donut at the end of the day…).
Conversely, losses will feel like ant’s bites to the scale of the whole capital. Only good point, I’m afraid !
All this boils down to say that, in my humble opinion, backtesting whatever strategy in the ProRealTime environment is sheer waste of time (especially if one considers the amount of time it takes to code properly any system a bit tricky), since by no means will the outcomes be a reflection of what real-life trading might throw at the aspiring trader.
Additionally, and apart from the specific point addressed in this topic, I have noticed that with ProRealTime, it is possible to trade contracts only to the level of integer numbers, 1 being the minimum size in backtesting.
This is a major showstopper for those like me who favor volatility-based stops (ATR-linked or Standard Deviation-linked stops for instance) over fixed position sizes.
Such a method, flexible and fit to the always changing market conditions, gives position sizes to the level of decimals when some formulas like PositionSize = (Equity * MaxRisk) / (StopLossInPoints * PointValue) are applied to tune the size of the position for every trade.
Only exception is when the “round” function is used in case of trades on the crude oil and the likes, which require the positions to be integers.
Well… Enough whinnying for now !
The bottom line is that, for all those reasons and some others more (Ah ! These backtests that are running in the tested instrument’s currency only, and within which it’s not possible to set the Initial Capital parameter in USD to then ensure that the backtest of the whole portfolio is cohesive ! And what to say about the swap parameter, which is one of the variables to be taken into account absolutely in any well-planned strategy ? This one is nowhere to be found within the ProBacktest environment as I have studied it so far), I think that I won’t continue with ProRealTime much longer…
Maybe I’ll give a try to the competition… Or simply go back to my old mule (MT4, not to name it, is full of flaws and bugging nick-nacks, but I feel at home in it) !
Whatever, I wish All The Best to you, and have safe and good time in the markets,
Kind Regards,
MF
08/24/2022 at 7:37 AM #199497Additionally, and apart from the specific point addressed in this topic, I have noticed that with ProRealTime, it is possible to trade contracts only to the level of integer numbers, 1 being the minimum size in backtesting.
ProRealTime allows to trade any contract size. It’s the broker who may set some limits. You have to check with the broker to find out that limit for the instrument/asset of your choice, as it’s a specific value.
08/24/2022 at 9:49 AM #19950730 instruments simultaneously
Why not try 3 instruments simultaneously, then increase if all is going well?
Or if you a determeined to jump in with 30 at once, then set up alerts to your phone when positions are opened / closed and monitor accordingly?
If your Algos are diversified how many (out of 30) trade simultaneously on Demo over a period of 1 month? This would give you a realistic evaluation of how risky your portfoilo is?
09/06/2022 at 8:55 AM #200224You can round in decimals, so you can code any lot size based on your ATR calculation:
1size = round(variable,decimalquantity) -
AuthorPosts
Find exclusive trading pro-tools on