π 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()withSYMBOL_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:
See alsoΒΆ
- Low-level method:
SymbolInfoDouble- underlying implementation - Related:
getDigits()- decimal places for formatting - Related:
pointsToPips()- convert points to pips - Related:
normalizePrice()- normalize price to symbol's precision