Jump to content
Sign in to follow this  
Vincent

Step Margin's MarginFactor

Recommended Posts

Hi,

 

When clicked on market information icon, a market information data set is return to the browser.

 

I am interested in "MarginFactor" and "Step Margin's MarginFactors" properties.

 

I like to know when I should use "MarginFactor" ("MarginFactor": 160 as shown in the data at bottom) to calculate the margin.

 

And when I should use "Step Margin's MarginFactors" which is depending on the trade quantity size? 

        ...

        "Bands": [

          {

            "LowerBound": 0,

            "MarginFactor": 70

          },

          {

            "LowerBound": 750,

            "MarginFactor": 150

          },

          ...

 

Thanks.

 

 

 

=============================================

Data Set:

 

{

  "MarketInformation": [

    {

      "MarketId": 400616150,

      "Name": "GBP/USD DFT",

      "ExchangeId": 56,

      "ExchangeName": "FX Dummy Exchange",

      "MarginFactor": 160,

      "MinMarginFactor": null,

      "MaxMarginFactor": null,

      "MarginFactorUnits": 27,

      "MinDistance": 1,

      "MinDistanceUnits": 27,

      "WebMinSize": 0.06560819,

      "MaxSize": 3280.4095,

      "MarketSizesCurrencyCode": "GBP",

      "MaxLongSize": 328.04095,

      "MaxShortSize": 328.04095,

      "Market24H": true,

      "PriceDecimalPlaces": 5,

      "DefaultQuoteLength": 30,

      "TradeOnWeb": true,

      "LimitUp": false,

      "LimitDown": false,

      "LongPositionOnly": false,

      "CloseOnly": false,

      "MarketEod": [],

      "PriceTolerance": 2,

      "ConvertPriceToPipsMultiplier": 10000,

      "MarketSettingsTypeId": 1,

      "MarketSettingsType": "Spread",

      "MobileShortName": "GBP/USD",

      "CentralClearingType": "No",

      "CentralClearingTypeDescription": "None",

      "MarketCurrencyId": 11,

      "PhoneMinSize": 0.5,

      "DailyFinancingAppliedAtUtc": "/Date(1430427600000)/",

      "NextMarketEodTimeUtc": "/Date(1430427600000)/",

      "TradingStartTimeUtc": null,

      "TradingEndTimeUtc": null,

      "MarketPricingTimes": [

        {

          "DayOfWeek": 1,

          "StartTimeUtc": {

            "UtcDateTime": "/Date(1430427600000)/",

            "OffsetMinutes": 600

          },

          "EndTimeUtc": null

        },

        {

          "DayOfWeek": 5,

          "StartTimeUtc": null,

          "EndTimeUtc": {

            "UtcDateTime": "/Date(1430511300000)/",

            "OffsetMinutes": -240

          }

        }

      ],

      "MarketBreakTimes": [],

      "MarketSpreads": [

        {

          "SpreadTimeUtc": "/Date(1430463600000)/",

          "Spread": 0.00015,

          "SpreadUnits": 27

        },

        {

          "SpreadTimeUtc": "/Date(1430501400000)/",

          "Spread": 0.0001,

          "SpreadUnits": 27

        }

      ],

      "GuaranteedOrderPremium": 4,

      "GuaranteedOrderPremiumUnits": 1,

      "GuaranteedOrderMinDistance": 50,

      "GuaranteedOrderMinDistanceUnits": 27,

      "PriceToleranceUnits": 0.0001,

      "MarketTimeZoneOffsetMinutes": -240,

      "QuantityConversionFactor": 1,

      "PointFactorDivisor": 100,

      "BetPer": 0.0001,

      "MarketUnderlyingTypeId": 4,

      "MarketUnderlyingType": "FX",

      "AllowGuaranteedOrders": true,

      "OrdersAwareMargining": false,

      "OrdersAwareMarginingMinimum": 50,

      "CommissionChargeMinimum": null,

      "CommissionRate": null,

      "CommissionRateUnits": null,

      "ExpiryUtc": "/Date(1640995200000)/",

      "FutureRolloverUTC": null,

      "AllowRollover": false,

      "ExpiryBasisId": 2,

      "ExpiryBasisText": "Closing price on last day of dealing",

      "StepMargin": {

        "EligibleForStepMargin": true,

        "StepMarginConfigured": true,

        "InheritedFromParentAccountOperator": true,

        "Bands": [

          {

            "LowerBound": 0,

            "MarginFactor": 70

          },

          {

            "LowerBound": 750,

            "MarginFactor": 150

          },

          {

            "LowerBound": 1400,

            "MarginFactor": 220

          },

          {

            "LowerBound": 2300,

            "MarginFactor": 300

          },

          {

            "LowerBound": 3000,

            "MarginFactor": 450

          }

        ]

      },

      "OptionTypeId": null,

      "OptionType": null,

      "StrikePrice": null,

      "MarketTypeId": 2,

      "MarketType": "Ordinary Market",

      "Weighting": 300,

      "FxFinancing": {

        "CaptureDateTime": "/Date(1430514000000)/",

        "LongPoints": 0.3,

        "ShortPoints": -0.52,

        "LongCharge": -0.2,

        "ShortCharge": -0.34,

        "Quantity": 1,

        "ChargeCurrencyId": 6,

        "DaysToRoll": 1

      },

      "UnderlyingRicCode": "43",

      "NewsUnderlyingOverrideType": "NamedItem",

      "NewsUnderlyingOverrideCode": "GBP/"

    }

  ]

}

post-3673-0-07378900-1430484478_thumb.png

Share this post


Link to post

Hi,

 

I've asked the API Dev team your question and they'll send me an answer on Tuesday. When I receive it, I'll post it up here.

 

Kind Regards,

PM!

Share this post


Link to post

Hello,

 

The Margin Factor (MF) is divided into 2 types: Basic MF, and Step Margin MF.

(As you have figured out already, Step Margin MF is set in bands based on trade size.)

 

All accounts belong to an account operator (AO), such as City Index GB, City Index Australia etc. At the AO level, we set whether accounts use Step Margin MF or Basic MF.

 

(Your account should be a Step Margin account).

 

1) If the AO is set to Basic MF, then all accounts will use the Basic MF value, which in your example highlighted in red is 160.

 

