Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (SBGuy), 652 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
IB Options Margin requirements #469453
11/16/17 20:00
11/16/17 20:00
Joined: Nov 2016
Posts: 103
NSW
V
vinsom Offline OP
Member
vinsom  Offline OP
Member
V

Joined: Nov 2016
Posts: 103
NSW
Hi,
I was tring to understand options margin requirements for IB.
Calculating this requirements is not very straightforward. See links below

I tested some options strategies with Zorro and I think this requirements are not followed as I haven't received any margin call errors. Looks like the margin taken into account is just the option price.

Does anyone know a way to make a good approximation while backtesting zorro strategies ?

Has Zorro plan to implement a better margin calculation for options ?

Any help appreciated.

Good trading to everyone
Vincenzo

http://www.cboe.com/LearnCenter/pdf/margin2-00.pdf

https://www.interactivebrokers.com/en/index.php?f=24176
https://www.interactivebrokers.com/en/so...equirements.htm
https://www.interactivebrokers.com.au/en/index.php?f=marginnew&p=opt
https://www.interactivebrokers.com/en/so...checkmargin.htm

Re: IB Options Margin requirements [Re: vinsom] #469490
11/18/17 08:56
11/18/17 08:56
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Zorro cannot plan to implement a better margin calculation, but you should plan this, or your backtest can be off by a large factor when you trade option combos.

Get the margin formula of your combo from your broker and put it in the script. For example, if the margin for a vertical spread is the strike difference, set

MarginCost = 0.5 * abs(Strike1-Strike2);

before entering the two trades. This is important for a realistic backtest since margin directly affects the annual return.

Re: IB Options Margin requirements [Re: jcl] #469509
11/18/17 18:44
11/18/17 18:44
Joined: Nov 2016
Posts: 103
NSW
V
vinsom Offline OP
Member
vinsom  Offline OP
Member
V

Joined: Nov 2016
Posts: 103
NSW
Ok, thanks Jcl.
So the IB formula for writing a put or call is below, and my translation to Zorro script at the bottom.
Not sure if is correct to multiply for the multiplier.

Please help if anyone see any issue.
Thanks

https://www.interactivebrokers.com.au/en/index.php?f=marginnew&p=opt

//Call Price + Maximum ((20% ^ 2 * Underlying Price - Out of the Money Amount), (10% * Underlying Price))

MarginCost= contractPrice(Call)* Multiplier + max( pow(0.20,2) * (Close[0]* Multiplier) - contractIntrinsic(put,Close[0]) , 0.10* (Close[0]* Multiplier));

Re: IB Options Margin requirements [Re: vinsom] #469523
11/19/17 16:32
11/19/17 16:32
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Not sure if the Multiplier is right, but the IB formula looks already wrong, because 20%^2 = 4% and this does not make much sense.

Re: IB Options Margin requirements [Re: Spirit] #469525
11/19/17 18:35
11/19/17 18:35
Joined: Nov 2016
Posts: 103
NSW
V
vinsom Offline OP
Member
vinsom  Offline OP
Member
V

Joined: Nov 2016
Posts: 103
NSW
Not sure I understand the formula either, but that is what is there for the naked put on stocks
https://www.interactivebrokers.com.au/en/index.php?f=marginnew&p=opt

Re: IB Options Margin requirements [Re: vinsom] #469535
11/20/17 07:57
11/20/17 07:57
Joined: Nov 2016
Posts: 103
NSW
V
vinsom Offline OP
Member
vinsom  Offline OP
Member
V

Joined: Nov 2016
Posts: 103
NSW
laughing at myself...that's not 20% to the power of 2, is just 20% with a note at the bottom laugh
See the link above, in a formula really looks like to the power of 2, just didn't make sense

Re: IB Options Margin requirements [Re: vinsom] #469539
11/20/17 10:11
11/20/17 10:11
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
The Multiplier is not used for setting up MarginCost. Option costs and prices are always per 1 unit of the underlying. So the real margin of a contract is Multiplier*MarginCost.

Re: IB Options Margin requirements [Re: jcl] #469542
11/20/17 10:51
11/20/17 10:51
Joined: Nov 2016
Posts: 103
NSW
V
vinsom Offline OP
Member
vinsom  Offline OP
Member
V

Joined: Nov 2016
Posts: 103
NSW
Hi Jcl,
I checked this document, that is a bit more clear than IB, and they multiply for the multiplier. Also if I don't put the multiplier margin comes out too low compared to the margin requirement that I see in TWS if I put the same trade manually

http://www.cboe.com/LearnCenter/pdf/margin2-00.pdf


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1