vixvix 4 posts msg #114572  Ignore vixvix 
7/20/2013 8:42:16 PM
Trying to carry over EasyLanguage code for the Amivest Ratio.
Not sure if ABSValue is available within SF? Plus, would like to check that volume is <> 0
Current code for SF is not working......any help would be greatly appreciated.
apply to sharedlist(Dow30)
set{dv,summation(close * volume,22)}
set{pct, 100 * abs(close  close 1 day ago) / close 1 day ago}
set{r,summation(pct,22)}
set{Amivest,(dv / r) / 1000}
/* EasyLanguage Code
If Volume <> 0 then
dv = summation(close * volume, len1);
pct = 100 * AbsValue((close  close[1]) / close[1]);
r = summation(pct, len1);
Amvol = (dv/r)/1000; */

Kevin_in_GA 3,829 posts msg #114573  Ignore Kevin_in_GA 
7/20/2013 9:29:43 PM
set{dv,summation(close * volume,22)}
set{pct, 100 * abs(close  close 1 day ago) / close 1 day ago}
set{r,summation(pct,22)}
set{Amivest,(dv / r) / 1000}
You are putting too many mathematical operations into your set{} statements, and a few of them are not SF functions. Try this:
Here I have substituted the ROC() function for calculating the percent change from one day ago. The code looks OK, but SF seems to have at least one or two days where the value blows up hugely on almost every stock I looked at. Not sure why this happens since it is based only on price and volume.

vixvix 4 posts msg #114574  Ignore vixvix 
7/20/2013 10:16:05 PM
Thank you for the code and input.
Here is more information for Excel coding.
http://www.financialwebring.org/gummystuff/liquidityratio.htm
I don't think that it would plot a negative number and should be much smoother from the: summation(close * volume, 22)?

tomm1111 197 posts msg #114584  Ignore tomm1111 
7/22/2013 1:47:28 AM
vixvix,
How do you plan using the Amivist Ratio for trading or screening?
