Maximizing Margin

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.
Post Reply
LeviF
Roundtable Knight
Roundtable Knight
Posts: 1436
Joined: Mon Dec 22, 2003 12:24 pm
Location: Des Moines, IA
Contact:

Maximizing Margin

Post by LeviF »

My current objective is to maximize the use of my trading margin without getting a margin call. A 50%, 75%, etc. DD will not bankrupt me and is a minor consideration for now. Does anyone have any input on what sort of safety "margin" would be appropriate based on historical margin usage? ie - use bet size that uses 25% of backtested max margin usage, 50%, 75%, etc...
sluggo
Roundtable Knight
Roundtable Knight
Posts: 2987
Joined: Fri Jun 11, 2004 2:50 pm

Post by sluggo »

I assume you are talking about equity index options, yes?
LeviF
Roundtable Knight
Roundtable Knight
Posts: 1436
Joined: Mon Dec 22, 2003 12:24 pm
Location: Des Moines, IA
Contact:

Post by LeviF »

Retail forex.
alp
Roundtable Knight
Roundtable Knight
Posts: 309
Joined: Mon Aug 27, 2007 8:09 pm

Re: Maximizing Margin

Post by alp »

levijean wrote:My current objective is to maximize the use of my trading margin without getting a margin call. A 50%, 75%, etc. DD will not bankrupt me and is a minor consideration for now. Does anyone have any input on what sort of safety "margin" would be appropriate based on historical margin usage? ie - use bet size that uses 25% of backtested max margin usage, 50%, 75%, etc...
If you clarify your question (or intention) you might get some answers (or results).
sluggo
Roundtable Knight
Roundtable Knight
Posts: 2987
Joined: Fri Jun 11, 2004 2:50 pm

Post by sluggo »

Dunno about Forex. Maybe an approach intended for futures, could also be applicable to Forex (?) Maybe you could write a little Aux blok that calculates the (margin / equity) ratio every bar (day). You could have it output the biggest value of this ratio for the entire testing period, as a test.AddStatistic. Then it'd appear in the output table and you could see, historically, what betsizes were big enough to get margin calls (red).
Attachments
peak_ME.png
peak_ME.png (55.93 KiB) Viewed 9545 times
LeviF
Roundtable Knight
Roundtable Knight
Posts: 1436
Joined: Mon Dec 22, 2003 12:24 pm
Location: Des Moines, IA
Contact:

Post by LeviF »

Yes, I have done that. I was just curious of opinions of a "margin of safety" that would be prudent. If a 2% bet size uses a test maximum of 99% margin, then there isnt much room for deviation.
sluggo
Roundtable Knight
Roundtable Knight
Posts: 2987
Joined: Fri Jun 11, 2004 2:50 pm

Post by sluggo »

You could have a look at your simulation results and measure "What is the largest percentage increase in M/E ratio ever seen over a 5-day period"? Then you could use that percentage as your safety buffer. If biggest increase in 5 days is 13%, choose betsize so peak M/E in simulation is 87%. If M/E ever gets above 87% in real trading, you're in new territory (worse than anything ever seen in simulation), BUT there's pretty good reason to believe you'll have 5 or 4 or 3 days to react (cut positionsizes etc) before getting a margin call.

By the way, for a kamikaze madman who is indifferent to huge drawdowns, the optimum number of margin calls may not be zero. It may be optimum to get a few margin calls from time to time, including the annoyance of having your positions involuntarily closed out, account frozen for 14 days, etc., in exchange for running at higher average heat and receiving greater CAGR%. It's a cost-vs-benefit tradeoff and it seems doubtful that the "cost" of a margin call would be infinite. You could simulate this by deducting an "Other Expense" from the system equity whenever M/E ratio exceeds 1.00. Now find the %risk that maximizes CAGR ... it may be high enough to generate some margin calls...
RedRock
Roundtable Knight
Roundtable Knight
Posts: 944
Joined: Fri Jan 30, 2004 3:54 pm
Location: Arizona

Post by RedRock »

someone say KamiKazi? http://tinyurl.com/ddotor
LeapFrog
Roundtable Knight
Roundtable Knight
Posts: 695
Joined: Mon May 17, 2004 4:18 pm
Location: Boston, MA

Post by LeapFrog »

levijean, just saw your post, have you checked out discussions on this topic from a year ago or so? Although that applied to futures, maybe you can glean something from it for FX. I like the way you think on this one since I also believe in maximizing my margin usage - I see no sense in having my risk capital sitting around just earning interest - as long as the margin usage is being managed very carefully - I've never had a margin call or even close while I aim to push my margin/equity numbers into the 80s.

