×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

SetFPCompareAccuracy - MultiCharts
Open main menu

SetFPCompareAccuracy

Revision as of 16:00, 19 April 2021 by KateMultiCharts (talk | contribs) (→‎Parameters)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Sets floating point compare accuracy by specifying the tolerance value to be used when floating point values are compared.

Two floating point values will be considered equal if "abs(Value1 – Value2) <= ε", where ε is the tolerance value.

By default, the tolerance value is 2.2204460492503131e-012.

Usage

SetFPCompareAccuracy(Accuracy)

Parameters

Accuracy - an FPC constant or a numerical expression specifying a tolerance value as follows:

fpcVeryLowAccuracy  0  2.2204460492503131e-8
fpcLowAccuracy  1  2.2204460492503131e-10
fpcMedAccuracy  2  2.2204460492503131e-12 (Default)
fpcHighAccuracy  3  2.2204460492503131e-14
fpcVeryHighAccuracy  4  2.2204460492503131e-16
fpcExact  5  0.00

Example

Set floating point compare accuracy to High:

SetFPCompareAccuracy(3);

Set floating point compare accuracy to High:

SetFPCompareAccuracy(fpcHighAccuracy);