Re: Fun with ThinkScript September 22, 2016 01:52PM |
Registered: 8 years ago Posts: 59 |
Re: Fun with ThinkScript September 23, 2016 03:34AM |
Registered: 8 years ago Posts: 22 |
Re: Fun with ThinkScript September 23, 2016 08:00AM |
Registered: 8 years ago Posts: 59 |
Re: Fun with ThinkScript September 26, 2016 07:25AM |
Registered: 9 years ago Posts: 67 |
AddLabel(yes, if long then "GO LONG" else if short then "GO SHORT" else if exit then "EXIT TRADE" else "NO TRADE", if long then Color.UPTICK else if short then Color.DOWNTICK else if exit then Color.YELLOW else Color.GRAY); AddLabel(yes, "LONG STOP: " + STOPlong, if long then Color.UPTICK else Color.GRAY); AddLabel(yes, "SHORT STOP: " + STOPshort, if short then Color.DOWNTICK else Color.GRAY);
Re: Fun with ThinkScript September 26, 2016 12:35PM |
Registered: 8 years ago Posts: 59 |
Re: Fun with ThinkScript September 27, 2016 04:14PM |
Registered: 7 years ago Posts: 2 |
Re: Fun with ThinkScript September 27, 2016 10:43PM |
Registered: 7 years ago Posts: 2 |
Re: Fun with ThinkScript September 27, 2016 11:53PM |
Registered: 10 years ago Posts: 615 |
Quote
charles
I would appreciate some help.
I am trying to 'count' the number of bars between the successive highs and (and also for the lows) of the output.
But now, I don't see how to compute the number of bars between successive highs and also for the Lows using TS built in functions. Anyone know how to do this?
Once I have the number(s), I would like to 'print' the number near each high and low. This does not seem to be possible with ThinkScript. If not possible, perhaps I could put the numbers for the last two Highs in the Label with addLabel, and then the last two Lows in another Label.
Re: Fun with ThinkScript September 28, 2016 03:39PM |
Registered: 8 years ago Posts: 22 |
declare lower; input fastLength = 6; input slowLength = 30; input MACDLength = 5; input averageType = AverageType.EXPONENTIAL; input period1 = AggregationPeriod.WEEK; def Value1 = ExpAverage(close(period = period1), fastLength) - ExpAverage(close(period = period1), slowLength); def Avg1 = ExpAverage(ExpAverage(close(period = period1), fastLength) - ExpAverage(close(period = period1), slowLength), MACDLength); plot Diff = Value1 - Avg1; plot ZeroLine = 0; Diff.SetDefaultColor(GetColor(5)); Diff.SetPaintingStrategy(paintingStrategy.HISTOGRAM); Diff.SetLineWeight(3); Diff.DefineColor("Positive and Up", Color.GREEN); Diff.DefineColor("Positive and Down", Color.DARK_GREEN); Diff.DefineColor("Negative and Down", Color.RED); Diff.DefineColor("Negative and Up", Color.DARK_RED); ################################################################# Diff.DefineColor("Positive and Up above zero", Color.blue); Diff.DefineColor("Negative and Down below zero", Color.blue); ################################################################## Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.Color("Positive and Up" else Diff.Color("Positive and Down" else if Diff < Diff[1] then Diff.Color("Negative and Down" else Diff.Color("Negative and Up"); ZeroLine.SetDefaultColor(GetColor(0));
Re: Fun with ThinkScript September 28, 2016 05:44PM |
Registered: 7 years ago Posts: 2 |
Add Label (Net change or market change) in TOS October 06, 2016 10:21PM |
Registered: 7 years ago Posts: 6 |
Re: Add Label (Net change or market change) in TOS October 07, 2016 05:46AM |
Registered: 10 years ago Posts: 615 |
input symbol1 = "SPY"; def close1 = close(symbol1); AddLabel(yes, Concat(symbol1, Concat(" : ", close1 - close1[1])), if close1 > close1[1] then Color.DARK_GREEN else Color.RED);
Re: Add Label (Net change or market change) in TOS October 07, 2016 06:23AM |
Registered: 7 years ago Posts: 6 |
Re: Add Label (Net change or market change) in TOS October 07, 2016 06:38AM |
Registered: 8 years ago Posts: 61 |
Re: Add Label (Net change or market change) in TOS October 07, 2016 07:12AM |
Registered: 7 years ago Posts: 6 |
Re: Add Label (Net change or market change) in TOS October 07, 2016 08:45AM |
Registered: 7 years ago Posts: 6 |
Re: Add Label (Net change or market change) in TOS October 07, 2016 08:54AM |
Registered: 10 years ago Posts: 615 |
def close1 = close(symbol1, period = "day" );
Re: Add Label (Net change or market change) in TOS October 07, 2016 09:02AM |
Registered: 7 years ago Posts: 6 |
Re: Add Label (Net change or market change) in TOS October 07, 2016 12:37PM |
Registered: 8 years ago Posts: 61 |
Re: Add Label (Net change or market change) in TOS October 08, 2016 08:47AM |
Registered: 8 years ago Posts: 63 |
Quote
Tampman
How about just show both current price and daily change i.e., SPY $215, +$1.32.... etc..
def sym = close("SPY", period="day" ); def symCh = sym - sym[1]; def pos = if symCh > 0 then 1 else 0; addLabel(yes, "SPY $" + sym + ", $" + symCh, if pos then color.light_green else color.pink);
Re: Fun with ThinkScript October 08, 2016 05:06PM |
Registered: 7 years ago Posts: 6 |
Re: Fun with ThinkScript October 08, 2016 11:58PM |
Registered: 7 years ago Posts: 1 |
Re: Fun with ThinkScript October 09, 2016 01:33AM |
Registered: 7 years ago Posts: 8 |
Re: Fun with ThinkScript October 09, 2016 01:30PM |
Registered: 10 years ago Posts: 615 |
Re: Fun with ThinkScript October 09, 2016 02:21PM |
Registered: 10 years ago Posts: 465 |
Re: Fun with ThinkScript October 09, 2016 03:35PM |
Registered: 10 years ago Posts: 615 |
Re: Add Label (Net change or market change) in TOS October 09, 2016 10:27PM |
Registered: 8 years ago Posts: 61 |
Re: Fun with ThinkScript October 10, 2016 11:10PM |
Registered: 8 years ago Posts: 59 |
Re: Fun with ThinkScript October 11, 2016 12:48AM |
Registered: 8 years ago Posts: 63 |
Quote
ACWE
Is there any way for the BID and ASK to float like in the left hand top corner of the price window or perhaps near the latest candle?
Quote
Bid
Returns current value of bid price for current symbol. This function is only available in thinkScript® integration features: Custom Quotes, Study Alerts, and Conditional Orders.
http://tlc.thinkorswim.com/center/charting/thinkscript/reference/Functions/Fundamentals/bid.html
Re: Fun with ThinkScript October 11, 2016 12:50AM |
Registered: 8 years ago Posts: 34 |