'Category' reserved word returns 18?

Questions about MultiCharts and user contributed studies.
User avatar
JoshM
Posts: 2074
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1523 times
Been thanked: 1479 times
Contact:

'Category' reserved word returns 18?

Postby JoshM » 11 Apr 2012

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)?

User avatar
Henry MultiСharts
Posts: 8378
Joined: 25 Aug 2011
Has thanked: 1199 times
Been thanked: 2677 times

Re: 'Category' reserved word returns 18?

Postby Henry MultiСharts » 11 Apr 2012

Hello Josh,

We will investigate this case.
These users thanked the author Henry MultiСharts for the post:
JoshM

User avatar
Henry MultiСharts
Posts: 8378
Joined: 25 Aug 2011
Has thanked: 1199 times
Been thanked: 2677 times

Re: 'Category' reserved word returns 18?

Postby Henry MultiСharts » 13 Apr 2012

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.
These users thanked the author Henry MultiСharts for the post:
JoshM


Return to “MultiCharts”