Sunday, January 31, 2016

thinkscript included: master beta - with sdi_betalabel

just a quickie - beta in a chart label - and an organizational idea. here's the pic:
SPY with sdi_betalabel in subgraph.
beta tells you how much an equity typically moves relative to the market. a beta of one says that spy typically moves the same amount as the market (one would hope!) beta's between 1 and 2 are elevated and beta's above 2 are high. beta can be below 1 for slow and steady movers or even negative, typically seen for inverse etf's.

the organizational idea is to place all these good-to-have labels in a separate subgraph to reduce label-bloat in the main price graph. just drag and drop the study from the edit studies (beaker icon in chart tab) dialog:

here's the code: (how to install)



# sdi_betaLabel: Display Beta in a chart label
#hint: Displays the Beta in a chart label. rev: 1.0.0 http://www.smallDogInvestor.com 
# author: allen everhart
# date: 31jan2016
plot labelColor=double.naN;
# copylefts reserved. This is free software. That means you are free
# to use or modify it for your own usage but not for resale. 
# Help me get the word out about my blog by keeping this header
# in place. 
labelcolor.hidetitle();
labelColor.setdefaultColor(color.BLUE);
addLabel(1,concat("beta:",beta()), labelColor.takeValueColor());

No comments:

Post a Comment