Page 1 of 1

'Category' reserved word returns 18?

Posted: Apr 11 2012
by JoshM
While debugging a function I noticed that the 'Category' reserved word returns a value of 18 during real-time trading when applied to a future.

However, according to the wiki page and the help in the PowerLanguage editor: a) Category values range from 0 to 14, and b) Futures should return a zero. In backtesting and the data on which the functions where developed, the Category reserved word returned indeed a zero.

For example

Code: Select all

if (LastBarOnChart_s = True) then begin

if (BarStatus(1) = 2) then
Print(TimeNow, " Category: ", category,
" SymbolName: ", getsymbolname, " Exchange: ", ExchListed);
end;
returns

Code: Select all

11-04_14:20:03 Category: 18.00 SymbolName: FESX Exchange: EUREX
(MC 7.4 Build 4906)

-----
Edit:
It seems that the Category reserved word returns 18 when the instrument is a custom future, and the correct zero value when the instrument is a single futures contract:

Code: Select all

11-04_14:41:43 Category: 18.00 SymbolName: FGBL Exchange: EUREX
11-04_14:42:53 Category: 0.00 SymbolName: M6AM2 Exchange: CME
11-04_14:43:50 Category: 18.00 SymbolName: FESX Exchange: EUREX
11-04_14:44:19 Category: 18.00 SymbolName: FGBL Exchange: EUREX
11-04_14:45:02 Category: 18.00 SymbolName: ES Exchange: CME
Now my question is: is the value of 18 indicative of a Custom Future or is 18 a default case (so not exclusively for Custom Futures)?

Re: 'Category' reserved word returns 18?

Posted: Apr 11 2012
by Henry MultiŠ”harts
Hello Josh,

We will investigate this case.

Re: 'Category' reserved word returns 18?

Posted: Apr 13 2012
by Henry MultiŠ”harts
The value "18" is incorrect. "Category" code word should return "0" value for a Custom futures symbol, as well as for a regular Futures symbol. The output will be corrected in MultiCharts 8.0 Release.