0% found this document useful (0 votes)
12 views5 pages

TradeStation Volume Analysis Techniques

Uploaded by

ef1402
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views5 pages

TradeStation Volume Analysis Techniques

Uploaded by

ef1402
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Module 5, Lesson 2

TradeStation Walkthrough

Tomas: Here we are.

That's the workspace for Module 5 and let's start here.

So, as you can see, below the main E-mini Dow Jones 20 minutes market, we also
have $UVOL 20 minutes and $DVOL 20 minutes, which are like two additional mar-
kets added to the chart - $UVOL, $DVOL.

And here there are two ways how to operate with this information.

$UVOL or $DVOL alone, as a stand-alone information, is not much of a help, okay?

What we need to assess is the relationship between these two to see what's the
winning power in each given moment, on the market as a whole. If it's the volume
on upside, or the volume on downside. And we have two ways to do that, and that's
either the difference between $UVOL or $DVOL; or the ratio between the $UVOL
and $DVOL.

Both are very, very important and very powerful ways to assess your $DVOL infor-
mation, and both will deliver different results with Dynamic Position Sizing.

So, if we have a look at the code, you can see that this is what we do. We either cal-
culate the difference, that means Close of data2, which is $UVOL minus Close of
data3, which is $DVOL; or we calculate a ratio - that means $UVOL divided by $DVOL
or $DVOL divided by $UVOL, so we can get the ratio.

And then we just do the same thing we did with the previous inputs already. We
split them into 3 zones on last 100 bars or last 100 days.

And we, again, get three different zones to work with for different position sizes.

So back to the indicators. The first one is the difference. So, this cyan color is the dif-
ference between $UVOL, $DVOL. And, again, we take the maximum, minimum, and
split the difference into three zones.

Page 1 of 5