Don't know how you might be able to adapt the following chart to FX, but this is one way I measure margin usage in backtests (see graph the blox for which is in the marketplace). There is also a margin filter which will reject new orders that exceed your pre set limti.

Problem I have with it these days is that current margin are not representative of historical margins (for futures) as I have not yet sourced reliable historical margin data.
Attachments
Margin Graph of a 4 system suite.
Margin Graph of a 4 system suite.
SuiteMarginEquityFilter.PNG (45.19 KiB) Viewed 9458 times
LeviF
Roundtable Knight
Roundtable Knight
Posts: 1436
Joined: Mon Dec 22, 2003 12:24 pm
Location: Des Moines, IA
Contact:

Post by LeviF »

Hi LeapFrog,

I believe I have accounted for most items when working with the margin. I have a Can Add checker, Can Fill checker, and Margin Call Exit.

I'm trading fx on Oanda, so i'm using their margin rules. They allow trades until leverage is 50:1 and will liquidate positions if leverage exceeds 100:1, so there is a pretty good cushion there. Different instruments have different margin requirements but my Blox account for that.

Turning up the heat with uncorrelated instruments seems show promising results.
LeviF
Roundtable Knight
Roundtable Knight
Posts: 1436
Joined: Mon Dec 22, 2003 12:24 pm
Location: Des Moines, IA
Contact:

Post by LeviF »

I also have a chart like that. I can't use my margin as efficiently as you appear to, likely because the high correlation of fx instruments filters a lot of my trades.
alp
Roundtable Knight
Roundtable Knight
Posts: 309
Joined: Mon Aug 27, 2007 8:09 pm

Post by alp »

How much does the kamikaze trader risk when the (1) starting capital or account balance is $ 5,000 and (2) if and when the account grows to, say, $ 5,000,000?
Asamat
Roundtable Knight
Roundtable Knight
Posts: 175
Joined: Fri Jun 03, 2005 7:50 am
Location: Walldorf, Germany

Post by Asamat »

alp wrote:How much does the kamikaze trader risk when the (1) starting capital or account balance is $ 5,000 and (2) if and when the account grows to, say, $ 5,000,000?
Sorry, I don't understand the question at all. Can you please rephrase, what the actual question is?

Thanks,
Asamat
RedRock
Roundtable Knight
Roundtable Knight
Posts: 944
Joined: Fri Jan 30, 2004 3:54 pm
Location: Arizona

Post by RedRock »

alp wrote:How much does the kamikaze trader risk when the (1) starting capital or account balance is $ 5,000 and (2) if and when the account grows to, say, $ 5,000,000?
I believe fixed ratio traders use the largest expected drawdown on a per contract basis regardless of size. Beyond fixed ratio however, the aspect which might make the method workable is the rate of decrease or rate in which contracts are removed on a draw down. Also Fitting the delta to each market is important . This is not a part of the block available in the marketplace and I've not tested this in tbb. I recall that at some point in time, it was preferable to switch to fixed %. Fixed ratio is heavy gearing and risk to grow a smaller account fast. hence kamikaze. Probably lends itself more towards systems which make shorter term lower risk bets than lttf. Ryan Jones wrote a newsletter in that name some years ago on fixed ratio. For the most part, this information is all in his book. I met him some years ago at a symposium for institutional traders where he was selling his ideas to hedge fund types. Though in salesman mode, likable fellow it seemed. Its not about steady long term performance as I judge it. Rather a way to possibly take a small account to large figures fast during a lucky streak, with attendant risks.
alp
Roundtable Knight
Roundtable Knight
Posts: 309
Joined: Mon Aug 27, 2007 8:09 pm

Post by alp »

Asamat wrote:Sorry, I don't understand the question at all. Can you please rephrase, what the actual question is?
How much drawndown is the (kamikaze) trader willing to endure if the account balance is (1) $ 5,000 or instead (2) $ 5,000,000?
alp
Roundtable Knight
Roundtable Knight
Posts: 309
Joined: Mon Aug 27, 2007 8:09 pm

Post by alp »

