Re: Fun with ThinkScript February 12, 2016 09:43PM |
Registered: 10 years ago Posts: 143 |
Re: Fun with ThinkScript February 13, 2016 11:49AM |
Registered: 10 years ago Posts: 143 |
Re: Fun with ThinkScript February 13, 2016 12:10PM |
Registered: 8 years ago Posts: 9 |
Re: Fun with ThinkScript February 13, 2016 12:33PM |
Registered: 10 years ago Posts: 143 |
Re: Fun with ThinkScript February 13, 2016 02:01PM |
Registered: 8 years ago Posts: 9 |
Re: Fun with ThinkScript February 13, 2016 02:05PM |
Registered: 8 years ago Posts: 9 |
Re: Fun with ThinkScript February 13, 2016 10:26PM |
Registered: 10 years ago Posts: 464 |
Re: Fun with ThinkScript February 14, 2016 05:20AM |
Registered: 8 years ago Posts: 25 |
Re: Fun with ThinkScript February 14, 2016 06:07AM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript February 17, 2016 10:20PM |
Registered: 8 years ago Posts: 25 |
Re: Fun with ThinkScript February 18, 2016 01:50AM |
Registered: 9 years ago Posts: 6 |
Re: Fun with ThinkScript February 18, 2016 10:31AM |
Registered: 9 years ago Posts: 60 |
# # TD Ameritrade IP Company, Inc. (c) 2007-2016 # declare lower; input length = 5; Assert(length > 0, "'length' must be positive: " + length); plot Up = (length - 1 - GetMaxValueOffset(high, length)) * 100.0 / (length - 1); plot Down = (length - 1 - GetMinValueOffset(low, length)) * 100.0 / (length - 1); plot OverBought = 70; plot OverSold = 30; Up.SetDefaultColor(GetColor(1)); Down.SetDefaultColor(GetColor(5)); OverBought.SetDefaultColor(GetColor(8)); OverSold.SetDefaultColor(GetColor(8));
Re: Fun with ThinkScript February 18, 2016 11:54AM |
Registered: 8 years ago Posts: 1 |
Re: Fun with ThinkScript February 18, 2016 12:17PM |
Registered: 8 years ago Posts: 25 |
Re: Fun with ThinkScript February 18, 2016 01:24PM |
Registered: 8 years ago Posts: 8 |
Re: Fun with ThinkScript February 18, 2016 01:26PM |
Registered: 8 years ago Posts: 25 |
Re: Fun with ThinkScript February 18, 2016 01:53PM |
Registered: 8 years ago Posts: 161 |
Re: Fun with ThinkScript February 18, 2016 03:48PM |
Registered: 8 years ago Posts: 161 |
# # TD Ameritrade IP Company, Inc. (c) 2007-2016 # declare lower; input length = 25; Assert(length > 0, "'length' must be positive: " + length); plot Up = (GetMaxValueOffset(high, length)) * 100.0 / (length - 1); plot Down = (GetMinValueOffset(low, length)) * 100.0 / (length - 1); plot OverBought = 70; plot OverSold = 30; Up.SetDefaultColor(GetColor(1)); Down.SetDefaultColor(GetColor(5)); OverBought.SetDefaultColor(GetColor(8)); OverSold.SetDefaultColor(GetColor(8)); plot Above = Up crosses Down and Down<30; Above.SetDefaultColor(Color.green); Above.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); plot Below = Up crosses Down and Down>70; Below.SetDefaultColor(Color.red); Below.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); plot zeroline = 0;
Re: Fun with ThinkScript February 18, 2016 08:35PM |
Registered: 9 years ago Posts: 6 |
Re: Fun with ThinkScript February 19, 2016 01:46AM |
Registered: 9 years ago Posts: 60 |
Re: Fun with ThinkScript February 19, 2016 02:16AM |
Registered: 9 years ago Posts: 60 |
input Aggregate = { Hourly, default Daily, Weekly, Monthly} ; def Agg = if Aggregate == Aggregate.Hourly then AggregationPeriod.Hour else if Aggregate == Aggregate.Daily then AggregationPeriod.Day else if Aggregate == Aggregate.Weekly then AggregationPeriod.WEEK else if Aggregate == Aggregate.Monthly then AggregationPeriod.MONTH else AggregationPeriod.MIN; input length = 5; input capSpikesAt = 10; def VarP = Round(length / 5); def VarA = Highest(high, VarP) - Lowest(low, VarP); def VarR1 = if VarA == 0 and VarP == 1 then AbsValue(close - close[VarP]) else VarA; def VarB = Highest(high, VarP)[VarP + 1] - Lowest(low, VarP)[VarP]; def VarR2 = if VarB == 0 and VarP == 1 then AbsValue(close[VarP] - close[VarP * 2]) else VarB; def VarC = Highest(high, VarP)[VarP * 2] - Lowest(low, VarP)[VarP * 2]; def VarR3 = if VarC == 0 and VarP == 1 then AbsValue(close[VarP * 2] - close[VarP * 3]) else VarC; def VarD = Highest(high, VarP)[VarP * 3] - Lowest(low, VarP)[VarP * 3]; def VarR4 = if VarD == 0 and VarP == 1 then AbsValue(close[VarP * 3] - close[VarP * 4]) else VarD; def VarE = Highest(high, VarP)[VarP * 4] - Lowest(low, VarP)[VarP * 4]; def VarR5 = if VarE == 0 and VarP == 1 then AbsValue(close[VarP * 4] - close[VarP * 5]) else VarE; def LRange = ((VarR1 + VarR2 + VarR3 + VarR4 + VarR5) / 5) * 0.2; def Var0 = if AbsValue(close - close[1]) > (high - low) then AbsValue(close - close[1]) else (high - low); def LRange2 = if high == low then Average(AbsValue(close - close[1]), 5) * 0.2 else Average(Var0, 5) * 0.2; def range = high + low; def delta = high - low; def median = range / 2; def floatingAxis = Average(median, length); def dynamicVolatilityUnit = if length <= 7 then LRange2 else LRange; def relativeHigh = (high - floatingAxis) / dynamicVolatilityUnit; def relativeLow = (low - floatingAxis) / dynamicVolatilityUnit; def relativeOpen = (open - floatingAxis) / dynamicVolatilityUnit; def relativeClose = (close - floatingAxis) / dynamicVolatilityUnit; def "High" = Min(relativeHigh, capSpikesAt); def "Low" = Max(relativeLow, -capSpikesAt); def bullDiv = (low <= low[1]) and ("Low" > "Low"[1]); def bearDiv = (high >= high[1]) and ("High" < "High"[1]); plot upArrow = if bullDiv then low * 0.997 else Double.NaN; upArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP); upArrow.SetLineWeight(4); upArrow.SetDefaultColor(Color.GREEN); plot dnArrow = if bearDiv then high * 1.003 else Double.NaN; dnArrow.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN); dnArrow.SetLineWeight(4); dnArrow.SetDefaultColor(Color.RED);
Re: Fun with ThinkScript February 19, 2016 01:14PM |
Registered: 10 years ago Posts: 464 |
Re: Fun with ThinkScript February 19, 2016 04:20PM |
Registered: 9 years ago Posts: 78 |
Re: Fun with ThinkScript February 19, 2016 04:38PM |
Registered: 8 years ago Posts: 25 |
Re: Fun with ThinkScript February 19, 2016 05:50PM |
Registered: 8 years ago Posts: 161 |
Re: Fun with ThinkScript February 19, 2016 06:20PM |
Registered: 9 years ago Posts: 78 |
Re: Fun with ThinkScript February 20, 2016 12:17AM |
Registered: 8 years ago Posts: 54 |
Re: Fun with ThinkScript February 20, 2016 12:29AM |
Registered: 8 years ago Posts: 34 |
Re: Fun with ThinkScript February 20, 2016 12:56AM |
Registered: 8 years ago Posts: 161 |
def mySHORT = close>=(UpperBand-0.0006); def myLONG = close<=(LowerBand+0.0006); alert(mySHORT, "GO SHORT", alert.BAR, sound.Ring); alert(myLONG, "GO LONG", alert.BAR, sound.Ring);
Re: Fun with ThinkScript February 20, 2016 01:24AM |
Registered: 8 years ago Posts: 161 |
def myLONG = (DMI+)>20.0 and (DMI-)<20.0 and ADX<(DMI+) and ADX>(DMI-) and ADXr>20.0; def mySHORT = (DMI-)>20.0 and (DMI+)<20.0 and ADX>(DMI-) and ADX<(DMI+) and ADXr>20.0; alert(myLONG, "GO LONG", alert.BAR, sound.Ring); alert(mySHORT, "GO SHORT", alert.BAR, sound.Ring);