Triple Moving Average Experience

Discussions about the testing and simulation of mechanical trading systems using historical data and other methods. Trading Blox Customers should post Trading Blox specific questions in the Customer Support forum.
Ghost11365
Roundtable Knight
Roundtable Knight
Posts: 112
Joined: Wed Jul 31, 2013 3:33 pm

Post by Ghost11365 »

Thanks Jake - makes sense. Hoping you can help with this question. I'm having a difficult time understanding why risking 1% vs. .1% per trade would result in CAGR not being the same everything else held constant. The statistics on both tests are almost identical with the exception of CAGR and ending equity.
Jake Carriker
Site Admin
Site Admin
Posts: 1493
Joined: Fri Sep 12, 2003 10:32 am
Location: Austin, Texas

Post by Jake Carriker »

The "resolution" of the position is different. Say you have a risk budget of $10,000,000 for a given trade, and the position size comes to 9999 contracts/shares. If the account is smaller or the percentage risk is smaller, such that the risk budget for the trade is $10,000, then the position size will not be 9.999 contracts, but either 9 contracts or 10 contracts depending on the exact rounding function used in the sizing logic. The minimum lot size (often 1 share or contract) limits the resolution of the position, resulting in a different percentage return based on a different ratio between the account equity and position size amongst two otherwise identical trading simulations. This simulates reality, in that it shows you the differences you could get based solely on having a different bet size or account size.
Ghost11365
Roundtable Knight
Roundtable Knight
Posts: 112
Joined: Wed Jul 31, 2013 3:33 pm

Post by Ghost11365 »

thanks. Also if when using 1% risk starting w/ $250k say your first trade requires $50k of that starting equity. will the subsequent security also riks $2500/trade (250k * 1%) or will it now use $2000/trade (200k * 1%)? and so on. thanks.
Jake Carriker
Site Admin
Site Admin
Posts: 1493
Joined: Fri Sep 12, 2003 10:32 am
Location: Austin, Texas

Post by Jake Carriker »

All trades will size based on equity when the order is generated and the unit size script is called. That is typically the same amount (the latest day-end equity) for all orders for a given bar.
Ghost11365
Roundtable Knight
Roundtable Knight
Posts: 112
Joined: Wed Jul 31, 2013 3:33 pm

Post by Ghost11365 »

rhc wrote:The '500' figure simply converts the point value of Cotton to a dollar value since the value of 1 point in Cotton is $500

For stocks there are no conversions necessary since stocks are already priced in dollars.

Example;
Todays close in ABC corp. = $55.55
Todays 20 period ATR = $1.55
ATRMultiplier = 1
Position Risk($) = 1*$1.55 = $1.55
Max risk($) = 1% of $250000 = $2500

So, position size = $2500/$1.55 = 1612.9 shares . . . say 1600 shares

See example No.2 in link below for more information on volatility position sizing for stocks
http://www.trading-plan.com/money_position_sizing.html
I thought the above was correct but i'm seeing something different. Attached shows list of orders for next day entries (for 2/19). Also attached is the security data I get from CSI.

Order Risk = 1%, Equity = 150k, ATR = 20days, Stop ATR = 1; therefore I assumed the following:

Quantity = 1,500 / 2.67 = ~561 Shares

This isn't even close to the order generation report - any thoughts would be greatly appreciated.

thanks.
Attachments
position sizing.png
position sizing.png (63 KiB) Viewed 14855 times
position sizing 1.png
position sizing 1.png (178.35 KiB) Viewed 14855 times
Jake Carriker
Site Admin
Site Admin
Posts: 1493
Joined: Fri Sep 12, 2003 10:32 am
Location: Austin, Texas

Post by Jake Carriker »

In general you can't assume that one program's version of a given indicator will necessarily match another program's. For instance, there are two different ATR calculations built into Trading Blox as basic indicators. One uses a simple moving average and one an exponential. The built in Triple Moving Average system uses the latter. No telling which, if either, of those the CSI calculation might match.

That being the case, I went directly to the source and looked at the difference between the order price and protective stop price on your order sheet for FRX. It lists a close of 91.04 and an exit stop of 87.42. The difference between those two prices is 3.62. Your risk budget of $1,500 / 3.62 = 414.36. I think the position size is correct given distance to stop of 3.62.
Ghost11365
Roundtable Knight
Roundtable Knight
Posts: 112
Joined: Wed Jul 31, 2013 3:33 pm

Post by Ghost11365 »

I was only aware of one calculation of ATR - the greater of the following (which gives you the TR and you have to further calc the ATR):