RedRock wrote:I believe fixed ratio traders use the largest expected drawdown on a per contract basis regardless of size. Beyond fixed ratio however, the aspect which might make the method workable is the rate of decrease or rate in which contracts are removed on a draw down. Also Fitting the delta to each market is important . This is not a part of the block available in the marketplace and I've not tested this in tbb. I recall that at some point in time, it was preferable to switch to fixed %. Fixed ratio is heavy gearing and risk to grow a smaller account fast. hence kamikaze. Probably lends itself more towards systems which make shorter term lower risk bets than lttf. ... Its not about steady long term performance as I judge it. Rather a way to possibly take a small account to large figures fast during a lucky streak, with attendant risks.
There is an interesting article here at http://www.stator-afm.com/fixed-ratio-p ... izing.html with the key differences and the formula:
Fixed ratio position sizing was developed by Ryan Jones in his book "The Trading Game," John Wiley & Sons, New York, 1999. Based on an equation presented by Jones, it's possible to derive the following equation for the number of contracts in fixed ratio position sizing:

N = 0.5 * [(1 + 8 * P/delta)^0.5 + 1]

where N is the number of contracts, P is the total closed trade profit, and delta is the parameter discussed above. The carat symbol ( ^ ) represents exponentiation; that is, the quantity in parentheses is raised to the power of 0.5 (square root).

A few points are worth noting. The profit, P , is the accumulated profit over all trades leading up to the one for which you want to calculate the number of contracts. Consequently, the number of contracts for the first trade is always one because you always start with zero profits ( P = 0 ). Also, as you accrue more profits, the number of contracts increases more slowly. A $10,000 profit made early in a sequence of trades will increase the number of contracts more than a $10,000 profit made after many other profitable trades.

Unlike with fixed fractional trading , the trade risk is not a factor in the fixed ratio equation. All that matters is the accumulated profit and the delta. The delta determines how quickly the contracts are added or subtracted. Also note that the account equity is not a factor. Changing the starting account size, for example, will not change the number of contracts, provided there is enough equity to continue trading.
I wonder if the method fixed ratio is applicable to a strategy trading a portfolio of instruments. It looks like it has to be calculated on a per instrument basis with per instrument delta values and profit accumulation history.
Asamat
Roundtable Knight
Roundtable Knight
Posts: 175
Joined: Fri Jun 03, 2005 7:50 am
Location: Walldorf, Germany

Post by Asamat »

In my opinion the information provided isn't nearly enough to give a meaningful answer.

I'd say the acceptable DD depends, among other things, and not in this sequence of importance, on
a) what fraction of the traders personal wealth does the account constitute,
b) what is the expected gain,
c) what is the situation in the traders life.

a) Imagine my 15 year old son being worth 5000 in total. He would be very careful with that sum.
OTOH, if I myself open an account at a new broker, put in 5000, I could well play all-or-none. To test a new strategy, say.
OTOH, if - after a couple of good years - the account reached 5,000,000, I would be very, very careful. The risk of loosing, say, half or more of that would outweigh any possible gain even ten times the sum. The reason is simple, with 5 mil I could stop working and live of the account. I would not risk that situation for any reason.
OTOH, for Bill Gates a 5 mil account would not constitute anything meaningful, so he might be as careless with that as I might with the 5000 account.

b) This one is simple: if the possible gain is a million, even my son might risk the entire 5000. If the possible gain is 10% per year, he will not.

c) My grandma probably has a very different outlook and expectation about what to reach with any account, compared to somebody who just bought or built a house, while raising two kids. And compare both to a student with no strings attached, who just inherited the account.

-----------------------
To me this is a complex topic highly dependent on the personal situation of the trader/account owner. There is no objective answer, just based on equity numbers and system performance figures.
alp
Roundtable Knight
Roundtable Knight
Posts: 309
Joined: Mon Aug 27, 2007 8:09 pm

Post by alp »

Asamat wrote:To me this is a complex topic highly dependent on the personal situation of the trader/account owner. There is no objective answer, just based on equity numbers and system performance figures.
Even if just based on equity numbers and system performance figures, perhaps these figures are just historical and highly dependent on the system's rationale (is it reasonable to expect similar performance in the future?).

Say, the performance figures indicate a maximum drawndown of 30% and Monte Carlo iterations indicate a maximum drawdown around 45%. Moreover the trader is confident that the equity curve is not over-fitted (otherwise, the Monte Carlo results are useless).

In this case, which would be the optimal leverage? The aggressive (kamikaze) trader is confident that her maximum drawdown will not exceed 30%, so she works with an account leverage factor of 2 (i.e., multiplies the bet size or instead the initial capital by 2). In this case, the theoretical maximum drawdown is 60% and the Monte Carlo maximum drawdown is 90%. Although theoretically attractive, this can be psychologically unbearable.
Post Reply