StockFetcher Forums · General Discussion · Kevin care to take a shot at this?<< >>Post Follow-up
SAFeTRADE
644 posts
msg #138644
Ignore SAFeTRADE
modified
10/10/2017 8:01:26 AM

100 * LOG10( SUM(ATR(1), n) / ( MaxHi(n) - MinLo(n) ) ) / LOG10(n)

n = User defined period length.
LOG10(n) = base-10 LOG of n
ATR(1) = Average True Range (Period of 1)
SUM(ATR(1), n) = Sum of the Average True Range over past n bars
MaxHi(n) = The highest high over past n bars
Mathematically, log10(x) is equivalent to log(10, x) . ... The logarithm to the base 10 is defined for all complex arguments x ? 0. log10(x) rewrites logarithms to the base 10 in terms of the natural logarithm: log10(x) = ln(x)/ln(10)

Also shown as:

atr = atr(index, period);
total = sum(index, period, ATR);
lowest = lowest(index, period, LOW);
highest = highest(index, period, HIGH);
diff = highest - lowest;
temp = (total/diff);
Plot: chop = 100 * Math.log10(temp) / Math.log10(period);

Kevin I do not know about Log10. I can pretty much figure everything else. Is Log10
akin to Log only with a separate calc to arrive at Log10?

Safetrade


Kevin_in_GA
4,599 posts
msg #138645
Ignore Kevin_in_GA
10/10/2017 8:44:54 AM

You already have this - the function is simply log10(insert data here). Example:

Fetcher[
set{logprice, log10(close)}
add column logprice
]




SAFeTRADE
644 posts
msg #138648
Ignore SAFeTRADE
10/10/2017 8:58:10 AM

Kevin than you for quick reply. Very much appreciated.

Safetrade

SAFeTRADE
644 posts
msg #138649
Ignore SAFeTRADE
10/10/2017 9:20:15 AM

set{x,10}
set{diff, high 10 day high - low 10 day low}
set{temp, atr(10) / diff}
set{a, log10(temp)}
set{b, log10(x)}
set{c, a / b}

set{chop, c * 100}

symlist(spy)
draw chop

This is what I have so far however Chop should be on a scale of 0 to 100.
It is not, can you see my error? Seems pretty straight forward.

Safetrade

SAFeTRADE
644 posts
msg #138660
Ignore SAFeTRADE
10/10/2017 11:45:49 PM

My latest attempt, still don't think it is correct.

Fetcher[
set{atrsum, sum(atr(1),10)}
set{x,10}
set{x2, log10(x)}
set{diff, high 10 day high - low 10 day low}
set{temp, atrsum / diff}
set{a, log10(temp)}
set{chop1, a / x2}
set{chop, chop1 * 100}




apply to watchlist(sectors)
draw chop line at 61.8
draw chop line at 32.8


chart-length is 6 months
]




Kevin_in_GA
4,599 posts
msg #138663
Ignore Kevin_in_GA
modified
10/11/2017 8:06:39 AM

I'm pretty sure that the log10(x) when x = 10 is just 1 ... no real need for it here but it does give you the flexibility to look at other periods.

krumpnstuff
1 posts
msg #158390
Ignore krumpnstuff
1/13/2022 10:59:04 AM

Safetrade,

dont know if youre still having issues with this (years later), but im newish to SF, and happened across this post...the reason your getting the wrong values was because you did not sum your ATR correctly. below is the working script:

set{x,10}
set{diff, high 10 day high - low 10 day low}
set{sum, sum(atr(1),10)}
set{temp, sum / diff}
set{a, log10(temp)}
set{b, log10(x)}
set{c, a / b}

set{chop, c * 100}

StockFetcher Forums · General Discussion · Kevin care to take a shot at this?<< >>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.