2) If the AO is set to Step Margin MF *AND*, the margin bands have been configured, then the Step Margin MF values are used. The MF depends upon your trade size as set out in the margin bands you've highlighted in red from your example.

 

3) If the AO is set to Step Margin MF but the bands are not configured, then the system defaults to using the Basic MF value. Hence, Basic MF values are always sent together with Step Margin MF values.

 

Please ask if the explanation is not clear.

 

Kind Regards,

PM!

Share this post


Link to post

Hi Physicsman,

 

Thank for the reply.

 

You said:

"All accounts belong to an account operator (AO), such as City Index GB, City Index Australia etc. At the AO level, we set whether accounts use Step Margin MF or Basic MF."

 

How do I know if a account set to use Step Margin MF or Basic MF?

 

Thanks.

 

Vincent

Share this post


Link to post

Hello Vincent,

 

You cannot query that information through the API.

 

It appears that you are trying to manually compute the margin for your account - is that correct? You shouldn't need to do that at all. Subscribe and listen to the ClientAccountMargin stream and that provides the current margin requirements for the account. 

 

Kind Regards,

PM!

Share this post


Link to post

Hi Physicsman,

 

I am aware that ClientAccountMargin stream can provide the current margin requirements for the account.

 

Yes, I am trying to compute the margin on the client side. I want to implement this because when an user is opening a position/trade, I want to show him the margin which require for this trade before he open it.

 

If there is not way to know if an account is set to use Step Margin MF or Basic MF through API, I guess there is no way for me to calculate margin correctly on client side.

 

Thanks.

 

Vincent

Share this post


Link to post

Hello Vincent,

 

I understand what you are doing now - you are trying to build a Margin Calculator.

 

There is no need to calculate it manually on the client side: we already have function calls available through the API for use with the Margin Calculator on our platforms. Your Margin Calculator can use the same call.

 

It is SimulateTrade that you require. I've noted that additional explanatory text for this call is required as to its uses - the aforementioned Margin Calculator! I'll get this added in the next few days. 

 

You can see the Margin Calculator functioning by logging into any of our trading platforms, for example Advantage Web or Advantage Trader. The Margin Calculator is in the trade ticket. 

 

Kind Regards,

PM!

Share this post


Link to post

Hi Physicsman,

 

Thanks. I am also aware of SimulateTrade api. I don't like it is because every time user changes the stack size, the client device need to make a request to the City SimulateTrade API in order to get the margin, which I think is unnecessary if we have all the values we needed to calculate it on client device. This is also much faster comparing to using SimulateTrade API.

 

Now, I know there is no way for me to calculate the margin correctly on client device. Using SimulateTrade API is what I am going to fall back to.

 

Thanks.

 

Vincent

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×