Bonus #1
The ‘DPS Smart Code’
Tomas: Okay, so congratulations. You have just successfully finished the Dynamic Position
Sizing Programme for Advanced Traders. And that's amazing, and I really hope you
liked and enjoyed everything that you have just discovered in this unique, one of its
kind, programme.
Now we will cover the bonus. We will talk about the bonus part, which is Dynamic
Position Sizing Smart Code. However, if you have not watched the entire course first,
please do so.
Please, if you, for any reason, started with this bonus, just go back and watch the
entire programme first. It's very important. First of all, you will probably not under-
stand a lot of important nuances and things that we have covered in previous mod-
ules; second, I will go pretty quickly through the Smart Code, as I assume you have
watched all the six modules already, and you are very familiar with what we have
done and how we did things through these six modules.
So please, do not start here. Go fully through the entire programme first. Do your
homework and then move to this last part covering the Smart Code.
All right, so here's the disclaimer as usual, and let's get directed to TradeStation.
So the Smart Code is really a compilation of all the techniques that we have covered
within the six modules of this programme. Now, you did already get kind of a small
Smart Code with each module. Each module already contains a mini Smart Code for
Dynamic Position Sizing methods related to each given module.
But this one, it's all of them together, compiled into one code.
Because there are all the techniques at the same time, there are some specifics first.
So, you will need to use nine different data feeds, okay?
You will need to use your main strategy timeframe. If you use a second timeframe in
your strategy, then your second timeframe; if not, just use the same as for DATA 1.
Page 1 of 7
(c) 2018 [Link] / Distribution without author´s approval is not permitted.
TRADING INVOLVES A SUBSTANTIAL RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS,
PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS
Then you will need your strategy market daily timeframe for computation and back-
testing of some Dynamic Position Sizing techniques, which do need to access daily
data of your underlying market.
You will need VIX - actually VXB.X - Volatility CBOE Index we covered in Module 4 -
same like your main timeframe and also daily.
You will need $UVOL, $DVOL Market Internals inputs we covered in Module 5 - you
will need them on daily data as well. That will be data feed 8 and 9.
So you will need eight different data feeds.
And everything will need to be set in local time zone. You know the reasons already
because we have covered them in previous modules. So you should know everything
from the previous modules already.
And that's basically it.
So here in the call we have a couple of inputs.
So first we need to set up your strategy - local session start and local session end
time, which we covered in Module 6. So you should be familiar. And your
timeframe.
That's for Technique 19 for time-based Dynamic Position Sizing.
And then you have 19 different cases built in the Smart Code: First 6 for the first
group - that means market contraction/expansion-based Dynamic Position tech-
niques.
Second group, the markets’ trend-based.
Third group, volatility-based.
Fourth group, Market Internals-based; and fifth, is time-based.
And for each, you have three different zones for long, and three different zones for
short. Again, something you do know already from all the previous modules, so
nothing new.
And here is the code with all the 19 Dynamic Position conditions, and how it works
with your existing strategies is the same way as I've already covered in previous
modules.
Page 2 of 7
(c) 2018 [Link] / Distribution without author´s approval is not permitted.
TRADING INVOLVES A SUBSTANTIAL RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS,
PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS
Again, this is an advanced course, so it should not be problem for you at all, but you
basically take the strategy - this is our testing strategy - and you copy/paste anything
before the entry conditions, here. Insert your strategy code here.
Then you copy/paste your entry conditions here, but you need to edit them slightly
based on this example and copy/paste them three times for each zone separately.
Again, we have covered this in previous modules already. It's still the same thing,
same principles. So very easy - just compare the examples I did here, how I just
copy/pasted this, put it here, and just edit the number of contracts input.
This part: Contract zone 1; contract zone short 1; contracts - and copy/paste into
three different zones - for Zone 1, zone 2, zone 3.
And change, for each zone, the input, which is the input from the very beginning -
from here.
So again an advanced course, should be easy for you to understand already. And
then all the exits, or anything after the entry conditions you have in your code, it
goes here.
Okay, so, again, study the example here. It should be very, very easy.
And then you simply go to the TradeStation, okay?
And you do basically the same thing we did in previous six modules. So you use this
workspace where we have all the nine charts already.
Okay, so we have nine different charts. All of them are local time, okay?
So you can mix different data feeds, especially Market Internals. We have VIX - CBOE
VIX for futures, and we have $UVOL $DVOL for Market Internals.
And then you do classical optimization. The same thing you already know from
Breakout Strategies Masterclass.
So, here, insert the start session, local time for your strategy; end of the trading ses-
sion, local time timeframe.
And here you optimize 1 to 19 - 19 different Dynamic Position Sizing techniques.
And then for each zone, differently for long and short, you optimize either between
1 to 3 contracts, or between 0 to 2 contracts; or you can also do, like, 2 to 6 con-
tracts, step 2; or 3 to 9 contracts, step 3 - just like this.
Okay, so it’s quite easy.
Page 3 of 7
(c) 2018 [Link] / Distribution without author´s approval is not permitted.
TRADING INVOLVES A SUBSTANTIAL RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS,
PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS
Then you run the optimization. You always run it with 20% out-of-sample as we
have covered in all the previous six modules. So, again, if you have not watched
them yet, start with all the previous six modules.
And then we have a look at the Performance Report, and just see which is the win-
ning one.
And then we copy/paste - we do the final strategy with that particular condition
only.
So I really want you to do your own test, but in my test, let me show you the result.
So, in this case, the best one was condition from the higher picture advanced market
contraction/expansion DPS techniques.
So do the very best one from all that 19 for this particular testing strategy, it was
number 5, which was the average close of DATA2. So it's a dependent function, and
that's the only one we keep.
We delete all the other ones and that's, basically, our final strategy.
Again, we have covered this in all the previous six modules. This is just a summary.
We'll still keep doing the same thing.
So that would be the winning one. So the winning one is here - the second window.
That’s the winning one with the Case 5.
Okay, and that's basically it. So you see there is nothing different from what we have
already covered. It’s just we have more conditions now.
But what I have here for you now, it's a small surprise. So let me show you.
Okay, so in the first module I shared with you already that you should never use
more than three zones for Dynamic Position Sizing.
Why?
Because there are quite a lot of dangers, and we have covered all the dangers in
Module 1. So if you need a reminder of them, just go back and watch Module 1 first.
But, in general, I highly do not recommend more than three zones. In our hedge
fund we never use more than three zones - for a lot of specific reasons covered in
Module 1.
Page 4 of 7
(c) 2018 [Link] / Distribution without author´s approval is not permitted.
TRADING INVOLVES A SUBSTANTIAL RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS,
PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS
But I shared with you in Module 1, what we sometimes do is use only two zones in-
stead of three zones.
And that can be quite powerful.
We do it in just a few cases. Mostly we use three zones, but sometimes we use two
zones, and that's something I just felt would be fair to include here as well in this bo-
nus.
So, if you want to, you can try two zones as well.
So I included a special Smart Code – it’s this one: DPS Smart Code 2 ZONES - which is
for two zones only.
So here you still test all 19 techniques, but you have two zones only for long and for
short. And you only test 1 to 2 contracts, or 0 to 1 contracts for each zone.
So it's simplified.
It's reduced to two zones only instead of three zones, okay?
So you can see that, here in this part with the entries, we have current zone, 1 or 2
only. That's one main difference.
And then here we have computation of two zones only instead of three zones only.
So this special code calculates two zones with 1 to 2 contracts. Again, the rest of the
principle is the same. You already know where to copy/paste your strategy.
Here you copy/paste the strategy before entry orders; here you copy/paste your en-
try orders and adjust them accordingly to this example. It should be very easy. We
went through this a couple of times in previous modules.
And here you copy/paste anything after the order – entry orders.
And that's what I added here into this third window.
So in this third window, you have a strategy for two zones, okay?
So basically what you do here - here you still optimize 1 to 19, but here you optimize
only 1 to 2, 1 to 2, 1 to 2, 1 to 2.
And I did already run an optimization for you here to show you the results so we can
go through it together.
Page 5 of 7
(c) 2018 [Link] / Distribution without author´s approval is not permitted.
TRADING INVOLVES A SUBSTANTIAL RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS,
PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS
So here's the Optimization Report. And basically everything stays the same as we
have covered in previous modules.
So first we go in-sample. Then we sort by our fitness function, which should be the
same fitness function - always the same one - you used for your strategy develop-
ment.
And, in this case, it was TradeStation Index and we sorted according from highest to
lowest.
And now, let's just have a look again at, let's say, top 20 and we can.....
Usually what I recommend is choose some solution within first three or four, which
has got the most, or a reasonable amount of occurrences, within top, let's say, 20.
So, 15?
We do have 15 one, two, three times in top 20. So it suggests it's quite a robust solu-
tion.
And 6 - we have one only one time, so I would rather stay with 15.
And 17 - again we only have once.
So 15 - solution 15 - for two zones seems to be quite well. I like this one. So I would
go with this - number 15.
So now we have a look at Performance Report. In-sample first. In-sample.
In-sample for number 15, and out-of-sample - oh, it looks like I have lost – because I
had to close TradeStation and open and it again and it looks like I've lost what saved
there – in-sample and out-of-sample.
So let's assume something like this was the out-of-sample. So you need to try your-
self but, basically you validate in-sample, out-of-sample, as we went through many
times in previous modules. I did this already. I showed you already a couple of times.
And that's the solution you use.
So, for two zones, we would use Solution 15, which would be Market Internals dif-
ference based on the main chart.
And then you just need to strip the whole code, keep number 15 only. Adjust the
data feed number accordingly - update that because you will have only two or three
data feeds after that - you don't need all nine of them for the final strategy. And
that's basically it.
Page 6 of 7
(c) 2018 [Link] / Distribution without author´s approval is not permitted.
TRADING INVOLVES A SUBSTANTIAL RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS,
PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS
So you will have two zones, and for Zone 1 long, you will have 1 contract; for num-
ber 2, 2 contracts. And for short to you will have 1 contract for each zone.
That would be the best solution.
And now we have $50,000 profit and about $6,000 drawdown.
I think we had better net profit/drawdown ratios in the programme with other tech-
niques, with three zones. So I think three zones probably will work better in most
cases, but it's a pretty good ratio as well. We definitely got some very nice improve-
ment here and you feel free to test two zones with your strategies as well.
So it's just a small surprise for you - small additional bonus.
Again I highly recommend to start with three zones and stay with three zones
mainly, but it's okay, and feel free, to experiment with two zones as well. We use
only two zones sometimes, in minority of cases, in our hedge fund as well.
Okay, so I hope it's clear. I hope we covered everything. Again, this is just a repeti-
tion – this is just a summary of what we already did in previous modules. So if you
did not watch the first six modules first, go back please - watch them. And then eve-
rything should be very clear to you. It's still the same principle. You should espe-
cially know simply how to do that after the Breakout Strategies Masterclass where
we also use Smart Code and go through similar principles.
All right, so that's really all. I hope you have enjoyed this programme. I believe you
will have some true breakthroughs with Dynamic Position Sizing. It's a huge thing for
me in my hedge fund. It's really a big thing that can definitely push your trading to
next levels. Have fun with that. Test your strategies as much as possible with them
and happy trading.
Bye - it's Tomas here.
Page 7 of 7
(c) 2018 [Link] / Distribution without author´s approval is not permitted.
TRADING INVOLVES A SUBSTANTIAL RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS,
PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS