Re: Fun with ThinkScript January 16, 2019 03:40PM |
Registered: 5 years ago Posts: 1 |
Moving from lower study to price chart January 20, 2019 06:24PM |
Registered: 5 years ago Posts: 1 |
Need help for syntax errror (TOS script) January 19, 2019 11:01PM |
Registered: 5 years ago Posts: 8 |
Moving Avg crossover code needed January 19, 2019 10:40AM |
Registered: 6 years ago Posts: 13 |
Re: Moving from lower study to price chart January 21, 2019 05:14AM |
Registered: 7 years ago Posts: 126 |
Re: I'm having trouble making my slope line change color January 21, 2019 05:31AM |
Registered: 7 years ago Posts: 126 |
input price=close; declare upper; plot SLOPE = 2*close[3] - close[9]; def Cond1= price>slope; def Cond2= price>slope[1]; def Cond3= price>slope[2]; def Cond4= price>slope[3]; #slope will be green when ALL the conditions are TRUE otherwise it will be RED slope.assignvaluecolor( if Cond1 AND cond2 AND cond3 AND cond4 then color.green else color.red); # AND "joins" the conditions
Re: I'm having trouble making my slope line change color January 23, 2019 02:39AM |
Registered: 5 years ago Posts: 8 |
Re: I'm having trouble making my slope line change color January 25, 2019 07:19AM |
Registered: 7 years ago Posts: 126 |
Re: Moving average watchlist with colors and trend January 27, 2019 11:01PM |
Registered: 5 years ago Posts: 5 |
Re: Fun with ThinkScript January 27, 2019 11:12PM |
Registered: 9 years ago Posts: 67 |
inputs: Length(20); vars: srsi(0), srsin(0), k(0); srsin = 0; For k = 0 to Length - 1 Begin Value1 = absvalue(close[k] - open[k]; Value2 = absvalue(high[k] - low[k]; If value2 = 0 then value3 = 0 Else Value3 = value1/value2; srsin = srsin + value3; End; srsi = srsin/length; plot1(0.38); plot2(srsi); plot3(-0.38); plot4(0); If srsi > 0 then Setplotcolor(2,green); If srsi < 0 then Setplotcolor(2,red); If srsi >= -0.05 and srsi <= 0.05 then Setplotcolor(2,yellow); Setplotcolor(1,darkred); Setplotcolor(3,darkgreen); Setplotcolor(4,yellow);
declare lower; input Length = 20; def srsi = 0; def srsin = 0; def k = 0; plot iteration = fold k = 0 to Length - 1; def Value1 = absvalue(close[k] - open[k]); def Value2 = absvalue(high[k] - low[k]); def Value = if value2 == 0 then value3 == 0 else value3 == value1 / value2; def srsin = srsin + value3; def srsi = srsin / Length; plot line1 = 0.38; line1.SetDefaultColor(Color.DARK_RED); line1.HideTitle(); line1.HideBubble(); plot line2 = srsi; line2.AssignValueColor(if srsi > 0 then Color.GREEN else if srsi < 0 then Color.RED else if srsi >= -0.05 and srsi <= 0.05 then Color.YELLOW else Color.GRAY); line2.SetLineWeight(2); line2.HideTitle(); plot line3 = -0.38; line3.SetDefaultColor(Color.DARK_GREEN); line3.HideTitle(); line3.HideBubble(); plot ZeroLine = 0; ZeroLine.SetDefaultColor(Color.ORANGE); ZeroLine.HideTitle(); ZeroLine.HideBubble();
Watchlist with price and trend of simplemoving average January 27, 2019 10:59PM |
Registered: 5 years ago Posts: 5 |
Re: Convertion of Tradestation ELS January 28, 2019 09:19AM |
Registered: 7 years ago Posts: 126 |
# Convertion of Tradestation ELS into Thinkscript # By Rigel , Jan 2019 declare lower; input Length = 20; def srsi=(fold K=0 to length-1 with srsim=0 do (if absvalue(high[k] - low[k])==0 then 0 else absvalue(close[k] - open[k])/ absvalue(high[k] - low[k]))+srsim)/Length; plot line1 = 0.38; line1.SetDefaultColor(Color.DARK_RED); line1.HideTitle(); line1.HideBubble(); plot line2 = srsi; line2.AssignValueColor(if srsi > 0 then Color.GREEN else if srsi < 0 then Color.RED else if srsi >= -0.05 and srsi <= 0.05 then Color.YELLOW else Color.GRAY); line2.SetLineWeight(2); line2.HideTitle(); plot line3 = -0.38; line3.SetDefaultColor(Color.DARK_GREEN); line3.HideTitle(); line3.HideBubble(); plot ZeroLine = 0; ZeroLine.SetDefaultColor(Color.ORANGE); ZeroLine.HideTitle(); ZeroLine.HideBubble();
Re: Watchlist with price and trend of simplemoving average January 28, 2019 09:22AM |
Registered: 7 years ago Posts: 126 |
Re: Watchlist with price and trend of simplemoving average January 29, 2019 12:06AM |
Registered: 5 years ago Posts: 5 |
Re: Conversion of Tradestation ELS January 29, 2019 02:42AM |
Registered: 9 years ago Posts: 67 |
declare lower; input Length = 20; def srsin = 0; plot srsi = (fold k = 0 to length - 1 do (if absvalue(high[k] - low[k]) == 0 then 0 else srsin + absvalue(close[k] - open[k]) / absvalue(high[k] - low[k]) + srsin / Length)); srsi.SetLineWeight(2); srsi.HideTitle(); srsi.AssignValueColor(if srsi > 0 then Color.GREEN else if srsi < 0 then Color.RED else if srsi >= -0.05 and srsi <= 0.05 then Color.YELLOW else Color.GRAY); plot line1 = 0.38; line1.SetDefaultColor(Color.DARK_RED); line1.HideTitle(); line1.HideBubble(); plot line3 = -0.38; line3.SetDefaultColor(Color.DARK_GREEN); line3.HideTitle(); line3.HideBubble(); plot ZeroLine = 0; ZeroLine.SetDefaultColor(Color.ORANGE); ZeroLine.HideTitle(); ZeroLine.HideBubble();
declare lower; input length = 20; def o = open; def c = close; def h = high; def l = low; def k = 0; def v1 = (absvalue(c[k] - o[k])); def v2 = (absvalue(h[k] - l[k])); def v3 = (absvalue(c[k] - o[k])) / (absvalue(h[k] - l[k])); def data = (fold i = 0 to length - 1 with s do s + (if v2 == 0 then v3 == 0 else v3)); def srsin = srsin + v3; plot srsi = srsin / length; srsi.SetLineWeight(2); srsi.HideTitle(); srsi.AssignValueColor(if srsi > 0 then Color.GREEN else if srsi < 0 then Color.RED else if srsi >= -0.05 and srsi <= 0.05 then Color.YELLOW else Color.GRAY); plot line1 = 0.38; line1.SetDefaultColor(Color.DARK_RED); line1.HideTitle(); line1.HideBubble(); plot line3 = -0.38; line3.SetDefaultColor(Color.DARK_GREEN); line3.HideTitle(); line3.HideBubble(); plot ZeroLine = 0; ZeroLine.SetDefaultColor(Color.ORANGE); ZeroLine.HideTitle(); ZeroLine.HideBubble();
Re: Watchlist with price and trend of simplemoving average January 29, 2019 06:20AM |
Registered: 7 years ago Posts: 126 |
simple.assignValueColor(if trendup then color.black else color.white );
Re: Conversion of Tradestation ELS January 29, 2019 06:27AM |
Registered: 7 years ago Posts: 126 |
Re: Conversion of Tradestation ELS January 29, 2019 08:04AM |
Registered: 9 years ago Posts: 67 |
Re: Conversion of Tradestation ELS January 29, 2019 10:45AM |
Registered: 9 years ago Posts: 11 |
Re: Watchlist with price and trend of simplemoving average January 29, 2019 02:59PM |
Registered: 5 years ago Posts: 5 |
Re: Conversion of Tradestation ELS January 29, 2019 10:02PM |
Registered: 9 years ago Posts: 67 |
#intepreted by vimes declare lower; input len = 7; #changed from the setting of 20 per the instructions of the original author def srsin; def value1 = close - open; #code in the article had the absvalue here but then it would never oscillate around 0 def value2 = high - low; def value3 = if value2 == 0 then 0 else value1 / value2; srsin = Sum(value3, len); plot srsi = srsin / len; plot l1 = 0.38 ; #limits from the article, seem arbitrary? plot l2 = -0.38; #limits from the article, seem arbitrary? plot zline = 0; srsi.assignValueColor(if srsi > 0.05 then Color.GREEN else if srsi<-0.05 then color.red else color.yellow); l1.SetDefaultColor(Color.DARK_RED); l2.SetDefaultColor(Color.DARK_GREEN); zline.SetDefaultColor(Color.YELLOW);
Re: Watchlist with price and trend of simplemoving average January 30, 2019 09:00AM |
Registered: 7 years ago Posts: 126 |
Quote
Neoisback
could it not all be done in one script, and show in just one column?
Do the calculation in one script, and then plot the % result in one single column?
Re: Fun with ThinkScript January 30, 2019 10:56AM |
Registered: 5 years ago Posts: 1 |
Re:alert for indicator January 30, 2019 12:13PM |
Registered: 7 years ago Posts: 126 |
Re: Re:alert for indicator February 01, 2019 10:58AM |
Registered: 10 years ago Posts: 465 |
Re: Re:alert for indicator February 01, 2019 11:17AM |
Registered: 9 years ago Posts: 67 |
Re: Re:alert for indicator February 01, 2019 12:21PM |
Registered: 10 years ago Posts: 465 |
double.NaN alternative February 01, 2019 12:24PM |
Registered: 9 years ago Posts: 13 |
Re: double.NaN alternative February 01, 2019 12:58PM |
Registered: 10 years ago Posts: 465 |