dxFeed Graal Native SDK 3.14.0
Loading...
Searching...
No Matches
PriceIncrements' functions

Functions

int32_t dxfg_PriceIncrements_EMPTY (graal_isolatethread_t *thread, DXFG_OUT dxfg_price_increments_t **emptyPriceIncrements)
int32_t dxfg_PriceIncrements_valueOf (graal_isolatethread_t *thread, const char *text, DXFG_OUT dxfg_price_increments_t **priceIncrements)
int32_t dxfg_PriceIncrements_valueOf2 (graal_isolatethread_t *thread, double increment, DXFG_OUT dxfg_price_increments_t **priceIncrements)
int32_t dxfg_PriceIncrements_valueOf3 (graal_isolatethread_t *thread, const double *increments, int32_t size, DXFG_OUT dxfg_price_increments_t **priceIncrements)
int32_t dxfg_PriceIncrements_getText (graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, DXFG_OUT char **text)
int32_t dxfg_PriceIncrements_getPriceIncrements (graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, DXFG_OUT double **increments, DXFG_OUT int32_t *size)
int32_t dxfg_PriceIncrements_getPriceIncrement (graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, DXFG_OUT double *priceIncrement)
int32_t dxfg_PriceIncrements_getPriceIncrement2 (graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, DXFG_OUT double *priceIncrement)
int32_t dxfg_PriceIncrements_getPriceIncrement3 (graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, int32_t direction, DXFG_OUT double *priceIncrement)
int32_t dxfg_PriceIncrements_getPricePrecision (graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, DXFG_OUT int32_t *pricePrecision)
int32_t dxfg_PriceIncrements_getPricePrecision2 (graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, DXFG_OUT int32_t *pricePrecision)
int32_t dxfg_PriceIncrements_roundPrice (graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, DXFG_OUT double *roundedPrice)
int32_t dxfg_PriceIncrements_roundPrice2 (graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, int32_t direction, DXFG_OUT double *roundedPrice)
int32_t dxfg_PriceIncrements_roundPrice3 (graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, dxfg_rounding_mode_t roundingMode, DXFG_OUT double *roundedPrice)
int32_t dxfg_PriceIncrements_incrementPrice (graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, int32_t direction, DXFG_OUT double *incrementedPrice)
int32_t dxfg_PriceIncrements_incrementPrice2 (graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, int32_t direction, double step, DXFG_OUT double *incrementedPrice)

Detailed Description

Function Documentation

◆ dxfg_PriceIncrements_EMPTY()

int32_t dxfg_PriceIncrements_EMPTY ( graal_isolatethread_t * thread,
DXFG_OUT dxfg_price_increments_t ** emptyPriceIncrements )

Returns an empty price increments - it has empty text and sole increment with value 0. The handle of this instance will be written to the passed pointer.

Sample:

dxfg_price_increments_t* empty_price_increments = {};
int32_t result = dxfg_PriceIncrements_EMPTY(isolate_thread, &empty_price_increments);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do some work with empty_price_increments
// Release
dxfg_JavaObjectHandler_release(isolate_thread, &empty_price_increments->handler);
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
#define DXFG_EXECUTE_SUCCESSFULLY
Definition dxfg_common.h:72
int32_t dxfg_JavaObjectHandler_release(graal_isolatethread_t *thread, dxfg_java_object_handler *handler)
int32_t dxfg_PriceIncrements_EMPTY(graal_isolatethread_t *thread, DXFG_OUT dxfg_price_increments_t **emptyPriceIncrements)
Definition dxfg_glossary.h:147
dxfg_java_object_handler handler
Definition dxfg_glossary.h:149
Deprecated
Use dxfg_v4_PriceIncrements_EMPTY().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[out]emptyPriceIncrementsThe pointer to result's handle.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_JavaObjectHandler_release() to free the price increments handle.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#EMPTY

◆ dxfg_PriceIncrements_getPriceIncrement()

int32_t dxfg_PriceIncrements_getPriceIncrement ( graal_isolatethread_t * thread,
dxfg_price_increments_t * priceIncrements,
DXFG_OUT double * priceIncrement )

Returns first price increment (for price range adjacent to 0), usually the smallest one. Returns 0 for EMPTY price increments.

Sample:

