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

TradeStation Volume Strategy Guide

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)
7 views5 pages

TradeStation Volume Strategy Guide

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 3, Lesson 2

TradeStation Walkthrough

Tomas: So, again, in this Module 3 workspace, you have just a couple of indicators on the
left to better understand the concept.

Here you have the testing strategy.

Here you have the optimization code, which we’ll try four different market trends’
volume-based techniques.

And then we have the result code which will be the result of the best technique that
will be found with the testing strategy.

So, let's start here.

Very simple, again, you have an indicator here, based on volume that I already in-
serted with the volume chart here, and we will basically work with two techniques.
First technique will be that we will take volume and we will find the highest volume
and lowest volume on the last 100 bars, and then we will split this range into three
different zones and, again, we will apply different number of contracts for each
zone.

So, in the previous module, we were talking about the underlying chart itself, which
we use to get the range from the open-high-low-close bars for the last 100 bars
back. And, based on that, we establish three different zones.

Here we will use volume to find the highest/lowest one and establish three different
ranges.

And with the second technique, we use moving average of volume, okay?

So it's a little bit similar to the previous module, just the input is different. In Module
2 it was a dependent input, now we're using an independent input; and we will use
this moving average of volume, which we can see here, again to find the highest
value, lowest value, and split into three different zones.

And then we will repeat the same on the daily bar - on daily chart - again like in
Module 2.

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
So we will find the highest-lowest volume within last 100 days, and highest and low-
est volume, moving average of volume, within last 100 days.

Okay, so you can play with this. You have indicators prepared here, just to see and
understand the concept.

And here we have the codes.

So here is the indicator.

So, as you can see, it's basically the same as in the last module, just now the input is
volume, and we find the highest volume based on 100 last bars, and lowest volume
based on 100 last bars.

Again, why hundred?

Because that's the minimum number to give us statistical validity, statistical signifi-
cance. That's what we use in our hedge fund as well. We do not change this num-
ber. It's always 100 to avoid overfitting or curve fitting, so just keep this value 100;
and then we split it into three zones and we basically create three different zones.

The second technique is moving average.

Again, we are using slow period - 25. I recommend not to optimize this. I recom-
mend just fix this to avoid any possible overfitting or curve fitting, and have 25 value
- 25 period - for all your strategies, all your testing.

And then we take the same and use it for daily data, so we have two more tech-
niques, which you can see here in the optimization code.

So in the optimization code, we will work with volume on the main chart - average
volume on the main chart; then we will work with volume on daily data and average
volume on daily data.

Again, same principle like in Module 2, I just took the testing strategy, and then just
copy/paste the testing strategy here, as described.

Here is the strategy itself.

Here is the exit part - the same process I explained in Module 2.

And here I copy/pasted the entry conditions, just adjusted them a little bit:
Copy/paste them three times for Zone 1, Zone2, Zone 3 - and added number of con-
tracts, which will be our optimization input, as you can see here.

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
Again, everything has been explained in Module 2 already, plus this is an advanced
course, so you should easily understand the logic. You can refer to these examples,
compare them, and see exactly what we did.

And now what we need to do again is just insert this optimization code for Module
2, for market strength method, into chart, and optimize and see what we come up
with.

So, again, here in the third window, I've inserted the optimization code, and we do
the same as in previous module - we optimize here technique from 1 to 4.

We have four different techniques for this module, and then we optimize for each
zone - separately for long and separately for short, between 1 and 3 contracts, or 0
to 2 contracts - whatever you prefer.

As default, I use 1 to 3 contracts – from 1 to 3 contracts - in each module in this


course. So we will be optimizing between 1 and 3 for each zone, differently for long
and short.

And, again, do not forget to set 20% data out-of-sample; and, of course, do not for-
get set 100 maximum number of bars back, because we're working with 100 bars
back in the calculation.

I will not run it here because it takes about 40 minutes to run on my slow laptop,
which I'm using for the recording. But I already ran it, and here is the optimization
report.

So, again, we take the report - we choose in-sample only.

Now we use the fitness function which is TradeStation Index, and we have a look at
the first 20 solutions and we see which technique is mostly present in most of the
top 20 solutions. Which is technique 1?

That means direct volume on the main time frame.

We have 1 almost everywhere; just in one case we have technique number 3, but
this is definitely the strongest technique.

And we have a look at the average trade, and the average trade is the highest for
the first one. So definitely we use the first one, the winner from the optimization,
because this one has got a little bit higher net profit, but it's too far away for me.

We have much better here - 1 - so we keep it.

And then we have a look at the chart, in-sample and out-of-sample.

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
Okay, so Strategy Performance Report - let's have a look at in-sample first.

Okay, so this is the in-sample.

And now we need to see reasonable, quite similar out-of-sample, which would look
like a reasonable, logical continuation of this one.

So this is out-of-sample - it's not bad. It's not perfect.

That's why we have more dynamic position techniques.

In the second module, definitely, we saw a better, smoother, nicer out-of-sample. So


this is definitely not a perfect one, but it's been working. We can see that we con-
tinue to have new equity highs.

This technique probably wouldn't be the best for this testing underlying strategy.

Definitely one of the five methods I'm presenting in this course, will probably be bet-
ter.

But still we have a look. It's quite alright, okay?

It's not perfect, but it's quite alright.

And now the solution. So we know the solution is technique 1. And the number of
contracts is 2, 3, 1, for long; 1, 2, 1, for short.

So what do we do next?

We create the result code, which is just basically we strip the original optimization
code and keep only Case 1.

So our input is volume, based from the basic chart, from the main chart.

And then we set up the number of contracts accordingly: 2, 3, 1, 1, 2, 1.

Let me double check.

2, 3, 1, 1, 2, 1 – okay, it matches.

So, that's how we create the strategy - the result code.

And then we, of course, insert it into a separate workspace.

So this fourth, last workspace, is with the result strategy inserted in already.

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 let’s just have a quick look under Equity – it should look the same.

Yeah!

The Equity is the same, okay.

And now let's have a look at results, and let's compare the table.

Okay, so here is the result. So the original strategy: $25,300, net perfect.

After this position sizing method based on markets’ trend - based on volume, on the
main chart - we increased the profit by 157%.

Which is logical, because now we've been working with many more contracts - up to
three.

But surprisingly, we increased the maximum drawdown, close-to-close, only by 14%


from almost 6, or let's say $5,900 to $6,700 - which is a very, very small price.

You know, just like increasing the net profit by almost 160%, while drawdown only
by 14, that's a very, very small price.

And the most desirable metric, which is your net profit/ drawdown ratio - so we had
a jump from 4.3 to 9.3, which is staggering 116%, which is a huge, huge improve-
ment.

You see, guys, we did it in couple of minutes and we have a staggeringly, high im-
provement, positively validated on out-of-sample as well. So now, with just clever
position sizing, dynamic position sizing method, again, we have a very, very high net
profit/drawdown ratio, 9 to 9.3 which is absolutely fabulous. Very, very nice result.

Okay, so that was technique 2. I hope you like this one, because it's fully based on an
independent input, unless you are already using volume in your underlying strategy,
which we are not with the sample strategy. And I'll be looking forward to seeing you
in Module 4.

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