Thursday, June 18, 2015

thinkscript included: sdi_afterhours - display pre- and post-market price levels on a daily chart

previously, one needed to switch from a day time-aggregation to an intraday in order to see after-hours pricing. now, with this new chart study, sdi_afterhours, one can see after-hours pricing on a chart with day time-aggregation. here's a picture of this:
spy with after-hours pricing
the blue level shows where after-hours trading has moved price. this includes pre-market pricing. when the pre- or post-market session ends the after-hours price hides.

caveat: the stock must have options trading on it for afterhours to display. 

here's the code:

Sunday, June 14, 2015

thinkscript included: sdi_mfc rev:1.1 cluster indicator with overlay option

the market forecast indicator is a trio of oscillators that operate in multiple time-frames. i find that this indicator is most useful when the three oscillators cluster in the over-bought or over-sold areas, a condition that purports to foretell a reversal. the reversal might come a day or two to a week after the cluster, so i use this as mostly for a heads-up. with the spaghetti of plots it is a little hard sometimes to see when a cluster occurred, especially if it was just for one day. so i added a little indicator to help point out exactly when the cluster happens:
spy with sdi_mfc rev:1.1, cluster indication
a side benefit of this is that if you are only interested in the cluster indication then you can hide the momentum, shortTerm, intermediate, overbought and oversold plots and place the study in the upper price graph like this:

spy with sdi_mfc in cluster overlay mode.

now that's a good deal tidier.

as always the revised code is maintained on the original post for this chart study.

Sunday, June 7, 2015

thinkscript included: sdi_closeLevel - plot the eod price on a heiken-ashi candle.

i have become enamored with the heiken-ashi candle. the heiken-ashi candle re-jiggers the way open and close are represented. here's a picture that 'splains the heiken-ashi basics:
heiken-ashi explained
the tails point to the same high/low of day as regular candles but the heiken-open is the mid-point of the previous day's heiken-ashi body and the heiken-close is the average price of the day as represented by (open+high+low+close)/4 (aka ohlc4.) the advantage of this presentation of the data is that a series of fat-body/single-tailed candles makes it easy to identify a trend in its nascent stages. also, the heiken-open represents good trade placement in the trend direction. so, if the days trading crosses through the heiken-open to create a two-tailed candle then the trend is questionable and might be reversing.

however, the heiken-ashi candle is a little disconcerting. i think this is because it hides where the market leaves price at the end-of-the-day. so i wrote a thinkscript that shows the eod price in relationship to the heiken-ashi candle. here's what this looks like:
heiken-ashi candles with eod prices
when the eod price is above the heiken-body i color it green because the bulls won the battle on that day and when the eod price is below the heiken-body i color it red because the bears won the battle. if the eod price is inside the heiken-body then i color it black - a stalemate was achieved. i think this improves the heiken-ashi system.

here's the code: