# testing FinancialIndicator\["RateOfChange",n\]

**URL:** <https://community.wolfram.com/t/testing-financialindicator-rateofchange-n/7907>\
**Category:** Questions\
**Tags:** finance\
**Created:** [February 15, 2016, 3:11am UTC](https://community.wolfram.com/t/testing-financialindicator-rateofchange-n/7907 "2016-02-15T03:11:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![christianchongwhite](https://avatars.discourse-cdn.com/v4/letter/c/a4c791/32.png) [@christianchongwhite](https://community.wolfram.com/u/christianchongwhite)\
**Post date:** [February 15, 2016, 3:11am UTC](https://community.wolfram.com/t/testing-financialindicator-rateofchange-n/7907/1 "2016-02-15T03:11:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![seanc](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/seanc/32/34005_2.png) [@seanc](https://community.wolfram.com/u/seanc)\
**Post date:** [February 15, 2016, 6:24pm UTC](https://community.wolfram.com/t/testing-financialindicator-rateofchange-n/7907/2 "2016-02-15T18:24:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mkelly](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mkelly/32/21221_2.png) [@mkelly](https://community.wolfram.com/u/mkelly)\
**Post date:** [February 15, 2016, 7:20pm UTC](https://community.wolfram.com/t/testing-financialindicator-rateofchange-n/7907/3 "2016-02-15T19:20:12Z")

</div>

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”
