• C#
  • Java
  • VB
  • C++
  • Python
Contact us
Minimum Price Increment

The minimum increment is the minimum difference between price levels at which a contract can trade. Some trades have constant price increments at all price levels. However some contracts have difference minimum increments on different exchanges on which they trade and/or different minimum increments at different price levels. In the contractDetails class, there is a field 'minTick' which specifies the smallest possible minimum increment encountered on any exchange or price. For complete information about minimum price increment structure, there is the IB Contracts and Securities search site, or the API function reqMarketRule starting in API v973.03 and TWS 966.

The function reqContractDetails when used with a Contract object will return contractDetails object to the contractDetails function which has a list of the valid exchanges where the instrument trades. Also within the contractDetails object is a field called marketRuleIDs which has a list of "market rules". A market rule is defined as a rule which defines the minimum price increment given the price. The market rule list returned in contractDetails has a list of market rules in the same order as the list of valid exchanges. In this way, the market rule ID for a contract on a particular exchange can be determined.

  • Market rule for forex and forex CFDs indicates default configuration (1/2 and not 1/10 pips). It can be adjusted to 1/10 pips through TWS or IB Gateway Global Configuration.
  • Some non-US securities, for instance on the SEHK exchange, have a minimum lot size. This information is not available from the API but can be obtained from the IB Contracts and Securities search page. It will also be indicated in the error message returned from an order which does not conform to the minimum lot size.

With the market rule ID number, the corresponding rule can be found with the API function IBApi::EClient::reqMarketRule:

  • client.reqMarketRule(26);
    client.reqMarketRule(240);
  • client.reqMarketRule(26);
    client.reqMarketRule(240);
  • client.reqMarketRule(26)
    client.reqMarketRule(240)
  • m_pClient->reqMarketRule(26);
    m_pClient->reqMarketRule(635);
    m_pClient->reqMarketRule(1388);
  • 1  self.reqMarketRule(26)
    2  self.reqMarketRule(239)

The rule is returned to the function IBApi::EWrapper::marketRule

  • public void marketRule(int marketRuleId, PriceIncrement[] priceIncrements)
    {
    Console.WriteLine("Market Rule Id: " + marketRuleId);
    foreach (var priceIncrement in priceIncrements)
    {
    Console.WriteLine("Low Edge: {0}, Increment: {1}", ((decimal)priceIncrement.LowEdge).ToString(), ((decimal)priceIncrement.Increment).ToString());
    }
    }
  • @Override
    public void marketRule(int marketRuleId, PriceIncrement[] priceIncrements) {
    DecimalFormat df = new DecimalFormat("#.#");
    df.setMaximumFractionDigits(340);
    System.out.println("Market Rule Id: " + marketRuleId);
    for (PriceIncrement pi : priceIncrements) {
    System.out.println("Price Increment. Low Edge: " + df.format(pi.lowEdge()) + ", Increment: " + df.format(pi.increment()));
    }
    }
  • Public Sub marketRule(marketRuleId As Integer, priceIncrements As PriceIncrement()) Implements EWrapper.marketRule
    Console.WriteLine("Market Rule Id:" & marketRuleId)
    For Each priceIncrement In priceIncrements
    Console.WriteLine("LowEdge: " & CDec(priceIncrement.LowEdge) & " Increment: " & CDec(priceIncrement.Increment))
    Next
    End Sub
  • void TestCppClient::marketRule(int marketRuleId, const std::vector<PriceIncrement> &priceIncrements) {
    printf("Market Rule Id: %d\n", marketRuleId);
    for (unsigned int i = 0; i < priceIncrements.size(); i++) {
    printf("Low Edge: %g, Increment: %g\n", priceIncrements[i].lowEdge, priceIncrements[i].increment);
    }
    }
  • 1  def marketRule(self, marketRuleId: int, priceIncrements: ListOfPriceIncrements):
    2  super().marketRule(marketRuleId, priceIncrements)
    3  print("Market Rule ID: ", marketRuleId)
    4  for priceIncrement in priceIncrements:
    5  print("Price Increment.", priceIncrement)
  • For forex, there is an option in TWS/IB Gateway configuration which allows trading in 1/10 pips instead of 1/5 pips (the default).
  • TWS Global Configuration -> Display -> Ticker Row -> Allow Forex trading in 1/10 pips