Home › Forums › Trading System Mentor Course Community › Real Test Software › Stress Testing
- This topic is empty.
-
AuthorPosts
-
December 30, 2022 at 5:35 am #102252AnthonyFuentesMember
Hi everyone.
I want to do some stress testing in RT using what I learned in the course and using AmiBroker. In the mentorship course we learned stress tests such as randomizing trade selection within a sequence, increasing signal variance, and data variance (closing price).
It would be great to hear what some of you are doing in RT for stress testing. If you could provide code examples that would be great!
December 30, 2022 at 9:34 pm #115330Nick RadgeKeymasterAnthony,
I haven’t progressed that far as yet but will chat with Marsten.December 30, 2022 at 11:28 pm #115331BenOsbornParticipantHi Anthony,
Entryskip is one you could try. “A good use of EntrySkip is, for example, EntrySkip: random() < 0.05. This would randomly skip about 5% of entries, e.g. to simulate not being able to borrow shares to short. By running this same test a number of times we can see the probable range of how this would impact the stats of the strategy."
You could also change SetupScore to random() in your MOCs and and then run a number of times. This could also be done with EntryScore in other systems.
To run the tests a number of times go to optimize and there is a box to select the number of test iterations.
December 31, 2022 at 12:12 am #115336BenOsbornParticipantThis got me thinking of other things to try. For a MOC system, you might try and vary the low since the limit order for the next day is based off this. I added the following to the data section:
RLow: random(L*0.96, L*1.04,0.01)
Then changed entry limit to:
EntryLimit: RLow – Stretch
I’m no expert in RT but I compared the trade lists of a few iterations and the entry prices were different when the trade was picked up by both iterations.
December 31, 2022 at 7:19 am #115340JulianCohenParticipantI use the entryskip random method…if the strategy works with a random number of trades skipped then it is robust for me…that removes the possibility of a few big trades making the numbers up.
Ben I like the idea of randomizing the low
I also randomize some of the parameters and set it to run 200 times to see how this affects things
January 1, 2023 at 10:48 pm #115332AnthonyFuentesMemberThanks Ben and Julian. Here’s what I am working with now.
For EntrySkip I setup something like this to check various percentages to see the effect they have on the system.
Code:Parameters:Code:RandomSkipVal: from 0.05 to 0.25 step 0.05Code:Strategy: MOCCode:EntrySkip: Random() < RandomSkipValThen I run 10 iterations of each test to check the variances.
For signal variance, I’m doing something like this:
Code:MAPer: 200*Random(0.75,1.25,0.05)Code:Uptrend: C > MA(C, MAPer)The random low is a great idea as well. This test shows me that if my system starts taking too many trades, the performance suffers as it ends up taking poorer quality trades.
Your random low example could be used as well to change the closing price, similar to the way we were showed in the course. To do that I added the following:
Code:Data:Code:ClosePrice: Random(C*0.95,C*1.05,0.01)And then added that to any parameters where I’m setting closing price, like this:
Code:Uptrend: ClosePrice > MA(ClosePrice, MAPer)EDIT: It looks like the forum doesn’t support the code tags.
January 2, 2023 at 12:22 am #115363TrentRothallParticipantHi All
I adapted the course info on data variance to the code below. I then used the value of RC to adjust things like MA, ROC, ranking etc. this just changes the closing price by a maximum of 2.5% in the case below. That might be a bit extreme but you can adjust as you see fit.
I just put this at the top of my data section in any stress testing scripts
edit: I just saw you’re doing similar anthony.Code:
RandomPercent: 2.5 // Adjust Close by this much %
perc: RandomPercent/100
RandomClose: C * (1+(perc-Random()*(perc*2)))
RC: RandomClose // replace C in calcuations to RC
January 2, 2023 at 12:34 am #115355TrentRothallParticipantI think using entryskip only skips trades that have passed the ranking. Not that this is a bad thing but it won’t simulate taking any trades that are outside of your ranking criteria.
For example if you are filtering setups to find the top 20, if you use entryskip: it doesn’t replace the 20th set up with one outside of the ranking.
Not so much of an issue for short-term systems probably but I have found this isn’t really an effective way for rotation systems because you are missing a trade every month. Similar for trend systems
-
AuthorPosts
- You must be logged in to reply to this topic.