Re: MA & Stochastic Signals? November 30, 2017 01:53AM |
Registered: 6 years ago Posts: 13 |
Re: MA & Stochastic Signals? November 30, 2017 01:57AM |
Registered: 8 years ago Posts: 14 |
Re: MA & Stochastic Signals? November 30, 2017 02:01AM |
Registered: 6 years ago Posts: 13 |
Re: MA & Stochastic Signals? November 30, 2017 02:12AM |
Registered: 8 years ago Posts: 14 |
Re: MA & Stochastic Signals? November 30, 2017 02:16AM |
Registered: 8 years ago Posts: 14 |
declare upper; input over_bought = 80; input over_sold = 20; input KPeriod = 5; input DPeriod = 3; input slowing_period = 3; input smoothingType = AverageType.SIMPLE; input priceH = high; input priceL = low; input priceC = close; input HA = 20; input displace = 0; plot HMA = MovingAverage(AverageType.HULL, priceC, HA)[-displace]; HMA.assignvalueColor(if HMA>HMA[1] then color.green else color.red); HMA.setLineWeight(2); def lowest_k = Lowest(priceL, KPeriod); def c1 = priceC - lowest_k; def c2 = Highest(priceH, KPeriod) - lowest_k; def FastK = if c2 != 0 then c1 / c2 * 100 else 0; def FullK = MovingAverage(smoothingType, FastK, slowing_period); def FullD = MovingAverage(smoothingType, FullK, DPeriod); def ASMA = HMA>HMA[1]; def LSMA = HMA<HMA[1]; plot Crup = if ASMA and FullD < over_sold and FullK crosses above FullD then low - 3*tickSize() else Double.NaN; Crup.SetPaintingStrategy(PaintingStrategy.ARROW_UP); Crup.SetDefaultColor(Color.cyan); Crup.setLineWeight(2); plot Crdn = if LSMA and FullD > over_bought and FullK crosses below FullD then high + 3*tickSize() else Double.NaN; Crdn.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN); Crdn.SetDefaultColor(Color.cyan); Crdn.setLineWeight(2); alert(Crup, "Arrow Up", Alert.Bar, Sound.Ding); alert( Crdn, "Arrow Down", Alert.Bar, Sound.Ding);
Re: MA & Stochastic Signals? November 30, 2017 02:27AM |
Registered: 6 years ago Posts: 13 |
Re: MA & Stochastic Signals? November 30, 2017 02:34AM |
Registered: 8 years ago Posts: 14 |
Re: MA & Stochastic Signals? November 30, 2017 02:37AM |
Registered: 6 years ago Posts: 13 |
Re: MA & Stochastic Signals? November 30, 2017 02:54AM |
Registered: 8 years ago Posts: 14 |
Re: MA & Stochastic Signals? November 30, 2017 03:02AM |
Registered: 6 years ago Posts: 13 |
Re: MA & Stochastic Signals? November 30, 2017 03:08AM |
Registered: 8 years ago Posts: 14 |
declare upper; input over_bought = 80; input over_sold = 20; input KPeriod = 5; input DPeriod = 3; input slowing_period = 3; input smoothingType = AverageType.SIMPLE; input priceH = high; input priceL = low; input priceC = close; input HA = 250; input displace = 0; plot HMA = MovingAverage(AverageType.HULL, priceC, HA)[-displace]; HMA.assignvalueColor(if HMA>HMA[1] then color.green else color.red); HMA.setLineWeight(2); def lowest_k = Lowest(priceL, KPeriod); def c1 = priceC - lowest_k; def c2 = Highest(priceH, KPeriod) - lowest_k; def FastK = if c2 != 0 then c1 / c2 * 100 else 0; def FullK = MovingAverage(smoothingType, FastK, slowing_period); def FullD = MovingAverage(smoothingType, FullK, DPeriod); def ASMA = HMA>HMA[1]; def LSMA = HMA<HMA[1]; plot Crup = if ASMA and FullD crosses above over_sold then low - 3*tickSize() else Double.NaN; Crup.SetPaintingStrategy(PaintingStrategy.ARROW_UP); Crup.SetDefaultColor(Color.cyan); Crup.setLineWeight(2); plot Crdn = if LSMA and FullD crosses below over_bought then high + 3*tickSize() else Double.NaN; Crdn.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN); Crdn.SetDefaultColor(Color.cyan); Crdn.setLineWeight(2); alert(Crup, "Arrow Up", Alert.Bar, Sound.Ding); alert( Crdn, "Arrow Down", Alert.Bar, Sound.Ding);
Re: MA & Stochastic Signals? November 30, 2017 03:13AM |
Registered: 6 years ago Posts: 13 |
Re: MA & Stochastic Signals? November 30, 2017 03:22AM |
Registered: 8 years ago Posts: 14 |
#plot Crup = if ASMA and FullD crosses above over_sold then low - 3*tickSize() else Double.NaN; plot Crup = if ASMA and close>HMA and FullD crosses above over_sold then low - 3*tickSize() else Double.NaN; #plot Crdn = if LSMA and FullD crosses below over_bought then high + 3*tickSize() else Double.NaN; plot Crdn = if LSMA and close<HMA and FullD crosses below over_bought then high + 3*tickSize() else Double.NaN;
Re: MA & Stochastic Signals? November 30, 2017 03:41AM |
Registered: 6 years ago Posts: 13 |
Re: MA & Stochastic Signals? November 30, 2017 03:58AM |
Registered: 8 years ago Posts: 14 |
Re: MA & Stochastic Signals? November 30, 2017 04:03AM |
Registered: 6 years ago Posts: 13 |
Re: MA & Stochastic Signals? November 30, 2017 04:04AM |
Registered: 8 years ago Posts: 14 |
Re: Fun with ThinkScript December 01, 2017 01:41AM |
Registered: 6 years ago Posts: 13 |
Re: Fun with ThinkScript December 05, 2017 05:56AM |
Registered: 6 years ago Posts: 13 |
Counting Number of Bars Between Two Dates That Meet Condition December 05, 2017 11:14AM |
Registered: 11 years ago Posts: 119 |
Re: Fun with ThinkScript December 11, 2017 02:39PM |
Registered: 6 years ago Posts: 3 |
Re: Fun with ThinkScript December 11, 2017 04:03PM |
Registered: 8 years ago Posts: 14 |
Re: Fun with ThinkScript December 18, 2017 06:41AM |
Registered: 6 years ago Posts: 1 |
Re: Fun with ThinkScript December 24, 2017 04:00PM |
Registered: 6 years ago Posts: 3 |
Re: Fun with ThinkScript December 26, 2017 04:48PM |
Registered: 9 years ago Posts: 67 |
input period = AggregationPeriod.HOUR; def O = open(period = period); def H = high(period = period); def C = close(period = period); def L = low(period = period); def V = volume(period = period); def O1 = open(period = period); def H1 = high(period = period); def C1 = close(period = period); def L1 = low(period = period); def V1 = volume(period = period); def SV = -V * (H - C) / (H - L); def BV = V1 * (C1 - L1) / (H1 - L1); AddLabel(yes, "Buy ", if BV > SV then Color.GREEN else color.GRAY); AddLabel(yes, "Sell", if SV > BV then Color.RED else color.GRAY);
Re: Fun with ThinkScript December 28, 2017 02:26AM |
Registered: 6 years ago Posts: 3 |
ThinkScript: Recording Values in the First Few Bars on 5min Chart December 30, 2017 12:29PM |
Registered: 6 years ago Posts: 1 |
def na = double.nan; input ORBegin1 = 0930; input OREnd1 = 0935; input ORBegin2 = 0935; input OREnd2 = 0940; input ShowTodayOnly = {"No", default "Yes"}; def s1 = ShowTodayOnly; # First bar calculations def ORActive1 = if secondsTillTime(OREnd1)>0 and secondsFromTime(ORBegin1)>=0 then 1 else 0; def today1 = if s1 == 0 or getday() == getlastday() and secondsfromtime(ORBegin1) >= 1 then 1 else 0; rec ORHigh1 = if ORHigh1[1] == 0 or ORActive1[1] == 0 AND ORActive1==1 then high else if ORActive1 AND high > ORHigh1[1] then high else ORHigh1[1]; rec ORLow1 = if ORLow1[1] ==0 or ORActive1[1] == 0 AND ORActive1 == 1 then low else if ORActive1 AND low < ORlow1[1] then low else ORLow1[1]; rec begin1_close = if(secondsTillTime(OREnd1) == 0, close, 0); def green1 = if begin1_close > open then 1 else 0; # Second bar calculations def s2 = ShowTodayOnly; def ORActive2 = if secondsTillTime(OREnd2)>0 and secondsFromTime(ORBegin2) >=0 then 1 else 0; def today2 = if s2 == 0 or getday() == getlastday() and secondsfromtime(ORBegin2) >= 1 then 1 else 0; rec ORHigh2 = if ORHigh2[1]==0 or ORActive2[1]==0 AND ORActive2==1 then high else if ORActive2 AND high > ORHigh2[1] then high else ORHigh2[1]; rec ORLow2 = if ORLow2[1] ==0 or ORActive2[1]==0 AND ORActive2 == 1 then low else if ORActive2 AND low < ORlow2[1] then low else ORLow2[1]; rec begin2_close = if(secondsTillTime(OREnd2) == 0, close, 0); def green2 = if begin2_close > open then 1 else 0; plot f = green1 == 1 AND green2 == 1 AND ORHigh2 > ORHigh1;
Going Backwards across chart data in TOS January 03, 2018 12:18PM |
Registered: 6 years ago Posts: 1 |
Counting no. of bars January 11, 2018 04:02PM |
Registered: 6 years ago Posts: 1 |
Re: Fun with ThinkScript January 16, 2018 04:29PM |
Registered: 6 years ago Posts: 1 |