DecimalsOfInstrument

From MultiCharts
Revision as of 10:45, 27 January 2012 by JoshM (talk | contribs) (Created page with "The DecimalsOfInstrument returns the number of decimals of an instrument. == Code == <syntaxhighlight> DecimalsOfInstrument = Round(Log(PriceScale) / Log(10), 0); </syntaxhig...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The DecimalsOfInstrument returns the number of decimals of an instrument.

Code

DecimalsOfInstrument = Round(Log(PriceScale) / Log(10), 0);

Usage

if (LastBarOnChart_s = True) then
	Print(GetSymbolName, "  -  ", DecimalsOfInstrument);

returns

6E  -     4.00

In this example, the 6E has four decimals (e.g. 1.3012).