Message Boards Message Boards

GROUPS:

testing FinancialIndicator["RateOfChange",n]

Posted 3 years ago
3305 Views
|
2 Replies
|
0 Total Likes
|

Hi,

I am trying to test / understand RateOfChange results so have attempted to create a test set. These are not working and I post one test set code below:

Why does the VolumeRateOfChange work but RateOfChange does not with the following error? (Message::name: "Message name \!(\"RateOfChange\"::\"bprcss\") is not of the form symbol::name or symbol::name::language.")

FinancialIndicator["VolumeRateOfChange", 2][{{{2000, 1, 1}, 100 {1, 1, 0, 0, 1}}, {{2000, 1, 2}, 
   100 {0, 2, 0, 2, 2.01}}, {{2000, 1, 3}, 
   100 {2, 3, 2, 3, 3}}, {{2000, 1, 4}, 100 {3, 3, 2, 1, 1}}}]

%[{2000, 1, 2}]

FinancialIndicator["RateOfChange", 
  2][{{{2000, 1, 1}, 100 {1, 1, 0, 0, 1}}, {{2000, 1, 2}, 
   100 {0, 2, 0, 2, 2.01}}, {{2000, 1, 3}, 
   100 {2, 3, 2, 3, 3}}, {{2000, 1, 4}, 100 {3, 3, 2, 1, 1}}}]

%[{2000, 1, 2}]

Thanks, --Christian

2 Replies

Hm. The error message isn't correct. Basically, the error message says that it can't load the correct error message. I've forwarded the example to the developers that they can take a further look at the issue.

This is not the correct error message for this problem. It is saying that the indicator "RateOfChange" is not of the message format symbol::name. However this is not the problem with this calculation.

In[1]:= FinancialIndicator["RateOfChange",2][{{{2000,1,1},100 {1,1,0,0,1}},{{2000,1,2},100 {0,2,0,2,2.01}},{{2000,1,3},100 {2,3,2,3,3}},{{2000,1,4},100 {3,3,2,1,1}}}] During evaluation of In[1]:= Message::name: Message name RateOfChange::bprcss is not of the form symbol::name or symbol::name::language. >> Out[1]= {}

Suppose we take some realistic data and apply the same FinancialIndicator: In[1]:= data = FinancialData["GOOGL", "OHLCV", {{2009, 5, 1}, {2010, 4, 30}}]; In[12]:= FinancialIndicator["RateOfChange", 2][Take[data, 4]] Out[12]= TemporalData[TimeSeries, {{{2.1057201696362764, 0.25125801355273913, 0.11910655714036196`}}, {{3450384000, 3450556800, 86400}}, 1, {"Continuous", 1}, {"Discrete", 1}, 1, { ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}, MetaInformation -> {"FinancialIndicator" -> "ROC"}}}, True, 10.4]

Then we can see that it works fine. The problem with the given data is that it is unrealistic, in that it has a closing price of zero as its first data point! Suppose we had the same constraint with zero volume then we would also get

In[17]:= FinancialIndicator["VolumeRateOfChange",2][{{{2000,1,1},100 {1,1,0,0,0}},{{2000,1,2},100 {0,2,0,2,2.01}},{{2000,1,3},100 {2,3,2,3,3}},{{2000,1,4},100 {3,3,2,1,1}}}] During evaluation of In[17]:= Message::name: Message name VolumeRateOfChange::bprcss is not of the form symbol::name or symbol::name::language. >> Out[17]= {}

If we correct for the zero closing price in the dummy data we get: In[15]:= FinancialIndicator["RateOfChange",2][{{{2000,1,1},100 {1,1,0,3,1}},{{2000,1,2},100 {0,2,0,2,2.01}},{{2000,1,3},100 {2,3,2,3,3}},{{2000,1,4},100 {3,3,2,1,1}}}] Out[15]= TimeSeries[Time: 02 Jan 2000 to 04 Jan 2000 [SpanFromLeft] Data points: 3 [SpanFromLeft]]

So, the error message is wrong and should be something like: "FinancialIndicator::outrange : RateOfChange requires positive closing prices" Similarly: "FinancialIndicator::outrange : VolumeRateOfChange requires positive volumes"

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract