StockFetcher Forums · General Discussion · Amivest Ratio - Coding help for ABSValue and Summation<< >>Post Follow-up
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
4,599 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:

Fetcher[

set{liquidity, close * volume}

set{dv, sum(liquidity, 22)}
set{r_1, sum(ROC(1,1), 22)}

set{Amivest1, dv / r_1}
set{Amivest, Amivest1 / 1000}

add column Amivest
draw Amivest
]



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/gummy-stuff/liquidity-ratio.htm

I don't think that it would plot a negative number and should be much smoother from the: summation(close * volume, 22)?

tomm1111
202 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?

Fetcher[
set{liquidity, close * volume}

set{dv, sum(liquidity, 22)}
set{prc_chg,abs(close - close 1 day ago)}
set{prc_dec,prc_chg / close 1 day ago}
set{prc_perc,prc_dec * 100}
set{r_1, sum(prc_perc, 22)}

set{Amivest1, dv / r_1}
set{Amivest, Amivest1 / 1000}

add column Amivest
draw Amivest
]



StockFetcher Forums · General Discussion · Amivest Ratio - Coding help for ABSValue and Summation<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.