Skip to content

πŸ“ Get Point SizeΒΆ

Convenience method: retrieves the point size for a symbol (smallest price change). Essential for calculating prices with point offsets.

API Information:

  • Sugar method: MT5Sugar.getPoint(String symbol)
  • Underlying method: MT5Account.symbolInfoDouble() with SYMBOL_POINT
  • Source: MT5Sugar convenience layer

πŸ”½ InputΒΆ

Parameter Type Required Description
symbol String βœ… Symbol name (e.g., "EURUSD")

⬆️ OutputΒΆ

Returns: double - Point size

Examples: - EURUSD (5 digits): 0.00001 - USDJPY (3 digits): 0.001 - XAUUSD (2 digits): 0.01


πŸ’¬ Just the essentialsΒΆ

  • What it is. Smallest price change for a symbol.
  • Why you need it. Calculate SL/TP with point offsets.
  • Point vs Pip. For 5-digit EURUSD: 1 pip = 10 points.
  • Used internally. Many sugar methods use this for calculations.

🎯 Purpose¢

Use this method when you need to:

  • Calculate Stop Loss / Take Profit from points offset.
  • Convert points to price units.
  • Understand price precision for a symbol.
  • Calculate spread in price units.

πŸ”— Usage ExamplesΒΆ

1) Get point sizeΒΆ

double point = sugar.getPoint("EURUSD");
System.out.printf("EURUSD point: %.5f%n", point);
// Output: EURUSD point: 0.00001

2) Calculate SL/TP from pointsΒΆ

String symbol = "EURUSD";
double point = sugar.getPoint(symbol);
double ask = sugar.getAsk(symbol);

// SL 50 points below entry
double stopLoss = ask - (50 * point);

// TP 100 points above entry
double takeProfit = ask + (100 * point);

System.out.printf("Entry: %.5f%n", ask);
System.out.printf("SL (-50 points): %.5f%n", stopLoss);
System.out.printf("TP (+100 points): %.5f%n", takeProfit);

3) Compare point sizes across symbolsΒΆ

String[] symbols = {"EURUSD", "USDJPY", "XAUUSD", "GBPUSD"};

for (String symbol : symbols) {
    double point = sugar.getPoint(symbol);
    System.out.printf("%s point size: %.5f%n", symbol, point);
}

// Output:
// EURUSD point size: 0.00001
// USDJPY point size: 0.001
// XAUUSD point size: 0.01
// GBPUSD point size: 0.00001

πŸ“Œ Important NotesΒΆ

  • Point vs Pip:
  • 5-digit broker (EURUSD): 1 pip = 10 points
  • 3-digit broker (USDJPY): 1 pip = 1 point
  • Precision: Point defines minimum price movement.
  • Calculations: Always multiply points by point size to get price offset.
  • Symbol-specific: Each symbol has different point size.
  • Use with digits: Combine with getDigits() for price formatting.

Formula:

Price offset = Points Γ— Point size
Example: 50 points on EURUSD = 50 Γ— 0.00001 = 0.0005


See alsoΒΆ