How to calculate margin?  [SOLVED]

Questions about MultiCharts and user contributed studies.
NiC72
Posts: 111
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 39 times
Been thanked: 14 times

How to calculate margin?

Postby NiC72 » 12 Aug 2013

I've tried to understand but failed.
Can someone please explain how to calculate the margin on the IB Account.
I use CL (crude oil) futures and would like to have a funtion that counts the maximum number of futures.

sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: How to calculate margin?  [SOLVED]

Postby sptrader » 12 Aug 2013

I've tried to understand but failed.
Can someone please explain how to calculate the margin on the IB Account.
I use CL (crude oil) futures and would like to have a funtion that counts the maximum number of futures.
********************************************************************
IB's margin requirements are listed here :

https://www.interactivebrokers.com/en/i ... nnew&p=fut

NiC72
Posts: 111
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 39 times
Been thanked: 14 times

Re: How to calculate margin?

Postby NiC72 » 13 Aug 2013

Thanks sptrader,
I realize now that I mixed up the value displayed, and what counts.

bomberone1
Posts: 310
Joined: 02 Nov 2010
Has thanked: 26 times
Been thanked: 23 times

Re: How to calculate margin?

Postby bomberone1 » 08 May 2017

Do someone have a indicator that show any Futures Margin in the historical data. I want to see how the margin does it change in the historical data.
It would be nive also to do a backtest with the value. of past margin.
My best.

User avatar
rrams
Posts: 128
Joined: 10 Feb 2011
Location: USA
Has thanked: 7 times
Been thanked: 70 times
Contact:

Re: How to calculate margin?

Postby rrams » 08 May 2017

Margin is not a calculable, static number, it can change during the day if a high volitility event occurs like Brexit.
It is also a different number for holding overnight.
You have to manually type in every contract's margin field in order to keep track.
Here is a sample of my historical initial overnight margin to give an idea of how it changes over the time.

1. I wish MC would automatically populate the current highest margin requirement in QM for every non-expired contract
that quotes are being collected on - by querying the broker API.
2. I wish MC would fix the 1/1/2038 expiration date problem by just leaving blank if the API returns a nonsensical result.
Attachments
Margin.png
(61.81 KiB) Downloaded 1339 times

bomberone1
Posts: 310
Joined: 02 Nov 2010
Has thanked: 26 times
Been thanked: 23 times

Re: How to calculate margin? [NOT SOLVED]

Postby bomberone1 » 08 May 2017

Hi rrams,
is there not any kind of formula to have the margin at EOD of futures?
I just want test a target or stop based into historical margin, does it be possible?

bomberone1
Posts: 310
Joined: 02 Nov 2010
Has thanked: 26 times
Been thanked: 23 times

Re: How to calculate margin?

Postby bomberone1 » 09 May 2017

I fing this from TS forum:


Function: dhDayTradeMargin

Code: Select all

{**********************************************************************
Function: dhDayTradeMargin
Dennis H: 2016
TS futures day trading margins as of 9/30/2016
Returns -1 if the symbol is not on the list
Note: European exchange symbols are in their native currency, not USD
Save as a simple function so you can call it only at the beginning e.g.
Var: DTMargin(dhDayTradeMargin);
***********************************************************************}

Anyway we need a formula to calculate the margin.
Could someone provide the formula to calculate the margin please?

Var: DayTradeMargin(-1);

DayTradeMargin = -1;

if SymbolRoot = "ES" then DayTradeMargin = 1155
else if SymbolRoot = "EMD" then DayTradeMargin = 1705
else if SymbolRoot = "TF" then DayTradeMargin = 1622.5
else if SymbolRoot = "NQ" then DayTradeMargin = 990
else if SymbolRoot = "YM" then DayTradeMargin = 976.25
else if SymbolRoot = "NK" then DayTradeMargin = 6050
else if SymbolRoot = "VX" then DayTradeMargin = 4015

else if SymbolRoot = "FDAX" then DayTradeMargin = 5351.5
else if SymbolRoot = "FDXM" then DayTradeMargin = 1063
else if SymbolRoot = "FESX" then DayTradeMargin = 635
else if SymbolRoot = "FSTB" then DayTradeMargin = 969
else if SymbolRoot = "FSTG" then DayTradeMargin = 1779
else if SymbolRoot = "FGBS" then DayTradeMargin = 211
else if SymbolRoot = "FGBM" then DayTradeMargin = 1041
else if SymbolRoot = "FGBL" then DayTradeMargin = 685.5
else if SymbolRoot = "FOAT" then DayTradeMargin = 581.5
else if SymbolRoot = "FGBX" then DayTradeMargin = 2206.25
else if SymbolRoot = "FSTU" then DayTradeMargin = 329.25

else if SymbolRoot = "LZ" then DayTradeMargin = 2353
else if SymbolRoot = "LT2" then DayTradeMargin = 300
else if SymbolRoot = "LL" then DayTradeMargin = 285
else if SymbolRoot = "LF2" then DayTradeMargin = 825
else if SymbolRoot = "LJ" then DayTradeMargin = 2100
else if SymbolRoot = "H" then DayTradeMargin = 1050
else if SymbolRoot = "G" then DayTradeMargin = 640
else if SymbolRoot = "CC3" then DayTradeMargin = 940
else if SymbolRoot = "RC" then DayTradeMargin = 840

else if SymbolRoot = "AD" then DayTradeMargin = 990
else if SymbolRoot = "BP" then DayTradeMargin = 1980
else if SymbolRoot = "CD" then DayTradeMargin = 797.5
else if SymbolRoot = "EC" then DayTradeMargin = 1842.5
else if SymbolRoot = "JY" then DayTradeMargin = 2255
else if SymbolRoot = "MP1" then DayTradeMargin = 852.5
else if SymbolRoot = "NE1" then DayTradeMargin = 1045
else if SymbolRoot = "SF" then DayTradeMargin = 1980
else if SymbolRoot = "DX" then DayTradeMargin = 990
else if SymbolRoot = "E7" then DayTradeMargin = 921.5
else if SymbolRoot = "J7" then DayTradeMargin = 1127.5
else if SymbolRoot = "M6A" then DayTradeMargin = 198
else if SymbolRoot = "M6B" then DayTradeMargin = 396
else if SymbolRoot = "M6E" then DayTradeMargin = 369

else if SymbolRoot = "US" then DayTradeMargin = 2062.5
else if SymbolRoot = "TY" then DayTradeMargin = 742.5
else if SymbolRoot = "FV" then DayTradeMargin = 440
else if SymbolRoot = "TU" then DayTradeMargin = 302.5
else if SymbolRoot = "ED" then DayTradeMargin = 248

else if SymbolRoot = "GC" then DayTradeMargin = 2970
else if SymbolRoot = "SI" then DayTradeMargin = 2877.5
else if SymbolRoot = "HG" then DayTradeMargin = 1265
else if SymbolRoot = "PA" then DayTradeMargin = 1925
else if SymbolRoot = "PL" then DayTradeMargin = 1320
else if SymbolRoot = "MGC" then DayTradeMargin = 594
else if SymbolRoot = "YG" then DayTradeMargin = 1061
else if SymbolRoot = "YI" then DayTradeMargin = 814

else if SymbolRoot = "CL" then DayTradeMargin = 1595
else if SymbolRoot = "NG" then DayTradeMargin = 1292.5
else if SymbolRoot = "HO" then DayTradeMargin = 2145
else if SymbolRoot = "RB" then DayTradeMargin = 2310
else if SymbolRoot = "QM" then DayTradeMargin = 797.5
else if SymbolRoot = "QN" then DayTradeMargin = 647
else if SymbolRoot = "QH" then DayTradeMargin = 2145
else if SymbolRoot = "QU" then DayTradeMargin = 2310

else if SymbolRoot = "W" then DayTradeMargin = 1320
else if SymbolRoot = "KW" then DayTradeMargin = 1320
else if SymbolRoot = "C" then DayTradeMargin = 1155
else if SymbolRoot = "O" then DayTradeMargin = 770
else if SymbolRoot = "S" then DayTradeMargin = 2970
else if SymbolRoot = "BO" then DayTradeMargin = 825
else if SymbolRoot = "SM" then DayTradeMargin = 2475
else if SymbolRoot = "RR" then DayTradeMargin = 1155
else if SymbolRoot = "DA" then DayTradeMargin = 660
else if SymbolRoot = "CB" then DayTradeMargin = 2860
else if SymbolRoot = "YW" then DayTradeMargin = 264
else if SymbolRoot = "YC" then DayTradeMargin = 231
else if SymbolRoot = "YK" then DayTradeMargin = 594

else if SymbolRoot = "LH" then DayTradeMargin = 1320
else if SymbolRoot = "LC" then DayTradeMargin = 1980
else if SymbolRoot = "FC" then DayTradeMargin = 3713

else if SymbolRoot = "KC" then DayTradeMargin = 3135
else if SymbolRoot = "CT" then DayTradeMargin = 1760
else if SymbolRoot = "OJ" then DayTradeMargin = 2089
else if SymbolRoot = "CC" then DayTradeMargin = 1815
else if SymbolRoot = "SB" then DayTradeMargin = 1663
else if SymbolRoot = "LB" then DayTradeMargin = 1540 ;
dhDayTradeMargin = DayTradeMargin;
Table of Tradestatio...: (NOTE: to see the webpage change word "TS" with "tradestatio.."
http://www.TS.com/products/fu ... quirements
http://www.TS.com/products/fu ... uirements?

bomberone1
Posts: 310
Joined: 02 Nov 2010
Has thanked: 26 times
Been thanked: 23 times

Re: How to calculate margin?

Postby bomberone1 » 12 May 2017

Does anyone have an alternative suggestion?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: How to calculate margin? [NOT SOLVED]

Postby TJ » 12 May 2017

Hi rrams,
is there not any kind of formula to have the margin at EOD of futures?
I just want test a target or stop based into historical margin, does it be possible?

You can make a PM request to create a new keyward -- MARGIN.

You can make another PM request to create a new column in the database.
This new column will hold the margin value, in which you can retrieve the data for backtest analysis.

bomberone1
Posts: 310
Joined: 02 Nov 2010
Has thanked: 26 times
Been thanked: 23 times

Re: How to calculate margin?

Postby bomberone1 » 12 May 2017

Hi TJ,
yes this is a good a idea to improve multicharts, but now is there any triks or workaround? Because if we waite the time of development it takes years...or also nothing.
This is an example:
viewtopic.php?t=11128
You caould find more example....

I do not allow myself to judge why it is not my job and I do not like it, but if you compare other platforms like AB, WealthLab, etc.. you see clear a more efficient method of following the requests and point to the really important elements.
TJ notes the development of certain feautures within Multicharts seems to follow more the fashion of the moment rather than the fundamental features since 2002 are present intopother platforms.

My best.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: How to calculate margin?

Postby Henry MultiСharts » 12 May 2017

Hello bomberone1,

If you have functionality suggestions and you are interested in having them added to the platform - please create a feature request in the Project Management section of our website, where you can provide detailed description of the exact functionality you are looking for and receive development team feedback on the subject. Please keep in mind that not all requests can be implemented due to the fact that some features do not fit into our current roadmap. Like any other company we have management that decides what and when to add, how to manage the company and roadmaps of its products.

bomberone1
Posts: 310
Joined: 02 Nov 2010
Has thanked: 26 times
Been thanked: 23 times

Re: How to calculate margin?

Postby bomberone1 » 12 May 2017

Why do not somethink like "Ask Me Anything (AMA)", where management meet the costumer by webinar?
Here:
https://futures.io/platforms-indicators/

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: How to calculate margin?

Postby Henry MultiСharts » 15 May 2017

bomberone1,

If you have any messages that you want to be forwarded to the management of our company - send them directly to support@multicharts.com


Return to “MultiCharts”