Showing posts with label Charts. Show all posts
Showing posts with label Charts. Show all posts

Friday, December 20, 2013

TOS Tip: IV Rank plot/labels with SD expected moves

12/20/13

TastyTrade Game Changers has done it again. I've been wanting to plot IV Rank but it seemed way too difficult. It turns out that the plot for IV Rank looks just like the plot for ImpVolatility; only the scale is different. Duh! (Actually, want I really want is a weighted plot. Maybe later.) They threw some threshold lines on it, slapped on some labels, and even sprinkled on a few SD move labels to spice it up. Of course, I had to hot rod it a bit.


Sunday, October 27, 2013

thinkScript: Price Percent chart label

A useful indicator or strength or weakness in an equity is when the price moves up or down 10% in 2 weeks. For indexes this change is 5%.


This Chart label compares the current price with the high and low for the past specified period (default is 2 weeks) and displays the maximum price change. When the default threshold of +/- 5% is reached the label will turn red for a loss and green for a gain.


####begin study: TT_PricePercent
#
# Hint: From TastyTrade. Takes the high and low close for the specified period and compares to the current. The greater change is displayed as a percentage in a label.
#
# length is # of trading days. 10 = 2 weeks.
input length = 10;
input price = FundamentalType.CLOSE;
input pricePercentUP = 5.0;
input pricePercentDOWN = -5.0;
#
def priceday = Fundamental(price, period = aggregationPeriod.DAY);
def high = Highest(priceday[1], length);
def low = Lowest(priceday[1], length);
def PcntChHigh = 100 * (priceday/high -1);
def PcntChLow = 100 * (priceday/low -1);
def PercentChg = if(AbsValue(PcntChHigh) >= AbsValue(PcntChLow), Round(PcntChHigh, 2), Round(PcntChlow, 2));
#
AddLabel(1, Concat ("% Chng: ", PercentChg),if percentChg >= pricePercentUP then color.DARK_GREEN else if percentChg <= pricePercentDOWN then color.RED else color.GRAY);
#
#####end study.