double price_increment = 0.0;
int32_t result = dxfg_PriceIncrements_getPriceIncrement(isolate_thread, price_increments, &price_increment);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do something with price_increment.
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_PriceIncrements_getPriceIncrement(graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, DXFG_OUT double *priceIncrement)
Deprecated
Use dxfg_v4_PriceIncrements_getPriceIncrement().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]priceIncrementsThe price increments handle.
[out]priceIncrementA pointer to the result.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#getPriceIncrement–

◆ dxfg_PriceIncrements_getPriceIncrement2()

int32_t dxfg_PriceIncrements_getPriceIncrement2 ( graal_isolatethread_t * thread,
dxfg_price_increments_t * priceIncrements,
double price,
DXFG_OUT double * priceIncrement )

Returns price increment which shall be applied to the specified price. If price is Not-a-Number (NaN) then first price increment is returned. If price is a breakpoint between two ranges then minimum of upward and downward increments is returned. This method is equivalent to calling dxfg_PriceIncrements_getPriceIncrement3(thread, price_increments, price, 0, &price_increment).

Sample:

double price_increment = 0.0;
int32_t result = dxfg_PriceIncrements_getPriceIncrement2(isolate_thread, price_increments, 100.34, &price_increment);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do something with price_increment.
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_PriceIncrements_getPriceIncrement2(graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, DXFG_OUT double *priceIncrement)
Deprecated
Use dxfg_v4_PriceIncrements_getPriceIncrementForPrice().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]priceIncrementsThe price increments handle.
[in]priceThe price.
[out]priceIncrementA pointer to the result.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#getPriceIncrement-double-

◆ dxfg_PriceIncrements_getPriceIncrement3()

int32_t dxfg_PriceIncrements_getPriceIncrement3 ( graal_isolatethread_t * thread,
dxfg_price_increments_t * priceIncrements,
double price,
int32_t direction,
DXFG_OUT double * priceIncrement )

Returns price increment which shall be applied to the specified price in the specified direction. If price is Not-a-Number (NaN) then first price increment is returned. If price is a breakpoint between two ranges and direction is 0 then minimum of upward and downward increments is returned.

Sample:

double price_increment = 0.0;
int32_t result = dxfg_PriceIncrements_getPriceIncrement3(isolate_thread, price_increments, 100.34, 1,
&price_increment);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do something with price_increment.
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_PriceIncrements_getPriceIncrement3(graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, int32_t direction, DXFG_OUT double *priceIncrement)
Deprecated
Use dxfg_v4_PriceIncrements_getPriceIncrementForPriceAndDirection().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]priceIncrementsThe price increments handle.
[in]priceThe price.
[in]directionThe direction.
[out]priceIncrementA pointer to the result.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#getPriceIncrement-double-int-

◆ dxfg_PriceIncrements_getPriceIncrements()

int32_t dxfg_PriceIncrements_getPriceIncrements ( graal_isolatethread_t * thread,
dxfg_price_increments_t * priceIncrements,
DXFG_OUT double ** increments,
DXFG_OUT int32_t * size )

Returns internal representation of price increments as a single array of double values. This array specifies all numbers from textual representation (see dxfg_PriceIncrements_getText()) in the same order. Therefore numbers at even positions are increments and numbers at odd positions are upper limits. The array always has odd length - the infinite upper limit of last range is always omitted and the first increment (for price range adjacent to 0) is always included even for EMPTY value.

Sample:

double* increments = {};
int32_t size = 0;
int32_t result = dxfg_PriceIncrements_getPriceIncrements(isolate_thread, price_increments, &increments, &size);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do something with increments.
// Free the array.
dxfg_free(isolate_thread, increments);
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_free(graal_isolatethread_t *thread, void *pointer)
Frees a block of the unmanaged (GraalVM) memory that a function of the SDK allocated,...
int32_t dxfg_PriceIncrements_getPriceIncrements(graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, DXFG_OUT double **increments, DXFG_OUT int32_t *size)
Deprecated
Use dxfg_v4_PriceIncrements_getPriceIncrements().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]priceIncrementsThe price increments handle.
[out]incrementsA pointer to the result.
[out]sizeA pointer to the result size.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_free() to free the array of increments.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#getPriceIncrements–

◆ dxfg_PriceIncrements_getPricePrecision()

int32_t dxfg_PriceIncrements_getPricePrecision ( graal_isolatethread_t * thread,
dxfg_price_increments_t * priceIncrements,
DXFG_OUT int32_t * pricePrecision )

