π― Get Tick Value and SizeΒΆ
Helper method: retrieves tick value and tick size for symbol in one call. Used for profit calculations and volume sizing.
API Information:
- Sugar method:
MT5Sugar.getTickValueAndSize(String symbol) - Returns:
double[2]- Array with [tickValue, tickSize] - Underlying:
tickValueWithSize()service call
π½ InputΒΆ
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol |
String |
β | Symbol name |
β¬οΈ OutputΒΆ
Returns: double[2] - Array: [tickValue, tickSize]
Throws: ApiExceptionMT5 if no data available
π Usage ExampleΒΆ
String symbol = "EURUSD";
double[] tickData = sugar.getTickValueAndSize(symbol);
double tickValue = tickData[0];
double tickSize = tickData[1];
System.out.printf("%s tick data:%n", symbol);
System.out.printf(" Tick value: $%.2f%n", tickValue);
System.out.printf(" Tick size: %.5f%n", tickSize);
// Output:
// EURUSD tick data:
// Tick value: $1.00
// Tick size: 0.00001
See alsoΒΆ
- Volume calculation:
calculateVolume()- uses tick data