(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
And here the second one is the ratio. So, we take the ratio, we have a zero line, and
we have a negative ratio or positive ratio. And then we again set up the maximum
and minimum and see where we are at each given moment in which zone - we sepa-
rate into three zones.

And you can see with just a glance that the behavior of ratio or difference is quite
different, okay?

So, you can definitely have substantially different results with the difference be-
tween $UVOL, $DVOL, as well as with the ratio. This will work differently with defi-
nitely different results.

Okay, so I hope this concept is clear to you.

Again you can use the indicators. Have a closer look to understand it better, but I
think it's quite straightforward, quite easy to understand.

And here we have the Optimization code again.

So, first of all, notice that now we are using seven different inputs because we need
to use $UVOL, which will be the same time frame like the underlying market for the
strategy - the main timeframe; then we need $DVOL - the same timeframe as the
underlying market; then we need $UVOL with daily data, and $DVOL with daily data.

Again, do not forget that we need to use local time.

And we have four techniques. So, we have $UVOL, $DVOL difference on the base
chart, base timeframe - which we again use 100 bars back; then we have the ratio
calculated from the same timeframe as the underlying base chart; and then we have
the difference on daily data and the ratio on the daily data, which, again, is super
independent.

We have daily data plus completely independent input, that's already a super inde-
pendent way to use for assessing the proper position sizing, the proper dynamic po-
sition sizing. So, especially 3 and 4 – again, very, very powerful way, very powerful
combination.

And, again, we stay with 100 bars or 100 days back. We do not change this at all.

As to the rest of the code, you already know everything from the previous modules.

Erase our strategy. Here is the changed part with the position sizing and here is the
exit part.

So, you know this from previous modules. I'm not going to go back to it.

Page 2 of 5

(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
Now let's have a look at the optimization.

So, you see we have many charts here right now - many data streams. The main
one, the second one.

If it's used by your strategy, then we have the daily data of the main one. Then we
have $UVOL, 20 minutes, which matches the main chart; $DVOL, 20 minutes; and
then we have $UVOL daily and $DVOL daily.

You see that all of them need to be in local time again, so if your strategy works with
time, you need to adjust that time to your local time.

So, for example, in my time, the markets open 3:30 - or indexes - this one E-mini
Dow Jones opens 3:30 pm.

Normally, in Chicago, I think it's 8:30 or 9:30 am; but here in Spain it is 3:30 am, so if
I would use time template or time filter, I would need to adjust that time filter for
local time, and then I need to have local everywhere so I can combine these data
feeds in TradeStation. Very important.

And you know the rest already. It's quite easy. So, again, we optimize four different
techniques, 1 to 4; and then for each zone, different number of contracts between 1
and 3, or between 0 and 1 - differently for long, differently for short.

And, again, this takes about an hour on my laptop, so I did it already and here's the
Performance Report.

Oh, sorry, not the Performance, but the Optimization. Let me get back - view Opti-
mization Report.

And you already know that the first step is to choose in-sample only. Now we need
to sort it by the fitness function, which is TradeStation Index.

And now if we have a look at the top 20, we can see that number 3 is the most com-
mon one. One, two, three, four, five, six, seven, eight, nine, 10, 11 occurrences.

So, we definitely use Technique 3, which is $UVOL, $DVOL difference on daily chart.
So that’s super independent: we have daily chart, plus independent input.

And the average trade, it's okay - I would say. We could also test the second one as
well because we do have some occurrences for number 4, okay?

So, we have here and here and here.

So, it would be totally okay to choose between both of them, okay?

Page 3 of 5

(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, let's have a look at both of them. Let's have a look at number 3 and number 4.

Actually, the first one and second ones got definitely higher, average trade. And it's
got also reasonable number of occurrences in the top few solutions. So that's quite
alright if we have a look at both.

So, Performance Report for the winner, which I would prefer - I like keeping stuff
simple. So, this is the in-sample and….

Oh, we don't have our out-of-sample because of optimization. I think I didn't run it
with out-of-sample, did I?

No, so we only have a combined report.

Okay. Sorry, so - actually no, it's something I definitely, definitely this one - definitely
the Optimization Report is different for in-sample, and different for out-of-sample.
So, I'm not really sure why we cannot see differently in-sample.

Oh, we can now. Okay. Sorry, so it was some mistake in TradeStation. So here is the
in-sample and let’s look...

Oh, sorry guys, I have no idea what's wrong here. Something with TradeStation.

Anyway, you can perform this yourself, from what I did before. If this approximately
would be out-of-sample, it's still okay. So, no worries here.

If we have a look at number 4, then we had - we get this equity. It is a little bit uglier.
Again, no sample out-of-sample here. I don't know why. I'm not really sure, but you
can do this on your own, okay?

You can just run your optimization - which I definitely recommend - and see your-
self.

And from what I remember, the out-of-sample here was okay as well. So definitely
both - both versions would be applicable: Number 3 or number 4.

And what I've chosen as a winner was Technique 4, which had a higher average
trade but, again, you could use both of them, number 3 or number 4 – it’s up to your
preference.

So here is the stripped code - the final result code. Again, just download it, have a
look, compare it.

Page 4 of 5

(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
And with Technique 4, which is very, very independent - it's daily data and it's Mar-
ket Internals ratio - yeah, that was the ratio - not difference but ratio - we would
have these results.

So, pretty steep increase in net profit by 126%. And also, pretty steep jump in maxi-
mum drawdown, which is definitely quite a lot already. The ratio has been improved
very slightly, by 33% only, but it's still an improvement and please do not make any
conclusion or judgement just based on this specific case, because it will always be
completely different with each strategy.

So, with this particular testing strategy, results with Market Internals are on the
poor side, but with a different strategy it can be the best winning technique. No
judgement, no conclusion here. This is just for the sake of an explanation to show an
example. We still had some improvement, but it definitely will be very different with
different strategies.

Actually, let's also have a quick look on the strategy which used the Technique 3.
That was this one. And let's have a look if we get better results here.

So, with this one, number one, number two - the number one is Technique 3, which
is okay - as I said, you can use both them. With this one, we would make $50,000
and the drawdown would be $4,500. Wow, that's a very, very nice ratio.

So, 50 and 4.1, so that would be 11 - ratio. Wow. 11:1.

So, with this technique - then we probably choose this one - also the equity is
smoother and better – so the ratio with this one, the first one, will be 11:1.

So, then the improvement would be definitely much higher - over 100% with the ra-
tio.

But, again, no conclusion here. This is just an example. You need to try it yourself.
Just run your own tests, use this workspace, these codes - run your own optimiza-
tion and have your own results.

Okay, so don't forget: in-sample; first 20; TradeStation Index; and pick the first or
the second one and see for yourself.

Anyway, you can see that $UVOL $DVOL Market Internals, both difference and ratio,
can be very powerful, especially on daily chart. Test it with your own strategy, or
strategies, because you will have different results with different techniques, and I'm
pretty sure that you'll see some very, very nice results as well.

Okay, so that's all for Module 5, and I'm looking forward to seeing you in Module 6.

Page 5 of 5

(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

You might also like