Re: Fun with ThinkScript February 20, 2016 03:55AM |
Registered: 9 years ago Posts: 78 |
Re: Fun with ThinkScript February 20, 2016 05:35AM |
Registered: 9 years ago Posts: 78 |
Re: Fun with ThinkScript February 20, 2016 11:58AM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript February 20, 2016 02:13PM |
Registered: 10 years ago Posts: 143 |
NetVolume Indicator Inquiry,,, February 21, 2016 02:49AM |
Registered: 9 years ago Posts: 67 |
Re: NetVolume Indicator Inquiry,,, February 21, 2016 04:45AM |
Registered: 9 years ago Posts: 78 |
Re: Fun with ThinkScript February 21, 2016 11:32PM |
Registered: 10 years ago Posts: 143 |
Re: Fun with ThinkScript February 21, 2016 11:37PM |
Registered: 10 years ago Posts: 143 |
Re: Fun with ThinkScript February 22, 2016 03:11AM |
Registered: 9 years ago Posts: 78 |
Re: Fun with ThinkScript February 22, 2016 01:53PM |
Registered: 9 years ago Posts: 60 |
Re: Fun with ThinkScript February 22, 2016 05:30PM |
Registered: 10 years ago Posts: 63 |
Re: Fun with ThinkScript February 22, 2016 09:58PM |
Registered: 8 years ago Posts: 161 |
Re: Fun with ThinkScript February 22, 2016 10:43PM |
Registered: 8 years ago Posts: 20 |
Re: Fun with ThinkScript February 23, 2016 12:02PM |
Registered: 8 years ago Posts: 161 |
Re: Fun with ThinkScript February 25, 2016 07:02PM |
Registered: 8 years ago Posts: 22 |
# BEGIN input Hide_Lines = no; input Hide_Dots = no; input Dot_Size = 2; input price = close; input fastLength = 8; input slowLength = 21; input displace = 0; plot fastAvg; plot slowAvg; ################## Hide Lines ################## if Hide_Lines then { fastAvg = Double.NaN; slowAvg = Double.NaN; } else { fastAvg = expAverage(price[-displace], fastLength); slowAvg = expAverage(price[-displace], slowLength); } ################## Line Appearance ############### fastAvg.AssignValueColor(Color.PINK ); fastAvg.SetStyle(Curve.SHORT_DASH); slowAvg.AssignValueColor(Color.PINK ); slowAvg.SetStyle(Curve.POINTS); #################### Signal Arrows ################ def fast = expAverage(price[-displace], fastLength); def slow = expAverage(price[-displace], slowLength); plot signaldown = Crosses(( slow > fast) != 0, 0.5, yes); plot signalUp = Crosses(( slow < fast) != 0, 0.5, yes); signaldown.SetPaintingStrategy (PaintingStrategy.BOOLEAN_ARROW_DOWN); signaldown.AssignValueColor( Color.RED); signalUp.SetPaintingStrategy (PaintingStrategy.BOOLEAN_ARROW_UP); signalUp.AssignValueColor( Color.GREEN); ##################### Retrace Dots ######################### def MA8 = if Crosses(( high >= expAverage(price[-displace], fastLength)) != 0, 0.5, yes) or Crosses(( low <= expAverage(price[-displace], slowLength)) != 0, 0.5, yes) then expAverage(price[-displace], fastLength) else Double.NaN; plot Ma8Dots = if Hide_Dots then Double.NaN else MA8; Ma8Dots.SetDefaultColor(Color.WHITE); Ma8Dots.SetStyle(Curve.POINTS); Ma8Dots.SetLineWeight(Dot_Size); # END
Re: Fun with ThinkScript February 25, 2016 10:18PM |
Registered: 8 years ago Posts: 22 |
What is the best way to set up an ATR scan in TOS? August 28, 2014 07:22AM |
Registered: 9 years ago Posts: 6 |
Re: What is the best way to set up an ATR scan in TOS? August 28, 2014 08:01AM |
Registered: 10 years ago Posts: 615 |
Quote
JxnMStrader
I need some guidance on the specifics of how to do this. I tried doing it but never could get any results. Thanks to all who help others on this board!
Re: What is the best way to set up an ATR scan in TOS? February 27, 2016 06:30PM |
Registered: 8 years ago Posts: 1 |
Re: Fun with ThinkScript February 28, 2016 04:10AM |
Registered: 9 years ago Posts: 60 |
declare lower; input nCCI = 14; input over_sold = -100; input over_bought = 100; input TrendLine = {EMA, SMA, default LRL, WMA, Hull}; input AlertOn = yes; def price = close + low + high /4; def linDev = LinDev(price, nCCI); plot CCI = if linDev == 0 then 0 else (price - Average(price, nCCI)) / linDev / 0.015; plot OverBought = over_bought; plot Midline = 0; plot OverSold = over_sold; def o = open; def h = high; def l = low; def c = close; def NetChgAvg = WildersAverage(c - c[1], nCCI); def TotChgAvg = WildersAverage(AbsValue(c - c[1]), nCCI); def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0; def lowestLow = if CCI > over_sold then 5 else if CCI < over_sold and 5 < lowestLow[1] then 5 else lowestLow[1]; def lowestCCI = if CCI > MidLine then CCI else if CCI < MidLine and CCI < lowestCCI[1] then CCI else lowestCCI[1]; def divergentLow = if CCI < over_sold and 5 <= lowestLow[1] and CCI > lowestCCI[1] then over_sold else Double.NaN; plot DLow = divergentLow; DLow.SetPaintingStrategy(PaintingStrategy.POINTS); DLow.SetLineWeight(2); DLow.SetDefaultColor(Color.YELLOW); def highestHigh = if CCI < over_bought then h else if CCI > over_bought and h > highestHigh[1] then h else highestHigh[1]; def highestCCI = if CCI < MidLine then CCI else if CCI > MidLine and CCI > highestCCI[1] then CCI else highestCCI[1]; def divergentHigh = if CCI > over_bought and h >= highestHigh and CCI < highestCCI then over_bought else if CCI < over_bought and c < o then Double.NaN else divergentHigh[1]; plot DHigh = divergentHigh ; DHigh.SetPaintingStrategy(PaintingStrategy.POINTS); DHigh.SetLineWeight(2); DHigh.SetDefaultColor(Color.YELLOW); CCI.DefineColor("OverBought", GetColor(5)); CCI.DefineColor("Normal", GetColor(7)); CCI.DefineColor("OverSold", GetColor(1)); OverSold.SetDefaultColor(Color.BLUE); OverBought.SetDefaultColor(Color.BLUE); # Alert(AlertCond1, "RSI crossed RSI Trend Line", Alert.Bar, Sound.Bell);
Re: Fun with ThinkScript February 28, 2016 03:15PM |
Registered: 8 years ago Posts: 161 |
Re: Fun with ThinkScript February 28, 2016 08:49PM |
Registered: 9 years ago Posts: 6 |
Current Price Over/Below Yesterdays February 29, 2016 11:54AM |
Registered: 8 years ago Posts: 45 |
Re: Fun with ThinkScript March 01, 2016 02:40PM |
Registered: 9 years ago Posts: 60 |
Re: Fun with ThinkScript March 01, 2016 02:46PM |
Registered: 9 years ago Posts: 60 |
Re: Fun with ThinkScript March 03, 2016 03:41PM |
Registered: 8 years ago Posts: 45 |
script OpenRange { input ORtime = 5; def FirstBar = GetDay() != GetDay()[1]; def RangeTime = SecondsFromTime(0930) >= 0 and SecondsFromTime(0930) < 60 * ORtime; def Rhigh = if FirstBar then high else if RangeTime and high > Rhigh[1] then high else Rhigh[1]; def Rlow = if FirstBar then low else if RangeTime and low < Rlow[1] then low else Rlow[1]; plot h = if RangeTime then Double.NaN else Rhigh; plot l = if RangeTime then Double.NaN else Rlow; } def first30 = SecondsFromTime(0930) >= 0 and SecondsTillTime(1000) >= 0; def today = GetLastDay() == GetDay(); def ATR = Average(TrueRange(high, close, low), 10); plot yHigh = if !today then Double.NaN else high(period = "day" )[1]; yHigh.SetDefaultColor(Color.CYAN); plot yLow = if !today then Double.NaN else low(period = "day" )[1]; yLow.SetDefaultColor(Color.PINK); plot h5 = if !today then Double.NaN else if !first30 then Double.NaN else OpenRange(5).h; h5.SetDefaultColor(Color.YELLOW); plot l5 = if !today then Double.NaN else if !first30 then Double.NaN else OpenRange(5).l; l5.SetDefaultColor(Color.YELLOW); plot h30 = if !today then Double.NaN else OpenRange(30).h; h30.SetDefaultColor(Color.YELLOW); plot l30 = if !today then Double.NaN else OpenRange(30).l; l30.SetDefaultColor(Color.YELLOW); def lowConf = if first30 then Min(yLow, l5) - ATR else Min(yLow, l30) - ATR; def highConf = if first30 then Max(yHigh, h5) + ATR else Max(yHigh, h30) + ATR; plot lc1 = if first30 then lowConf else Double.NaN; lc1.SetDefaultColor(Color.ORANGE); plot lc2 = if !first30 then lowConf else Double.NaN; lc2.SetDefaultColor(Color.ORANGE); plot hc1 = if first30 then highConf else Double.NaN; hc1.SetDefaultColor(Color.ORANGE); plot hc2 = if !first30 then highConf else Double.NaN; hc2.SetDefaultColor(Color.ORANGE); def decisionL = if close > lowConf then Double.NaN else if close crosses below lowConf then low else decisionL[1]; def decisionH = if close < highConf then Double.NaN else if close crosses above highConf then high else decisionH[1]; plot dL = if !today then Double.NaN else decisionL; dL.SetDefaultColor(Color.WHITE); plot dH = if !today then Double.NaN else decisionH; dH.SetDefaultColor(Color.WHITE); def TL = CompoundValue(1, if IsNaN(dL) then Double.NaN else if !IsNaN(TL[1]) then TL[1] else if close crosses below dL then dL - 2 * ATR else Double.NaN, Double.NaN); def SL = CompoundValue(1, if IsNaN(dL) then Double.NaN else if !IsNaN(SL[1]) then SL[1] else if close crosses below dL then dL + 2 * ATR else Double.NaN, Double.NaN); plot Target1Low = if !today then Double.NaN else TL; Target1Low.SetDefaultColor(Color.GREEN); Target1Low.SetStyle(Curve.SHORT_DASH); plot Stop1Low = if !today then Double.NaN else SL; Stop1Low.SetDefaultColor(Color.RED); Stop1Low.SetLineWeight(2); AddChartBubble(IsNaN(TL[1]) and !IsNaN(TL), TL, "Target 1\n" + Round(TL, 2), Color.GREEN, no); AddChartBubble(IsNaN(SL[1]) and !IsNaN(SL), SL, "Stop\n" + Round(SL, 2), Color.RED); def TH = CompoundValue(1, if IsNaN(dH) then Double.NaN else if !IsNaN(TH[1]) then TH[1] else if close crosses above dH then dH + 2 * ATR else Double.NaN, Double.NaN); def SH = CompoundValue(1, if IsNaN(dH) then Double.NaN else if !IsNaN(SH[1]) then SH[1] else if close crosses above dH then dH - 2 * ATR else Double.NaN, Double.NaN); plot Target1High = if !today then Double.NaN else TH; Target1High.SetDefaultColor(Color.GREEN); Target1High.SetStyle(Curve.SHORT_DASH); plot Stop1High = if !today then Double.NaN else SH; Stop1High.SetDefaultColor(Color.RED); Stop1High.SetLineWeight(2); AddChartBubble(IsNaN(TH[1]) and !IsNaN(TH), TH, "Target 1\n" + Round(TH, 2), Color.GREEN); AddChartBubble(IsNaN(SH[1]) and !IsNaN(SH), SH, "Stop\n" + Round(SH, 2), Color.RED, no); def alertup = close[1] crosses above hc1 or close[1] crosses above hc2; def alertdn = close[1] crosses below lc1 or close[1] crosses below lc2; alert(alertup, getsymbol() + " UP", alert.bar, sound.bell); alert(alertdn, getsymbol() + " DOWN", alert.bar, sound.bell);
Re: Fun with ThinkScript March 06, 2016 10:08AM |
Registered: 10 years ago Posts: 143 |
Re: Fun with ThinkScript March 06, 2016 10:41PM |
Registered: 8 years ago Posts: 45 |
Re: Fun with ThinkScript March 08, 2016 08:51AM |
Registered: 8 years ago Posts: 45 |
Scanning for Hammers with current week low being the lowest of past 9 weeks March 09, 2016 09:11AM |
Registered: 8 years ago Posts: 4 |