Returns first price precision (for price range adjacent to 0), usually the largest one. Returns 0 for EMPTY price increments.

Sample:

int32_t price_precision = 0;
int32_t result = dxfg_PriceIncrements_getPricePrecision(isolate_thread, price_increments, &price_precision);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do something with price_precision.
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_PriceIncrements_getPricePrecision(graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, DXFG_OUT int32_t *pricePrecision)
Deprecated
Use dxfg_v4_PriceIncrements_getPricePrecision().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]priceIncrementsThe price increments handle.
[out]pricePrecisionA pointer to the result.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#getPricePrecision–

◆ dxfg_PriceIncrements_getPricePrecision2()

int32_t dxfg_PriceIncrements_getPricePrecision2 ( graal_isolatethread_t * thread,
dxfg_price_increments_t * priceIncrements,
double price,
DXFG_OUT int32_t * pricePrecision )

Returns price precision for the price range which contains specified price. Price precision is a number of decimal digits after decimal point that are needed to represent all valid prices in the given price range. This method returns price precision in the interval [0, 18] inclusive. If price is Not-a-Number (NaN) then first price precision is returned. If price is a breakpoint between two ranges then precision of lower range is returned.

Sample:

int32_t price_precision = 0;
int32_t result = dxfg_PriceIncrements_getPricePrecision2(isolate_thread, price_increments, 23, &price_precision);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do something with price_precision.
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_PriceIncrements_getPricePrecision2(graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, DXFG_OUT int32_t *pricePrecision)
Deprecated
Use dxfg_v4_PriceIncrements_getPricePrecisionForPrice().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]priceIncrementsThe price increments handle.
[in]priceThe price.
[out]pricePrecisionA pointer to the result.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#getPricePrecision-double-

◆ dxfg_PriceIncrements_getText()

int32_t dxfg_PriceIncrements_getText ( graal_isolatethread_t * thread,
dxfg_price_increments_t * priceIncrements,
DXFG_OUT char ** text )

Returns textual representation of price increments in the format:

   TEXT ::= "" | LIST
   LIST ::= INCREMENT | RANGE "; " LIST
   RANGE ::= INCREMENT " " UPPER_LIMIT
   

Where INCREMENT is a price increment in the given price range and UPPER_LIMIT is the upper bound of that range. All ranges are listed in the ascending order of upper limits and the last range is considered to extend toward infinity and is therefore specified without upper limit. All increments and limits are finite positive numbers. The case with empty text is a special stub used for EMPTY value, it uses sole increment with value 0.

Sample:

char *text = {};
int32_t result = dxfg_PriceIncrements_getText(isolate_thread, price_increments, &text); // valueOf3({0.01, 20, 0.02},
3)
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
printf(" text = '%s'\n", text); // text = '0.01 20; 0.02'
dxfg_String_release(isolate_thread, text);
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_String_release(graal_isolatethread_t *thread, const char *string)
int32_t dxfg_PriceIncrements_getText(graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, DXFG_OUT char **text)
Deprecated
Use dxfg_v4_PriceIncrements_getText().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]priceIncrementsThe price increments handle.
[out]textA pointer to the textual representation of the price increments.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_String_release() to free the textual representation.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#getText–

◆ dxfg_PriceIncrements_incrementPrice()

int32_t dxfg_PriceIncrements_incrementPrice ( graal_isolatethread_t * thread,
dxfg_price_increments_t * priceIncrements,
double price,
int32_t direction,
DXFG_OUT double * incrementedPrice )

Returns specified price incremented in the specified direction by appropriate increment and then rounded to nearest valid value. If price is Not-a-Number (NaN) then NaN is returned. If appropriate price increment is 0 then specified price is returned as is. This method is equivalent to calling dxfg_PriceIncrements_incrementPrice2(thread, priceIncrements, price, direction, 0, &incrementedPrice).

Sample:

double incremented_price = 0.0;
int32_t result = dxfg_PriceIncrements_incrementPrice(isolate_thread, price_increments, 100.34, 1,
&incremented_price);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do something with incremented_price.
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_PriceIncrements_incrementPrice(graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, int32_t direction, DXFG_OUT double *incrementedPrice)
Deprecated
Use dxfg_v4_PriceIncrements_incrementPrice().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]priceIncrementsThe price increments handle.
[in]priceThe price.
[in]directionThe direction.
[out]incrementedPriceA pointer to the result.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Throws IllegalArgumentException if direction is 0. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#incrementPrice-double-int-

◆ dxfg_PriceIncrements_incrementPrice2()

int32_t dxfg_PriceIncrements_incrementPrice2 ( graal_isolatethread_t * thread,
dxfg_price_increments_t * priceIncrements,
double price,
int32_t direction,
double step,
DXFG_OUT double * incrementedPrice )

Returns specified price incremented in the specified direction by the maximum of specified step and appropriate increment, and then rounded to nearest valid value. If price is Not-a-Number (NaN) then NaN is returned. If both step and appropriate price increment are 0 then specified price is returned as is. Note that step must be positive even for negative directions.

Sample:

double incremented_price = 0.0;
int32_t result = dxfg_PriceIncrements_incrementPrice2(isolate_thread, price_increments, 100.34, 1, 0.5,
&incremented_price);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do something with incremented_price.
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_PriceIncrements_incrementPrice2(graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, int32_t direction, double step, DXFG_OUT double *incrementedPrice)
Deprecated
Use dxfg_v4_PriceIncrements_incrementPriceWithStep().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]priceIncrementsThe price increments handle.
[in]priceThe price.
[in]directionThe direction.
[in]stepThe step.
[out]incrementedPriceA pointer to the result.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Throws IllegalArgumentException if direction is 0 or step uses invalid value. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#incrementPrice-double-int-double-

◆ dxfg_PriceIncrements_roundPrice()

int32_t dxfg_PriceIncrements_roundPrice ( graal_isolatethread_t * thread,
dxfg_price_increments_t * priceIncrements,
double price,
DXFG_OUT double * roundedPrice )

Returns specified price rounded to nearest valid value. If price is Not-a-Number (NaN) then NaN is returned. If appropriate price increment is 0 then specified price is returned as is. This method is equivalent to calling dxfg_PriceIncrements_roundPrice2(isolate_thread, price_increments, price, 0, &rounded_price).

Sample:

double rounded_price = 0.0;
int32_t result = dxfg_PriceIncrements_roundPrice(isolate_thread, price_increments, 100.34, &rounded_price);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do something with rounded_price.
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_PriceIncrements_roundPrice(graal_isolatethread_t *thread, dxfg_price_increments_t *priceIncrements, double price, DXFG_OUT double *roundedPrice)
Deprecated
Use dxfg_v4_PriceIncrements_roundPrice().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]priceIncrementsThe price increments handle.
[in]priceThe price.
[out]roundedPriceA pointer to the result.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#roundPrice-double-

◆ dxfg_PriceIncrements_roundPrice2()

int32_t dxfg_PriceIncrements_roundPrice2 ( graal_isolatethread_t * thread,
dxfg_price_increments_t * priceIncrements,
double price,
int32_t direction,
DXFG_OUT double * roundedPrice )

Returns specified price rounded in the specified direction to nearest value that is valid according to price increment rules. If price is Not-a-Number (NaN) then NaN is returned. If appropriate price increment is 0 then specified price is returned as is. If direction is 0 then price is rounded to nearest valid value.

Sample:

double rounded_price = 0.0;
int32_t result = dxfg_PriceIncrements_roundPrice(isolate_thread, price_increments, 100.34, 1, &rounded_price);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do something with rounded_price.
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
Deprecated
Use dxfg_v4_PriceIncrements_roundPriceWithDirection().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]priceIncrementsThe price increments handle.
[in]priceThe price.
[in]directionThe direction.
[out]roundedPriceA pointer to the result.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#roundPrice-double-int-

◆ dxfg_PriceIncrements_roundPrice3()

int32_t dxfg_PriceIncrements_roundPrice3 ( graal_isolatethread_t * thread,
dxfg_price_increments_t * priceIncrements,
double price,
dxfg_rounding_mode_t roundingMode,
DXFG_OUT double * roundedPrice )

Returns specified price rounded according to specified rounding mode to nearest value that is valid according to price increment rules. If price is Not-a-Number (NaN) then NaN is returned. If appropriate price increment is 0 then specified price is returned as is.

Sample:

double rounded_price = 0.0;
int32_t result = dxfg_PriceIncrements_roundPrice(isolate_thread, price_increments, 100.34,
DXFG_ROUNDING_MODE_CEILING, &rounded_price);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do something with rounded_price.
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
@ DXFG_ROUNDING_MODE_CEILING
Definition dxfg_javac.h:270
Deprecated
Use dxfg_v4_PriceIncrements_roundPriceWithRoundingMode().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]priceIncrementsThe price increments handle.
[in]priceThe price.
[in]roundingModeThe rounding mode.
[out]roundedPriceA pointer to the result.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#roundPrice-double-java.math.RoundingMode-

◆ dxfg_PriceIncrements_valueOf()

int32_t dxfg_PriceIncrements_valueOf ( graal_isolatethread_t * thread,
const char * text,
DXFG_OUT dxfg_price_increments_t ** priceIncrements )

Returns an instance of price increments for specified textual representation. The handle of this instance will be written to the passed pointer.

See dxfg_PriceIncrements_getText() for format specification.

Sample:

dxfg_price_increments_t* price_increments = {};
int32_t result = dxfg_PriceIncrements_valueOf(isolate_thread, "0.0001 1; 0.01", &price_increments);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do some work with price_increments
// Release
dxfg_JavaObjectHandler_release(isolate_thread, &price_increments->handler);
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_PriceIncrements_valueOf(graal_isolatethread_t *thread, const char *text, DXFG_OUT dxfg_price_increments_t **priceIncrements)
Deprecated
Use dxfg_v4_PriceIncrements_valueOf().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]textThe textual representation.
[out]priceIncrementsThe pointer to result's handle (price increments for specified textual representation)
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_JavaObjectHandler_release() to free the price increments handle.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#valueOf-java.lang.String-

◆ dxfg_PriceIncrements_valueOf2()

int32_t dxfg_PriceIncrements_valueOf2 ( graal_isolatethread_t * thread,
double increment,
DXFG_OUT dxfg_price_increments_t ** priceIncrements )

Returns an instance of price increments for specified single increment.

Sample:

dxfg_price_increments_t* price_increments = {};
int32_t result = dxfg_PriceIncrements_valueOf2(isolate_thread, 0.01, &price_increments);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do some work with price_increments
// Release
dxfg_JavaObjectHandler_release(isolate_thread, &price_increments->handler);
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_PriceIncrements_valueOf2(graal_isolatethread_t *thread, double increment, DXFG_OUT dxfg_price_increments_t **priceIncrements)
Deprecated
Use dxfg_v4_PriceIncrements_valueOfIncrement().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]incrementThe single increment.
[out]priceIncrementsThe pointer to result's handle.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_JavaObjectHandler_release() to free the price increments handle.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#valueOf-double-

◆ dxfg_PriceIncrements_valueOf3()

int32_t dxfg_PriceIncrements_valueOf3 ( graal_isolatethread_t * thread,
const double * increments,
int32_t size,
DXFG_OUT dxfg_price_increments_t ** priceIncrements )

Returns an instance of price increments for specified internal representation. See dxfg_PriceIncrements_getPriceIncrements() for details about internal representation.

Sample:

dxfg_price_increments_t* price_increments = {};
double increments[] = {0.01, 20, 0.02, 50, 0.05, 100, 0.1, 250, 0.25, 500, 0.5, 1000, 1, 2500, 2.5};
int32_t result = dxfg_PriceIncrements_valueOf3(isolate_thread, increments, sizeof(increments) /
sizeof(increments[0]), &price_increments);
if (result == DXFG_EXECUTE_SUCCESSFULLY) {
// Do some work with price_increments
// Release
dxfg_JavaObjectHandler_release(isolate_thread, &price_increments->handler);
} else {
// Use the dxfg_get_and_clear_thread_exception_t to print the stack trace.
}
int32_t dxfg_PriceIncrements_valueOf3(graal_isolatethread_t *thread, const double *increments, int32_t size, DXFG_OUT dxfg_price_increments_t **priceIncrements)
Deprecated
Use dxfg_v4_PriceIncrements_valueOfIncrements().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]incrementsThe array of increments in internal representation.
[in]sizeA size of the array.
[out]priceIncrementsThe pointer to result's handle.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown. Use dxfg_JavaObjectHandler_release() to free the price increments handle.
See also
https://docs.dxfeed.com/dxfeed/api/com/dxfeed/glossary/PriceIncrements.html#valueOf-double:A-