Hello Guys,
Paul, thanks for posting this code. I really like it.
Overall I did a little Analysis and the conditions C1, C2 and C5 are not improving the performance significantly. As Jebus89 already mentioned the strategy is already very profitable by just applying the time condition. In my opinion only rule c3 and C4 adding a substantial surplus which improves the Netprofit/DD ratio.
See the chart attached.
Overall I think it is important not to add too many rules and rise the level of complexity artificially to tweak it until the maximum.
C2 I agree with you. C1 is important. C5 improves a bit.
I tested also on EURJPY with a few changes in the parameters. Profit factor 1.55, so a little too low so far in order for me to test it live.
Using the same time in eurJPY as well? I thought i tried that without good results?
Im running this live using 1 contract just to see what happens, the max DD is so low so its no worries for my account.
Im using all the C rules, but as mentioned by me and other i think im going to review them a bit more and remove the not important ones as stated in earlier comment.
Condition C5 lowers the number of trades and drawdown. Without the condition drawdown is still acceptable. It could be interessant to test other filters that condition C5.
Overall I did a little Analysis
Very interesting, thank you! Not seen this done before.
- Did it take long?
- Is it an analysis you do on other Systems or a first time one-off?
- If not a first time … are results generally similar to findings on the link above?
I’m trying to test the strategy with long trades. The results aren’t as good as short trades. Trading hours between 18h and 20h (UTC+2) improves a bit the strategy and maintain a smoothed equity curve. I’ve only made a test with 100k data. Do you still have an improvement with 200k data?
DEFPARAM CUMULATEORDERS = false
CtimeAchat = time >= 180000 AND time < 200000
//LONGS
if time=200000 then
level=low[1]
endif
c1= close > dopen(0)
c2= low > dlow(1)
c3= level < dhigh(1)
c4= level < dhigh(2)
bu= BollingerUp[20](close)
bd= BollingerDown[20](close)
ba= (bu+bd)/2
c5= ba>ba[1] or low < bu
if CtimeAchat and c1 and c2 and c3 and c4 and c5 THEN
buy 1 contract at market
endif
if LongOnMarket and time=200000 THEN
sell at market
endif
set stop %loss 0.5
Sometimes I will have an optimized variable such as ‘c’ which is used purely to select a set of conditions to use in the back test. This way it is easy to test every possible combination side by side to see which ones have the most benefit. With a lot of conditions it can result in a lot of options but once you have the code then it is a simple thing just to change the c1, c2, c3 conditions to whatever your latest idea uses and paste it into your new strategy.
Something like:
//c = 0 //optimized variable
c1 = open > close
c2 = open > high[1]
c3 = open < low[1]
if c = 1 then
condition = c1 and c2 and c3
endif
if c = 2 then
condition = c1 and c2
endif
if c = 3 then
condition = c1 and c3
endif
if c = 4 then
condition = c2 and c3
endif
if condition then
buy 1 contract at market
endif
I started the algo live now but only 1 contract.
More fun to run it live than on demo.
DD with 1 contract is only 245 dollar..
Im running this live as well with 1 contract barney. lets goo
select a set of conditions to use in the back test.
I added above code to here
Snippet Link Library
Running it live too since yesterday. Watching it a bit, I think working on the 5min instead of the 15min (or MTF), and working with limit orders instead of at the market may improve the results. Will try
I’ve got 2 versions (Paul and Paul / Stefou) running on Demo Fwd Test. but not had a trade yesterday or today.
Anybody had trades yesterday or today?
yes me. both days. a small profit and a small loss
PaulParticipant
Master
The breakeven is a pain to quickly test 200k bars.
An alternative can be to close the position when the Bollingerbands distance are getting smaller.
bu= BollingerUp[20](close)
bd= BollingerDown[20](close)
ba= (bu+bd)/2
br= (bu-bd)
if shortonmarket and time=141500 and positionperf(0)*100<0.3 then
exitshort at market
else
if time> 141500 and br<br[1] and br[1]<br[2] and br[2]<br[3] and br[3]<br[4] then
exitshort at market
endif
endif
Found this quick, perhaps there’s room to improve without a breakeven!
Small one, lower the entrycriteria for the bollingerbands, and use previous bu, instead of the current
c5= ba<ba[1] or high > bu[1]
Hi Grahal,
- It can be quick if one prepared everything on Excel already. There you just need the final result from each added condition
- I just read it in the book (trading systems a new approach to system optimisattion from Jaekle/Tomasini) Was the first time I did it and will continue do to so for future optimisations
Overall I can only recommend to read that book for systematic trading, especially how to optimise
Same is true for the book “Kevin Davey – Building Algorithmic Trading Systems”