Method 1: Current High less the current Low
Method 2: Current High less the previous Close (absolute value)
Method 3: Current Low less the previous Close (absolute value)

I wasn't aware that simple or exponential was even an option. Nevertheless, I thought the stop was based on the 20day ATR (in my case) which I thought was subtracted from the closing price - guess I'll recheck the help documents.
rhc
Roundtable Knight
Roundtable Knight
Posts: 464
Joined: Tue Nov 18, 2008 8:46 pm
Location: Oz

Post by rhc »

Ghost11365 wrote:I thought the stop was based on the 20day ATR
I use Metastock for looking at charts & Tblox for running system simulations and order generation.
In Metastock the ATR is claculated (or even calculated :wink: ) using the Wilder's Smoothing method.
In Tblox the ATR is calculated using the Exponential smoothing method
This means that a 20 period ATR in Metastock is not the same as a 20 period ATR in Tblox.
(In fact 20 period ATR in MS is equivalent to a 39 period ATR in Tblox)

How is this so? . . . see this link which explains it all . . and more
http://www.macroption.com/atr-calculation/

Excerpt from above link;
Attachments
atr.jpg
atr.jpg (44.16 KiB) Viewed 14816 times
rhc
Roundtable Knight
Roundtable Knight
Posts: 464
Joined: Tue Nov 18, 2008 8:46 pm
Location: Oz

Post by rhc »

Further to the above, please also see your Tblox user's guide
Attachments
atr.jpg
atr.jpg (90.66 KiB) Viewed 14808 times
Ghost11365
Roundtable Knight
Roundtable Knight
Posts: 112
Joined: Wed Jul 31, 2013 3:33 pm

Post by Ghost11365 »

Thank you for the info.
Almelco
Contributing Member
Contributing Member
Posts: 8
Joined: Tue May 21, 2013 1:58 pm

Using EMA and SMA

Post by Almelco »

I do wonder is it possible to express one moving average as SMA and the others as EMA?
rhc
Roundtable Knight
Roundtable Knight
Posts: 464
Joined: Tue Nov 18, 2008 8:46 pm
Location: Oz

Post by rhc »

I see no reason why not
Almelco
Contributing Member
Contributing Member
Posts: 8
Joined: Tue May 21, 2013 1:58 pm

Using EMA and SMA

Post by Almelco »

Thank you, I welcome your kind answer which leaves a window open. I've been told that "the forum members to be helpful". Any more specific help how practically your comment can be implemented? I am a new to Tblox and I use version 4.3.2.1 professional.
sluggo
Roundtable Knight
Roundtable Knight
Posts: 2987
Joined: Fri Jun 11, 2004 2:50 pm

Post by sluggo »

With the Pro Edition of Blox, you cannot create new blox or edit existing blox.

You can, however, install blox from the Marketplace, from system vendors, from programming consultants, and from people who created them on their (more expensive) copy of Blox Builder Edition.
rhc
Roundtable Knight
Roundtable Knight
Posts: 464
Joined: Tue Nov 18, 2008 8:46 pm
Location: Oz

Post by rhc »

Hmmm, . . . A simple question was asked, a simple answer was given yet it was deemed to not be helpful. Even though it answered the question !!??

To get a more helpful answer perhaps the question could have been phrased in a different way.
Example:
“I do wonder is it possible to express one moving average as SMA and the others as EMA? . . . can someone show me how to do thisâ€
Attachments
TMA.jpg
TMA.jpg (107.49 KiB) Viewed 14558 times
rhc
Roundtable Knight
Roundtable Knight
Posts: 464
Joined: Tue Nov 18, 2008 8:46 pm
Location: Oz

Post by rhc »

Further to above, please note that you are not just limited to EMA’s and SMA’s
With the Blox Builder Edition you can also choose any of the following types of moving average as well (if that is what you want)

- Ehlers Non-linear moving average
- Ehlers zero-lag moving average
- Following adaptive moving average
- Kaufman adaptive moving average
- Laguerre Moving Average . . . . . . . . . Whatever that is?
- Mother of adaptive moving average
- Weighted moving average

You could even program your own variation & call it the 'Almelco Moving Average'

Cheers,
Almelco
Contributing Member
Contributing Member
Posts: 8
Joined: Tue May 21, 2013 1:58 pm

Re: Triple Moving Average Experience

Post by Almelco »

I suppose that I owe a reply, even if it is one year later. I became frustrated with Tblox and I left it behind, now I thgought to give it a second try. Thank you Sluggo and rhc for your answers. The right answer is that "With the Pro Edition of Blox, you cannot create new blox or edit existing blox" so unfortunately dear rhc I cannot implement your kind recommendation. Best.
Post Reply