Wednesday, November 2, 2016

v2

<input id="atnbg20161003m1224_i" />

<a href="javascript:atnbg20161003m1224('add chart')" style="font-size:2em;color:greenyellow">
add chart</a>&nbsp;&nbsp;

<a href="javascript:atnbg20161003m1224('get page')" style="font-size:2em;color:greenyellow">
get page</a>&nbsp;&nbsp;

<a href="javascript:atnbg20161003m1224('get charts')" style="font-size:2em;color:greenyellow">
get charts</a>&nbsp;&nbsp;

<a href="javascript:atnbg20161003m1224('clear')" style="font-size:2em;color:greenyellow">
clear</a><br />

<div id="atnbg20161003m1224"></div>

<script>

function atnbg20161003m1224(instruction) {

if (instruction === "add chart") {addchart()}
if (instruction === "clear") {clear()}
if (instruction === "get page") {getpage()}
if (instruction === "getcharts") {getcharts()}

function getpage() {
var page = ""
getupdaters(page)
getcharts(page)}

function clear() {
document.getElementById("atnbg20161003m1224_i").innerHTML = ""
document.getElementById("atnbg20161003m1224").value = ""}

function addchart(string,source,width) {
string = string + '<img src="' + source + '" style="width:' + width + 'px" />'}

function addcharts(string) {
var chartlist = document.getElementById("").innerHTML.split(",")
for (var i = 0; i < chartlist.length; i = i + 1) {
addchart(string,chartlist[i],60)}}

function getcharts() {
var input = document.getElementById("atnbg20161003m1224_i")
var string = "";addcharts(string);input.value = string}

var symbol = document.getElementById("atnbg20161003m1224_s").value

var mb = "http://www.marketwatch.com/investing/stock/"
var yb = "http://finance.yahoo.com/quote/"
var fb = "http://elite.finviz.com/quote.ashx?t="

var bases = [fb,yb,mb]
var labels = ["f","y","m"]

function preview(bases,labels,symbol) {
var space = "&nbsp;"; lt = "<"; gt = ">"
var r = link(symbol,bases[0],labels[0],lt,gt) + space + space + space
r = r + link(symbol,bases[1],labels[1],lt,gt) + space + space + space
r = r + link(symbol,bases[2],labels[2],lt,gt); return r}

function code(bases,labels,symbol) {
var space = "&amp;nbsp;"; lt = "&lt;"; gt = "&gt;"
var r = '&lt;br /&gt;' + link(symbol,bases[0],labels[0],lt,gt) + space + space + space
r = r + link(symbol,bases[1],labels[1],lt,gt) + space + space + space
r = r + link(symbol,bases[2],labels[2],lt,gt) + '&lt;br /&gt;'; return r}

function link(symbol,base,label,lt,gt) {
var link = lt + 'a href="' + base + symbol + '" style="font-size:2em;color:burlywood"'
link = link + ' target="_blank"' + gt
link = link + label + lt + '/a' + gt; return link}

var r = preview(bases,labels,symbol) + "<br />" + code(bases,labels,symbol)
document.getElementById("atnbg20161003m1224").innerHTML = r

function au(sym) {return 'http://elite.finviz.com/chart.ashx?t=' + sym + '&ty=c&ta=st_c,sch_200p,sma_50,sma_200,sma_20&p=d&s=l'}
function mu(sym) {return 'http://elite.finviz.com/chart.ashx?t=' + sym + '&ty=c&ta=0&p=m&s=l'}
function wu(sym) {return 'http://elite.finviz.com/chart.ashx?t=' + sym + '&ty=c&ta=0&p=w&s=l'}
function du(sym) {return 'http://elite.finviz.com/chart.ashx?t=' + sym + '&ty=c&ta=0&p=d&s=l'}
function hu(sym) {return 'http://elite.finviz.com/chart.ashx?t=' + sym + '&ty=c&ta=0&p=i15&s=l'}
function nu(sym) {return 'http://elite.finviz.com/chart.ashx?t=' + sym + '&ty=c&ta=0&p=i3&s=l'}

}

</script>

No comments:

Post a Comment