Saturday, August 24, 2013

sdi_passive revision 1.2.0 released.

sdi_passive is a study that shows the growth of a $10,000 investment using two basic passive strategies, bnh (buy-and-hold) and dca (dollar-cost-averaging.) previously my dca (dollar-cost-averaging) simulated a purchase on every bar of a chart. this presented an unrealistically negative view of dca when displaying on day charts because of the impact of commissions. now dca simulates a purchase on a configurable frequency which defaults to 21 (average number of trading days per month.) this allows one to accurately  model both dca and bnh on a day chart.

additionally sdi_passive has been enhanced to display chart labels containing the accumulation of dividends for bnh/dca and the accumulation of interest on idle money for dca.

here is how this new sdi_passive looks:

thinkScript for sdi_passive maintained on original page here.


Saturday, August 10, 2013

thinkscript included: sdi_altbuy - altucher buy signal scanner.

i see that my altucher strategy posts are at the top of my best bones. the best bones are elected by pageviews thus i owe it to my readers to do more of that. so what i've decided to share with you today is a chart script that displays altucher buy signals (i.e. when 4 or more consecutively down days have occurred.)

here's an image of this study on a chart:
chart with sdi_altbuy

here is the study:
##########
# sdi_altbuy:
#hint:Display a buy signal when the threshold number of consecutive down days has occurred.
http://www.smallDogInvestor.com rev:1.0.0
# author: allen everhart
# date: 10aug2013
# 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.
input threshold = 4 ;
#hint threshold: Altucher's criterion for the buy signal is 4.
def dncnt = if close < close[1] then dncnt[1] + 1 else 0;
plot buy = dncnt >= threshold;
buy.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_up);
buy.setDefaultColor(color.DARK_GREEN);

###################

the real benefit of such a script is that it can be used in the scan tab to create a custom scan for altucher signals. this is because it has only one plot. studies with more than one plot statement are not permitted for custom study scans.

instructions for the custom scan for thinkorswim (note: you must have a funded account to create custom scans):
1. install the above chart script by the copy and paste method (or click on my how to tab to find out how to purchase the import files for my suite of scripts.)
2. click the scan tab
3. click the stock hacker button.
4. click the reset button.
5. delete the three fundamental criteria buy clicking on the x's on the right side of the screen.
6. click add study filter.
7. click the triangle to drop down the selection list and select custom. this should look like:



8.in the scanner custom filter dialogue click the edit button.
9.in the edit condition dialogue click the blue triangle and select the study category from the drop down list.
10. scroll the dropdown list of studies and select sdi_altbuy. this should look like:


11. click save then ok and then ok on the warning then scan. this should look something like: