· 8 years ago · Jul 14, 2018, 03:32 PM
1------- Monday, July 9, 2018 -------
206:36 Nube: I believe I finally have this working correctly. Moving average calculated at each using price from the end of the higher aggregation period
3# Simple Moving Average - Higher Aggregation
4# Nube
5# trying to make a home grown higher aggregation moving average that calculates each bar.
6# v.0001 7.6.18 first release using EnableApproximation(), plotting from first bar and only plotting up until the most recent aggBar.
7# v.0002 7.7.18 Requires length times aggregationX + 1 bars before plotting and no longer using EnableApproximation.
8# v.0003 7.7.18 Using GetValue(close, 1-aX) instead of close allows all values for that aggregation period to be the close of the last bar of the period instead of the first bar of the period
9# v.0004 7.8.18 No longer requires current higher aggregation period to complete before plotting
10# http://tos.mx/a2k6F1#
11
12input aggregationX = 3;
13input length = 12;
14
15def na = Double.NaN;
16def bn = BarNumber();
17def c = close;
18def aX = aggregationX;
19
20def currentBar = if !IsNaN(c) and IsNaN(c[-1])
21 then bn
22 else currentBar[1];
23def hCB = HighestAll(currentBar);
24def currentClose = if bn == hCB
25 then c
26 else currentClose[1];
27def hiAgg = if GetValue(bn,-1) % aX == 0
28 then bn
29 else hiAgg[1];
30def aggBar = if bn crosses above hiAgg
31 then bn
32 else na;
33def hAB = HighestAll(if bn <= hCB
34 then aggBar
35 else na);
36def aggC = if !IsNaN(aggBar)
37 then GetValue(c, 1-aX)
38 else aggC[1];
39def altC = if bn < hAB
40 then aggC
41 else GetValue(CurrentClose,-aX);
42
43def altAggAverage =
44fold ii = 0 to length * aX-1
45with aa
46do aa + GetValue(altC, ii) / (length * aX-1);
47
48plot
49hiAggAverage;
50hiAggAverage. SetDefaultColor(Color.Yellow);
51hiAggAverage. SetStyle(Curve.Short_Dash);
52hiAggAverage. SetPaintingStrategy(PaintingStrategy.Dashes);
53hiAggAverage = if IsNaN(c)
54 or bn <= length * aX + 1
55 then na else altAggAverage;
5606:44 Nube: Of course I would think of something right after posting. If a user doesn't have an expansion area they may need to use GetValue(CurrentClose,1-aX). Currently the script is going a bar into the expansion area to get the value of currentClose
5707:01 Mobius: Another way to do the same thing - approximate a higher aggregation
58
59input aggregationX = 3;
60input length = 12;
61plot cAtAgg = Average(getValue(c, aggregationX), length * aggregationX)[-(length/2)];
6207:02 Nube: Eh, should have thought twice, it would still going into the expansion area
6307:04 Nube: Well that's certainly a lot simpler.
6407:05 Mobius: I'm just a simple guy
6507:24 Nube: The main purpose of doing that script was to a build a price plot for use as higher aggregation on mobile. Now even that part can be simplified. I did learn though that while there isn't an expansion area to plot in on the mobile app, the data is still there.
6607:37 dime: Gm everyone... I've made a simple script that puts a label on a chart for the % move for the week. Can anyone advise how to change it to show the % price change for the YTD? Or knows of a script already made for that?
6707:40 Paris: dime - here's something Mobius posted 3 years ago
68
69
70# YTD Return
71# Mobius
72# 06.15.2015
73
74declare hide_on_intraday;
75
76input price = close;
77input length = 1;
78input displace = 0;
79input Show_Labels = yes;
80
81def newyear = if getYear() != getYear()[1] then 1 else 0;
82def newmonth = if getMonth() != getMonth()[1] then 1 else 0;
83def yo = compoundValue(1, if newyear then open else yo[1], open);
84def mo = compoundValue(1, if newmonth then open else mo[1], open);
85def yearopen = yo;
86def monthopen = mo;
87def SMA = Average(price[-displace], length);
88def yochange = (sma - yearopen) / yearopen ;
89def mochange = (close - monthopen) / monthopen;
90
91AddLabel(Show_Labels, concat("Year % change = ", AsPercent(yochange)), color.white);
92AddLabel(Show_Labels, "Month % change = " + (AsPercent(mochange)), color.white);
93
9407:45 Nube: morning, JQ et al
9507:46 Paris: dime - yw, I've been keeping track of inteersting scripts since 2014 and maintain it in my own repository.
9607:48 JohnnyQuotron: I recognise that I am likely going to emabarass myself with this question but such is life.
97Why am I seeing 127 in the Lime Label and 125 in the Pink? 6 month daily iwm chart
98def RTHstart = SecondsFromTime(930) == 0;
99def daysOnChart = if RTHstart then daysOnChart[1] + 1
100 else daysOnChart[1];
101AddLabel(1, "Days on Chart: " + daysOnChart, Color.Lime);
102
103def vTest_Start = SecondsFromTime(0930) == 0;
104def vTestOnChart = if vTest_Start then vTestOnChart[1] + 1
105 else vTestOnChart[1];
106AddLabel(1, "vTestOnChart: " + vTestOnChart, Color.pink);
10707:49 JohnnyQuotron:
108
10907:54 Mobius: Johnny - Why would you think there's a difference? There is a very logical reason for it
11007:55 Mobius: actually logical reason. Since something is eiher logical or not and there isn't a degree to it
11107:57 JohnnyQuotron: mobius.. two identical scripts but for the variable names. each offering a different result? I wrestled with this for half an hour yesterday and came up blank. I will wrestle some more. Ouch.
11207:58 Mobius: The functions used are not identical
11308:00 Nube: I cannot tell a lie. I would never have figured that out.
11408:00 Farmin: logic fails me
11508:02 nextrade: tough for grammar too smart-er stupid-er logical-er
11608:07 JohnnyQuotron: OK.. rewrote it. straight copy paste just added a "2" to the variable names in the second iteration...
117# Days On Chart
118# Mobius
119def RTHstart = SecondsFromTime(0930) == 0;
120def daysOnChart = if RTHstart then daysOnChart[1] + 1
121 else daysOnChart[1];
122addLabel(1, "Days on Chart: " + daysOnChart, color.cyan);
123
124# Days On Chart
125# Mobius
126def RTHstart2 = SecondsFromTime(0930) == 0;
127def daysOnChart2 = if RTHstart2 then daysOnChart2[1] + 1
128 else daysOnChart2[1];
129addLabel(1, "Days on Chart2: " + daysOnChart2, color.pink);
130
131
132if I comment out the second iteration of the script the cyan label changes to 125 from 127. HInt please....
13308:10 JohnnyQuotron: BBL..clearly need more coffee :)
13408:10 simone_landi: hello guys is there anybody in here how can modify an existing study? I want to be able to add the open, high and low line to the accdist study
13508:17 Mobius: Johnny - Now index your starting point using compoundValue().
13608:18 Mobius: You know there are only 124 bars on a 6 month chart so it's not possible to have more than that in RTH openings
13708:22 Farmin: if you put a 3rd instance in the code, it will report a value of 2 less than the previous, a fourth instance - 2 more
13808:22 Farmin: with enough labels, there won't be any days on the chart
13908:29 Mobius:
140# Days On Chart
141# Mobius
142def RTHstart = SecondsFromTime(0930) == 0;
143def daysOnChart = if RTHstart
144 then compoundValue(1, daysOnChart[1] + 1, 1)
145 else daysOnChart[1];
146addLabel(1, "Days on Chart: " + daysOnChart, color.cyan);
147
148# Days On Chart
149# Mobius
150def RTHstart2 = SecondsFromTime(0930) == 0;
151def daysOnChart2 = if RTHstart2
152 then compoundValue(1, daysOnChart2[1] + 1, 1)
153 else daysOnChart2[1];
154addLabel(1, "Days on Chart2: " + daysOnChart2, color.pink);
155
15608:30 simone_landi: was this for me?
15708:32 Farmin: no, but you'll have to better explain your request, putting OHL on AccDist doesn't seem to make sense.
15808:35 DMonkey: simone....to modify a built in study ...just right click on it....click on duplicate and it will open a copy that you can modify and rename.....
15908:36 simone_landi: thank you guys for answering
16008:37 simone_landi: what i want to do is simply add OHL lines to the accdist study having a 1 min chart
16108:37 simone_landi: but i do not know how to code
16208:38 Mobius: simone.. The Open, High and Low values are all out of range of the AccumDist Study Values
16308:38 TroyX: GM Everyone.... Mobius,Would you or anyone here happen to have an Upper study version of your (True Momentum Oscillator) with Signals and willing to share?
16408:38 Mobius: simone.. Do you mean the Open, High and Low of the AccumDist Study Values themseves??
16508:39 simone_landi: yes
16608:40 simone_landi: instead of dooing that myself with the drowing set
16708:40 simone_landi: it would be so much easier and time saving if i had the accdist study to do it by itself
16808:40 simone_landi: when switching btween simbols
16908:41 simone_landi: for instance if you look at MBVX
17008:41 Farmin: CloseLocationValue() is a new one on me...
17108:42 simone_landi: yday there were +333k as of the last print of the day
17208:42 simone_landi: now there are 1.5M
17308:42 simone_landi: as of right now
17408:42 Mobius: Troy.. Do you want the oscillator to plot on the upper chart or the equivelant line as a moving average?
17508:44 Mobius: By the way - I've shorted the open at 2778. GlobeX volume is 41% below avg . I think we'll retrace - stop is HOD
17608:48 TroyX: Id like it to plot on the upper chart Mobius.
17708:49 TroyX: The Oscillator that is*
17808:54 Nube: I'm still not understanding why two variables with the same calculation would impact each other.
17909:00 Slayer8197: Does (H+L)/2 repaint?
18009:00 pennyplayer: LBIX vol
18109:03 Farmin: nube, my guess is that multiple calls to SecondsFromTime() don't act like we might assume they do.
18209:04 Farmin: if true, may not bode well for other studies
18309:06 Mobius: simone -
184
185# AccumDist with AccumDist - OHL lines
186# Mobius
187# Chat Room Request 07.09.2018
188
189declare lower;
190
191def data = if close > close[1] then close - Min(close[1], low) else if close < close[1] then close - Max(close[1], high) else 0;
192
193plot AccDist = TotalSum(data);
194AccDist.SetDefaultColor(GetColor(1));
195def today = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and
196 GetTime() <= RegularTradingEnd(GetYYYYMMDD());
197def x = barNumber();
198def nan = double.nan;
199def openBar = if today and !today[1]
200 then x
201 else nan;
202def o = if x == HighestAll(openBar)
203 then AccDist
204 else o[1];
205def h = if today and !today[1]
206 then AccDist
207 else if today and AccDist > h[1]
208 then AccDist
209 else h[1];
210def hx = if AccDist == h
211 then x
212 else nan;
213def l = if today and !today[1]
214 then AccDist
215 else if today and AccDist < l[1]
216 then AccDist
217 else l[1];
218def lx = if AccDist == l
219 then x
220 else nan;
221plot OLine = if x >= highestAll(openBar)
222 then o
223 else nan;
224plot hLine = if x >= highestAll(hx)
225 then h
226 else nan;
227plot lLine = if x >= highestAll(lx)
228 then l
229 else nan;
230AddVerticalLine(x == highestAll(openBar), "open", color.cyan);
231# End Code
232
23309:07 Nube: Farmin, I didn't think of the magic behind the curtain
23409:08 Mobius: Slayer - Sure if the High or the Low change the product of dividing them changes
23509:10 Mobius: First target hit 2744 RO
23609:10 Mobius: 2774 that is
23709:12 Mobius: Stop on runner is now entry 2778. I suspect I'll get stopped out. Opening trades like that don't usually go a long way for me.
23809:12 Mobius: But you never know
23909:15 Farmin: even more interesting, the compoundValue answer is different than all the others
24009:16 bigworm: so i re read my text book on johansen and engle and granger tests this weekend mobius since my math skills are better than when i took the tine series course and i came away with a fee questions. one, do you test for significance on the constant (if included) in the cointegration vector if you find the pair to be stable at your required level, and do you use pairs that one might have a speed of an adjustment of zero on your ECM? seems like you would avoid pairs that were weakly exogenous.
24109:16 Slayer8197: Any reliable moving averages that don’t repaint that could actually be considered accurate close to a hull moving avg? I’m not sure if possible since it’s changing during the bar depending on close, etc
24209:18 bigworm: question was for you mobius :)
24309:19 bigworm: im on mobile please excuse typos
24409:20 Farmin: huh? what MAs repaint?
24509:22 Slayer8197: Well I m an by crossovers yo iWork get a cross then it will uncross during the bar probably only way is too wait for bar to close
24609:23 Nube: Slayer, the average changes any time the current price changes. It would have to know the future to not repaint
24709:26 DMonkey: slayer....index 1 bar back if you dont want the current floating value
24809:40 Nube: Farmin, that function changing each time it's called is giving me a headache.
24909:42 Nube: Or perhaps more accurate, each synchronous call.
25009:45 garen5660: hey mobius, I ran into what you were talking about last week with highest(high,3) constantly running from current bar. What function did you say is a good one to use to lock it at a set bar or time?
25109:45 Farmin: If you want to feel slightly better about it, on a 30m chart all seems to be well.
252
25309:52 Nube: Farmin, thank you. That at least gives me some idea of where to start.
25410:00 Nube: garen, high[1] is 1 bar back
25510:09 Paris: JQ - I learnt from BLT several years ago that if you see strange results in the output, it's best to use CompoundValue(), this is what Mobius was using.
25610:11 Paris: JQ - I looked at my past notes - here is some words of wisdom from NickName NAG - it is very useful tip
257
258Nick Name NAG®: You use CompoundValue() to start something after some number of bars, or initialize something with a specific value, or both. Usually you don't need it. Occasionally you may find something not initializing correctly, in that case use CompoundValue() to specify the start value.
25910:15 Farmin: Part of the problem is the use of a time function on a daily chart. Nonetheless, the behavior is odd.
260
261
262
263
264
265
266
267
26811:02 Mobius: # Time Bracketed Volume
269# Mobius
270# Chat Room Request
271
272declare hide_on_daily;
273
274input Begin = 0430;
275input End = 1600;
276
277def v = volume;
278def Active = SecondsFromTime(Begin) >= 0 and
279 SecondsTillTime(End) >= 0;
280def vS = if Active and !Active[1]
281 then v
282 else if Active
283 then vS[1] + v
284 else vS[1];
285addLabel(1, "Volume = " + vS, color.white);
286# End Code
287
28811:03 Mobius: You can NOT count the volume on a Daily Aggregation using intraday values if that's what your attempting to do
28911:03 garen5660: yes ty
29011:03 garen5660: I want to count volume by hours but I didn't know how to tell it to only look between a certain time frame
29111:04 garen5660: I'll figure it out with your code though, ty
29211:04 Mobius: the above code does exactly that
29311:05 garen5660: I'm also messing with custom strategies but running into the same issues. I trade from 3D fibs but every D candlestick changes the fibs lol
29411:05 Mobius: fibs based on the high, low of 3 days?
29511:06 garen5660: yes
29611:07 Mobius: That can be done. But tell me what is important about 3 days.
29711:07 garen5660: but the fibs update every new candlestick and I want them locked on my orderType.BUY_TO_OPEN
29811:10 garen5660: I have a scanner that finds stocks that move from 90% fib range to below 23% fib range in 1 day. They usually go green hard the next day. Or you can find double bottoms using the fib scanner and go long. Or find stocks that went from 21% to above 80% and closed, but didn't make new highs and are hitting resistance. usually the longs take their profits and it's a short for the day
29911:10 garen5660: it's basically a 3D range trade
30011:13 Mekka7: Does anyone know how to create a script that automatically displays the Probability of Loss for a trade combo ? I can view the p(Loss) on a Risk Profile but I need to automatically run the same analysis across a basket of underlyings.
30111:14 Mobius: garen...
302
303# 3 Day High and Low
304def hD = high(Period = "DAY");
305plot hh = Max(hD, Max(hD[1], hd[2]));
306def lD = low(Period = "DAY");
307plot ll = Min(lD, Min(lD[1], lD[2]));
308
30911:19 Mobius: Mekka - I think what your looking for is the Implied Move of an underlying which can tell you the probability of being either in or out of the money at any particular strike
31011:24 SwingTradeMonkey: Back to drawing board. LinearregressionSlope does not provide a slope value. It appears to provide a price value. I need the Slope , or more specifically, the ANGLE OF THE LINEAR REGRESSION line over time. Sill looking for a study that does this, but any clues pointing me in the right direction would be appreciated!
31111:24 garen5660: mobius what does the exclamation do in !Active[1]
31211:26 UpTheCreek: somebody really should read the manual http://tlc.thinkorswim.com/center/reference/thinkScript/Operators/Logical.html
31311:27 Mekka7: @Mobius, ok Yes that sounds right but only for a single/simple position. I use overlayed positions to construct arbitrary Risk profiles (e.g. short stock, 2 long calls). So things are not so simple to analyze. I can study the Risk Profile visually but I need to run the exact same analysis/setup across MANY MANY underlyings to get an idea of the best ones to trade (i.e. the ones with the lowest p(Loss) )
31411:31 garen5660: i know ! means not true but I dont code so don't really know what that means for thinkscript. his code is referencing itself from yesterday to not be true. I don't follow the logic
31511:35 UpTheCreek: that's why you should read the manual and do the tutorials. just sayin;
31612:03 garen5660: mobius that code doesn't return the correct volume. I threw it into a custom qoute and it's not returning volume. maybe I'm doing something wrong or missing something. I edited it to this and now it returns the volume
317
318input Begin = 0430; #hint rBegin: Beginning Time of Range.
319input End = 1600; #hint OrEnd: Ending Time of Range.
320
321def v = volume;
322def Active = SecondsFromTime(Begin) >= 0 and
323 SecondsTillTime(End) >= 0;
324def vS = if Active #and !Active[1]
325 then v
326 else if !Active
327 then vS[1] + v
328 else vS[1];
329
330plot x = vS*0.000001;
33112:07 Mobius: garen.. The reason it wasn't returning for you is that you were using a DAILY aggregation instead of a 1min aggregation. What you've done now is just plot the daily volume while it's active and nothing when not.
33212:08 Mobius: PEBKAC error
33312:08 Mobius: or user I.D. 10 T. error
33412:09 garen5660: doh
33512:14 garen5660: hmm, redid it to 1min but it's still not returning the premarket volume. https://imgur.com/U2mzzSI
33612:16 AlphaInvestor: check - show extended hours, and begin aggregation at market open
33712:17 Nube: what time is premarket and what time does that script use?
33812:18 garen5660: extended hour is already checked but I don't see a "begin aggregation at market open"
33912:20 AlphaInvestor: Garen - there is one for each of Equities, Futures, Options, Forex
34012:20 UpTheCreek: he's not on a chaeert
34112:20 UpTheCreek: chart
34212:21 garen5660: na this is just custom qoutes, scanners and custom strategies
34312:21 garen5660: I'm testing the returns in quotes right now
34412:22 Nube: What time is premarket?
34512:24 garen5660: earliest trading is 4:30am on some routes
34612:24 deadbones: TWTR clarifies
34712:25 deadbones: Some clarifications: most accounts we remove are not included in our reported metrics as they have not been active on the platform for 30 days or more, or we catch them at sign up and they are never counted.
34812:25 Nube: what time does premarket end?
34912:26 garen5660: on opening bell, 9:30
35012:27 Nube: and the times the script is using?
35112:27 jeff2018: Creek or any other pro, please help with the following:
35212:27 jeff2018: def PH = (high[2] <= high[1] and high[1] <= high[0] and high[0] >= high[-1] and high[-1] >= high[-2]) ;
353How to refer the price values of the point that meets above condition?
35412:29 AlphaInvestor: Jeff high[-2] is two bars into the future
35512:30 Nube: I would just use Mobius Fractal Support and Resistance and set the input to 2
35612:32 jeff2018: Hi, Alpha, I am able to plot the condition as 1 or 0 for patt data. The -2 or -1 can be changed. I wonder how to record the price level when the above condition is met.
35712:32 Nube: Jeff, with an if then statement
35812:32 Nube: if allthatstuff then Barnumber else PH[1]
35912:33 jeff2018: Thanks, Nube. I'll try that.
36012:33 Nube: followed by if barnumber is equal to PH then price else variablename[1]
36112:34 jeff2018: Thanks a lot.
36212:35 trader-john123: does anyone know of a good rs divergent study that indicates when the divergence between price and rs is occurring.
36312:38 AlphaInvestor: Nube - thats a roundabout way to do that. Just this prob works
364def PHclose = if PH then close else double.nan;
36512:40 TroyX: Hey Mobius, sorry to bother you again, Are you planning on creating a Upper study version of your True Momentum Oscillator in the future?
36612:40 Paris: trader-john - here are some notes on divergence that Mobius had posted some years back when someone asked almost the exact same query
367
368Mobius: The only divergence with statistical relevance I've ever been able to prove is volume divergence. When volume decreases substantially below 10% of a percentR, a trend change is about to happen from a high to a low and when volume %R hits a high while price is declining the trend is about to change and go up. I've never been able to substantiate any other form of divergence and would love to see someone who has facts otherwise.
369
370All that’s needed for any divergence study are 4 steps
371
3721) Indicator making lower high while price is making higher high
3732) identify the highest high (fractal high) in the series
3743) capture the barNumber() for the fractal high in each case
3754) plot a line between highs of the captured bars.
376
377For the reverse condition (divergent low) do the opposite
37812:46 Mobius: Troy - Add a plot to create a boundary line. set it to about 10 to begin. Then drag the study to the upper chart and it will plot at the bottom of the chart. If it's plotting to high increase the boundary line, too low and decrease the boundary
37912:51 Mobius:
380# Volume Percent R
381# Mobius
382# V01.01.2015
383#hint: Extreme Volume plots as grren bars. Changes in trend are often preceded by larger volume clusters. Look for Green and Yellow bars before a trend change.
384
385declare lower;
386
387input length = 20;
388# Variables
389def v = volume;
390def Hv = highest(V, length);
391def Lv = lowest(V, length);
392# Plots
393plot VR = ((V - Lv) / (Hv - Lv));
394VR.SetPaintingStrategy(PaintingStrategy.Histogram);
395VR.SetLineWeight(5);
396VR.AssignValueColor(if VR >= 1
397 then Color.Green
398 else if between(VR, .7, 1)
399 then Color.Yellow
400 else if VR <= .1
401 then Color.Red
402 else color.Blue);
403plot zeroPercR = if VR <= .01
404 then 0
405 else double.nan;
406zeroPercR.SetPaintingStrategy(PaintingStrategy.Points);
407zeroPercR.SetLineWeight(3);
408zeroPercR.SetDefaultColor(Color.Red);
409plot LR = inertiaAll(VR);
410LR.AssignValueColor(if LR < LR[1] then color.red else color.green);
411
412# To plot on the Upper Chart Uncomment the following two lines and set HighBound Color to your current background color
413#plot highBound = 1;
414#highBound.SetDefaultColor(Color.Black);
415# End Code VPR
416
41712:51 Mobius: no big... when?
41812:55 bigworm: it was earlier... I was just saying that I re-read my text on johansen and engle and granger this weekend because I feel I skimmed over some areas. I was wondering 1) if you do inference on the cointegration vector in particular the constant (if added) to see if its significant if you find the pair is stable at a high level, and 2) do you disgard pairs that one leg has no speed of adjustment in the ECM? seems like you would want to get rid of something weakly exogenous if one pair corrects and the other doesnt.
41912:55 Slayer8197: Mobius does the zero lag moving averages from your study repaint?
42012:56 Nube: While the current bar is forming, yes.
42112:58 UpTheCreek: slayer if you absolutely don't want changing values, then do as DMonkey instructed and use a closed bar.
42212:59 Mobius: Slayer.. define repaint.
42313:00 Slayer8197: I’m sure they do but 2 zero lag ma crossing can uncross again on same bar
42413:01 Mobius: big.. yes and yes. However, My initial run is at min 2yrs of data. Secondary runs are never less than 6months. So the pairs I trade have long histories of stability
42513:02 Mobius: Slayer ALL indictors of ANY kind will change values in the current forming bar.
42613:02 bigworm: as of right now I have it set up to have initial scan of 252 days and then when it enters its 60 days but I think I might change that 60 day.
42713:02 bigworm: do you test every entry for the short term of 6 months when a signal is generated
42813:05 Mobius: yes - my strategy signals 60, 20, and then the avg day period of the last 3 trade lenghts
42913:06 josephmetzger: hi can anyone answer this please... does thinkscript have the ability to create a custom stochastic? and if so is it also capable of creating a regression of said custom stochastic? can anyone show me what the code would look like and i can take it from there?
43013:06 bigworm: for the z score calcualtion correct?
43113:07 Mobius: yes
43213:08 bigworm: thanks alot. its nice to be able to confirm with someone what I read or what I am thinking. There really isnt alot out there on this stuff other than the texts for use of this in econometrics.
43313:09 Mobius: joseph.. What sort of Stochastic. Stochastic is just where price is within a high and low percentage
43413:10 bigworm: so to confirm the correct process for a johansen test is as follows:
43513:13 josephmetzger: it uses obv, money flow on a cumulative basis over the past 14 days
43613:13 josephmetzger: 0 to 100
43713:13 UpTheCreek: joseph, have you looked at the built in stochastic and linear regression built in codes?
43813:13 bigworm: 1)test for difference stationary to ensure I(0) for both assets 2) if same difference test for johansen rank of cointegrating vectors with 1 lag (disregard if a pair shows 2 vectors) 3) if signifanct look at residuals to ensure no autocorrelation 4) do inference on the cointegrating vecotor constant ( if it was added) 5) check ECM to see if speed of adjustment on one asset is zero and disregard if it is) and lastly check to ensure the scaled data with the cointegrating vector is stationary?
43913:14 josephmetzger: yes
44013:15 Mobius: joseph - if you want to smooth the product of an existing study then use the ThinkScript Function inertia()
441Example:
442
443plot LR = inertia(Stochastic, 10);
44413:16 josephmetzger: ok so after i create the stochastic i would simply place the name of it in place of "stochastic to look like this: inertia(name,10);
44513:18 Mobius: big.. I'd say that sums it fairly. Although you'll find it easier in reality to test for stationary than that makes it seem
44613:18 Mobius: joseph... yes
44713:18 josephmetzger: thanks
44813:19 bigworm: yeah ive noticed that...especially with stocks. I just want to ensure every step I make is the absolute correct way.
44913:41 razorbackfan: How would anybody do a scan looking for a trend when price moves above the high of the previous 2 calendar weeks high
45013:42 AlphaInvestor: close > highest(high[1],10)
45113:43 AlphaInvestor: that isn't 2 calendar weeks but is 10 trading days
45213:43 Mobius: ^^^ Using a Daily Aggregation
45313:43 razorbackfan: Thank you
45413:43 AlphaInvestor: what he said
45513:45 Mobius: In this market a 2 week high is more likely a pivot high and you'd be buying at the top.
45613:45 razorbackfan: That's my luck. I appreciate everyone's help
45713:48 AlphaInvestor: Mobius - well if we don't have other suckers buying at tops ... how are we going to make money?
45813:50 JohnnyQuotron: Thank you all for the assistance with my label issue. There was no way I was going to figure that one out. Clearly I need to write something in my education tab for this oddity. I not even sure how to title the page though. Thank you all again !!!!!!
45913:53 razorbackfan: i have been called lots of things maybe a sucker is compliment to many of them. LOL
46013:54 bigworm: last question mobius. I have asked this before but I am wanting to know what you do instead of what advice you give. Do you calculate your share size on the ECM since you go through the trouble of ensuring that the speed of adjustment isnt zero instead of calculating the share size of the beta compared to sp500 index? You had said there isnt much of a difference between the two but I know you probably do things differently than what you say for sake of simplicity when explaining this to people.
46113:58 AlphaInvestor: Razor - not meant to disparage you, just making a joke
46214:03 bigworm: version 2 is coming along well alpha
46314:03 UpTheCreek: JQ, I think the biggest takeaway is not to use time based funtions on a daily chart
46414:04 AlphaInvestor: Big - great
46514:04 bigworm: ill send you a copy when its all done, but I thought maybe you could give me some input on something.
46614:04 AlphaInvestor: I can try
46714:06 bigworm: I have been using bollinger bands for entry which can be used with intraday data. calculating a zscore off the daily closes is using a slower and faster moving average is all of daily data so is the zscore on the entry. Any idea how I can make it more accurate with 5 min data on entry that I have? seems like I have to use the close values of the daily bars
46814:07 bigworm: which programming wise, would be alot easier
46914:07 DTrading: does anyone have a vwap code for 9.30 to 16.00?
47014:12 AlphaInvestor: Big - not quite understanding the question. I don't think a lower aggregation Zscore would match the aggregation of your Mean Reverting pairs decision
47114:13 bigworm: right that is what i was saying. right now using bollinger bands I can signal an entry intraday with my 5 min data which makes it more precise with its entries and exits, but switching to z score I cannot do that because its all calculated off the average
47214:14 bigworm: I think im going to have to just use daily data
47314:14 bigworm: if my strategy falls apart just because of intraday then its probably not a good strategy anyway
47414:15 TroyX: Hello Mobius, would there be a way to use your TMO study just like the Fw_Mobo_basic. The TMO seems to be alot more accurate .
47514:15 AlphaInvestor: Big - I make desisions off of one aggregation of data, I pick entry and exit points using another aggregation
47614:16 bigworm: ok yeah I think it has to be daily for the current z score
47714:17 AlphaInvestor: so, if that is the case. Have a 2 aggregation Grid - Zscore on one at daily. Other incicators on 5' for entry/exit
47814:17 bigworm: no way to signal intraday unless its realtime
47914:18 bigworm: well that is what I was wanting but all z score is calculated on close of bar on daily
48014:18 bigworm: so it will only signal entries and exits on the close of the day so the 5 min bar will equal the daily data
48114:21 razorbackfan: That's how I took it. I greatly appreciate what all of the leaders, such as yourself, in this chat room. They are a great benefit to the rest of us as we continue to learn.
48214:26 mikesa69: Hello. I'm trying to add a pivot & value area study from ShadowTrader to one of my charts. When I click to edit studies I don't see anywhere to post a url, only to choose from files on my computer. The url I'm trying to read in is http://tos.mx/Wlf7ky. I'd appreciate it is anyone here could kindly point me in the right direction. Thanks!!!
48314:28 SwingTradeMonkey: Anyone know if there is a limit to how many "Custom Quote" can be exported to excel for use with the RTD function. I added a new one today, and when I paste the field to Excel, it just returns nothing, instead of returning the value I see in my scan result. any else see this issue?
48414:28 SwingTradeMonkey: ^anyone else
48514:33 AlphaInvestor: Swing - only the first 19 built-in custom quotes can be read by RTD. TOS allows a total of 99 custom quotes
48614:33 TroyX: Mike I think one of the letters is incorrect in the url. it should be http://tos.mx/Wlf7ky
48714:34 AlphaInvestor: Mike - copy the last 6 characters, open it under Setup - Open Shared Items ...
48814:43 mikesa69: Thank you both very much, TroyX and AlphaInvestor!! Looks like I did indeed mis-type the url as tox.mx rather than tos.mx. Seems to be working now and I thank you both very much for the replies.
48914:56 Nube: MTS1, did you ever get that multiple aggration cross script {} issue figured out? I think I remember having that problem once myself and never figured it out.
49014:59 Mobius: big.. If your going to use TOS to pairs trade. Use the Pairs Trader Tab and here is a Pairs Zscore Study put one at 5min and one at daily. When the Daily signals turn to the 5min for best entry
491
492# Z Score for Pairs Trading
493# Mobius
494# V01.07.08.2012
495
496declare lower;
497
498input n = 21;
499input n2 = 5;
500
501
502def Symb1 = close(getSymbolPart(1));
503def Symb2 = close(getSymbolPart(2));
504def meanL = Average(Symb1 - Symb2, n);
505def meanS = Average(Symb1 - Symb2, n2);
506def SD = stdev(Symb1 - Symb2, n);
507
508plot Z_score = (meanS - meanL) / SD;
509 Z_score.SetStyle(curve.firm);
510 Z_score.SetDefaultColor(color.cyan);
511plot zero = if isNaN(close) then double.nan else 0;
512 zero.SetStyle(curve.firm);
513 zero.SetdefaultColor(color.gray);
514 zero.hideTitle();
515 zero.hideBubble();
516plot Upper = if isNaN(close) then double.nan else 1;
517 Upper.SetStyle(curve.firm);
518 Upper.SetDefaultColor(color.red);
519 Upper.hideTitle();
520 Upper.hideBubble();
521plot Lower = if isNaN(close) then double.nan else -1;
522 Lower.SetStyle(curve.firm);
523 Lower.SetDefaultColor(color.green);
524 Lower.hideTitle();
525 lower.hideBubble();
526addcloud(Upper, Z_score, color.current, color.red);
527addcloud(Z_score, Lower, color.current, color.green);
528
529
53015:09 bigworm: ok thanks mobius !
53115:31 JohnnyQuotron: Clearly I sold my Friday's SPY strangle too early today. :( Still working on the scan..
53215:32 JohnnyQuotron: ignore "my" sorry
53315:50 Nube: I have you beat, Johnny. I was long XLU today.
53415:53 AlphaInvestor: I think somebody has been warning about holding utiltiies in a rising rate environment for months
53516:15 AlphaInvestor: read an article this weekend that the FED is looking at replacing the old die hard 10-2 Yield Curve spread as a recession probabiltiy measure. To be possibly replaced by the Near-Term Forward Spread
53616:15 Nube: Some have warned of it for years, but a trade is a trade is a trade to me.
53716:16 Nube: That might be a good a decision on their part
53816:16 AlphaInvestor: http://tos.mx/v5A70s
539
54016:18 AlphaInvestor: Two articles to go along wtih the study that I built
541"The Fed is thinking about throwing out a key recession indicator" and "(Don't Fear) The Yield Curve"
54216:21 Nube: Yeah, fat chance we aren't going to watch the curve
54316:23 AlphaInvestor: I will watch the yield curve, but I will watch this too
54416:28 Nube: It does make sense to watch forwards, but the curve is to so I dunno. I'm sure they did their homework.
54516:44 Mobius: I've sat in a number of board meetings. There's an awful lot of "I don't know, what do you think?" "Well I just don't know, what do you think?" Well it seems to me we should do this." "Ok sounds good. Let's do that. All in favor say Aye."
54616:45 Vimes: lol
54716:45 paulw: Excuse me, I haven't been here before. Is there anyway to create in thinkscript, a watchlist custom list of columns which would appear by default when I create a new watchlist. There are about 4 fields I always need to add manually, and with this method it would let me have a consistent appeance in all my watchlists. Thanks, Paul W
54816:46 UpTheCreek: thanks for shattering my loosely held illusion that executives know what they are doing
54916:48 UpTheCreek: Paul, thinkScript controls what goes into a column, not what columns are in various lists
55016:48 Vimes: paulw - for your current watchlist you will find the tiniest little gear icon in the right hand corner - click that and you can customize the layout including custom quotes
55116:50 Nube: The story about how they came up with the $700 billion number for TARP sounds like a board meeting then
55216:51 paulw: OK thanks Vimes, I do use that gear to customize the watchlists. I was seeing if there is anything akin to the Style Set concept in charts that lets a watchlist be tailored from a user-defined list of fields. Thanks also to you UpTheCreek.
55316:53 FrankB3: I know I'm a little slow: the # Z Score for Pairs Trading, does not show up on chart >????
55416:55 Mobius: Frank.. It MUST be used in the Pairs Trader Window ONLY
55516:56 FrankB3: ok, thanks,,, Mr. Mo
55616:56 Mobius: yw
55716:59 FrankB3: never traded a pair, soulds like the daily double
55817:03 bigworm: mobius have you ever tried bollinger bands for pairs? it seems like (for XEL and CMS) that it performs better than using the way you have normalized a z score.
55917:04 bigworm: maybe on average z score outperforms though
56017:12 Mobius: yes I do use standard deviation bands.
56117:13 bigworm: but not applied directly to the daily spread without normalizing?
56217:21 Mobius: big.. if I'm looking through pairs on a chart then I prefer these bands
563
564# Mobius Bands
565# V01.02.2013
566
567input x = close;
568input n = 20;
569
570script mean
571 {
572 input x = close;
573 input n = 20;
574 plot m = (1/n)*sum(x,n);
575 }
576def TR = max(high, close[1]) - min(low, close[1]);
577def ATR = mean(TR,n);
578plot m = mean(x,n);
579 m.SetDefaultColor(Color.Cyan);
580def d = (1/n)*sum(AbsValue(x-m),n);
581plot upper = m + (2*d);
582 upper.SetDefaultColor(Color.Green);
583plot lower = m + (-2*d);
584 lower.SetDefaultColor(Color.Green);
585plot ATRupper = m + (1.5*ATR);
586 ATRupper.SetDefaultColor(Color.Red);
587plot ATRlower = m + (-1.5*ATR);
588 ATRlower.SetDefaultColor(Color.Red);
589addCloud(if lower > ATRlower then ATRlower else double.nan, ATRupper);
590addLabel(upper < ATRupper, "Squeeze");
591# End Code
592
59317:22 bigworm: ok thanks mobius.
59417:22 Mobius: yw
59517:26 Vimes: bigworm are you using a product like Matlab in your analysis mentioned earlier?
59617:28 bigworm: no
59717:28 bigworm: python bridged with R
59817:28 Vimes: thx
59917:30 Nube: Should rename those to Mobius Band to see if people can be tricked into thinking there's only one of them
60017:30 bigworm: lol thats how i saved it in the script
60117:36 Brainfill: Need some help on the following code:
602I have created a study on a 15-minute chart that will draw a line at the high, at a specific time. This study works fine, as it correctly draws the line at the high of the inputed time.
603
604The study is as follows:
605
606#High at Specific Time
607#Brainfill....June 2018
608
609def tDay = GetDay() == GetLastDay();
610input time = 1105;
611
612def timeH = if tDay and SecondsFromTime(Time)[1] < 0
613 and SecondsFromTime(Time) > 0
614 then High
615 else timeH[1];
616
617Plot sHigh=timeH;
618sHigh.SetDefaultColor(color.Light_Orange);
619sHigh.SetPaintingStrategy(PaintingStrategy.Dashes);
620
621
622However, when I change the coding to attempt a line at the high which would be the high between two time periods…9:30 and 11:00, it draws the line at the high of the first 15-minute bar rather than the high between the inputed time periods. Any ideas of what needs to change in the code? Thanks.
623
624Here is the attempted code for a time range:
625
626#High...between 9:30 & 11:00
627def tDay = GetDay() == GetLastDay();
628input TimeBegin = 0930.0;
629input TimeEnd = 1100.0;
630
631def rangeH= if tDay and secondsTillTime(TimeEnd) > 0
632 and secondsFromTime(TimeBegin) <= 0
633 then High
634 else rangeH[1];
635
636Plot sHigh=rangeH;
637sHigh.SetDefaultColor(color.Light_Orange);
638sHigh.SetPaintingStrategy(PaintingStrategy.Dashes);
639
64017:46 Mobius: your code only holds the current high. There's no comparison looking for another high
64117:47 DMonkey: def rangeH= if tDay and secondsTillTime(TimeEnd) > 0
642 and secondsFromTime(TimeBegin) = 0
643 then High
644 else if high > rangeh[1]
645 then high
646 else rangeH[1];
64717:49 DMonkey: i copy and pasted you input and it may have dropped an operator.....lol....but you should get the idea....
64817:49 Brainfill: Thanks Mobius & DMonkey...let my try your suggestion. I did in fact create a simple open range for a breakout!
64917:50 CandleGap: # I would like to set the chart style to hikin ashi, but also have a bar chart plotted behnd or over top of the hikin ashi chart.
650
651# Below is what I tried.
652
653
654# Tried by CandleGap.
655# 1st set your chart style to hiekin ashi.
656plot price1 = close;
657SetChartType(ChartType.bar); # sytax works but affects both the main and sub graphs(if declare lower is used) and bypasses the original style setting.
658# price1.SetChartType(ChartType.bar); # syntax is NG.
659# price1.ChartType.bar; # syntax is NG.
660# plot price2 = close(ChartType.bar); # syntax is NG.
661
662# Anyone have a thought about how to do it?
66317:51 DMonkey: yes
66417:51 Mobius: yes
66517:53 DMonkey:
666#StudyName:HA Hybrid Chart
667#Description: Shows HA Candles and Price Bars
668#Author: DMonkey
669#Requested By: Chatroom Discussion
670# Ver 1 Date : Posted to chat on 4/13/2017 : Original Date Unknown.
671# Trading Notes: N/A / Just a comparison chart
672# Uses a depreciated function of addChart
673
674#inputs
675input symbol = "/CL";
676
677#Calcs
678def o = open(symbol);
679def h = high(symbol);
680def l = low(symbol);
681def c = close(symbol);
682def na = double.nan;
683
684def o1 = if o < c
685 then h
686 else na;
687def c1 = if o < c
688 then l
689 else na;
690
691def h1 = h;
692def l1 = l;
693
694def o2 = if o > c
695 then h
696 else na;
697def c2 = if o > c
698 then l
699 else na;
700
701def h2 = h;
702def l2 = l;
703
704#Chart Management
705AddChart(growColor = Color.LIGHT_GRAY,
706 fallColor = Color.LIGHT_GRAY,
707 neutralColor = Color.LIGHT_GRAY,
708 high = h1,
709 low = l1,
710 open = c1,
711 close = o1,
712 type = ChartType.baR);
713
714AddChart(growColor = Color.LIGHT_GRAY,
715 fallColor = Color.LIGHT_GRAY,
716 neutralColor = Color.LIGHT_GRAY,
717 high = h2,
718 low = l2,
719 open = c2,
720 close = o2,
721 type = ChartType.bar);
722
723### End Code ###
72417:57 bigworm: im noticing a trend with these two methods. Using the Z score as you calculate it yields less tradeable pairs than using bollinger bands but all of them seem to have a higher success ratio (alot of them 100) and they have a higher profit.
72517:57 CandleGap: Thank You very much DM - Cool!. Can this be made to use GetSymbol......, or do we have to specifiy the symbol?
72617:58 DMonkey: give it shot and find out....
72718:00 bigworm: i just backtested both on about 100 pairs
72818:06 CandleGap: DM, the added bar chart is not following the symbol in the main chart symbol box. The bar chart is sticking with whatever symbol is populated into the studies symbol box.
72918:08 Farmin: he's not doing it the way you did it
73018:11 CandleGap: Farmin is your comment for me? I will say I now have some ideas from DM, and/or I may be able to add the get symbol syntax to it.
73118:14 Nube: You don't need GetSymbol()
73218:15 CandleGap: DM, what is a "depreciated function of addChart"? Discontinued??
73318:15 Nube: Studies user the ticker symbol by default. Just remove the the stuff that's specifying another symbol
73418:16 Nube: They've fully written off it's cost?
73518:17 Farmin: (chiefly of a software feature) be usable but regarded as obsolete and best avoided, typically due to having been superseded.
73618:17 CandleGap: Nube - OK Thanks - I will edit out the symbol stuff.
73718:17 Farmin: that would be depreciated, nube
73818:31 hightrade: Hi , what is the reason for VWAP showing NaN under watchlist for certain symbols and not for others . example AMZN and FB now shows NaN
73918:34 Farmin: somebody forgot to change the batteries in their slide rule.
74018:49 CandleGap: Farmin, that's to funny :) I like it - as an old slide rule guy!
74118:49 Nube: I broke my trying to unfold it then used the pieces to level the abacus
74218:49 Nube: -- thinker
74319:10 TrainDoodle: Any contractors on here looking to write a simple script for me ?
74419:20 Vimes: Train if its simple enough - describe what you are looking for and the spirit of the forum seems to be to help folks out. with most requests
74519:40 TrainDoodle: Im really just looking for a simple hammer and shooting star identifier.
746The problem with the internal pre loaded hammer candlestick and shooting star patterns is that it requires the candle to close at the absolute high (hammer) or low (shooing star).
747
748To be honest I dont even care about the trend in "x" amounts of prior bars, just a single candle scanner at this point would be sufice.
74919:45 Farmin: there's a built-in pattern editor that requires no coding on your part. just click on Create once you have click on Patterns
75019:47 TrainDoodle: Its not as easy as they make it sound, it wont let you look for a single candle. Im not lokoing to auto trade just want these long wicks with short shadows to "poke" me in the eye when I scan
75119:52 Mobius: Long wicks with short shadows??
752What percent of candle range is to be body
753What percent range Shadow
754What percent range Wick
755
756That's the information needed to code what you want
75719:54 Mobius: Last Call before the bar closes.
75819:55 TrainDoodle: if you look at EUR?USD 4 hr 6/28 1:00
75919:55 Vimes: Not sure train's def but Bulkowski defines a hammer with a lower shadow at least 2-3 times the body with little or no upper shadow - not sure how to quatnify that
76019:56 Mobius: As we say in the deep South - Y'all it's been a pleasure. Come on back and see us real soon now Y'hear.
76119:56 TrainDoodle: thats what i want it to identify . oddly enough there was also a shooting star on the same chart EIR/USD 6/28 4 hr at 5:00 am right next to the hammer (go figure) but none of the internal pattern scanners find either of them
76219:57 Mobius: Vines that isn't for me the coder to decide.
76319:57 Vimes: i know that - just rying to help
76419:57 Mobius: I want percentage ranges. And I want them NOW!
76519:57 Vimes: lol - i want a drink
76619:57 Mobius: Because we only have 2 more minutes
76719:57 TrainDoodle: I wanst looking for someone to write something in the next 5 minutes i was just throwing out aline to see if there was anyone that can
76819:57 Farmin: lol
76919:58 Farmin: Train, we are here just watching the paint dry and hoping for that drink
77019:58 Mobius: Train I can write stuff to make TOS bark and fetch the paper
77119:58 Vimes: i actually believe that
77219:58 TrainDoodle: Ok then Ill be back ;) now drink up all
77319:59 DMonkey: i named my dog TOS
77419:59 Farmin: how often does it get kicked?
77519:59 DMonkey: you guys have a good night....
77619:59 Farmin: and yes, the pattern editor is pretty easy
777
778
779
780lulu mazn2772 1772 aapl nvda 72
781div STWD
782------- Tuesday, July 10, 2018 -------
78307:25 graf: Looking for a scan to identify pre-market gapups. Is this the right place to ask?
78407:28 Mobius: There's already a TOS Native Gap Scan
78507:30 Mobius: Good Morning all.
78607:30 xiaoze8090: @Mobius, Does you know how to plot total option volume on a chart just like you would plot total stock volume on a chart?
78707:30 xiaoze8090: @Mobius Good Morning!
78807:33 Farmin: same code, just change the ticker
78907:35 Mobius: xia.. We don't have easy access to all the strikes in ThinkScript so coding anything that requires that isn't possible. Getting all the volume in any option chain is something we can code. That information is under the Analyze Tab though
79007:35 Mobius: we can't code*
79107:39 xiaoze8090: @Mobius, I can see the chart of volumn for each option chain, But I am looking for total of the volunm, which would be very good at finding oppertunity of the trade
79207:42 Mobius: The only place to get that data is Under the Analyze Tab > Todays Option Statistics
79307:44 xiaoze8090: I see, I study the book of "MCMILLAN ON OPTIONS" which suggests me to use total option volunm chart to predict the stock trend.
79407:44 Mobius: Let me make myself clear - YOU CAN NOT DO THAT IN TOS
79507:45 xiaoze8090: @Mobius, OK, but do you know where I can get the information?
79607:48 Mobius: xia.. The people who originally designed this platform are some of the best options traders there are. Don't you think if it was really a need to know thing it'd be here. I mean really??
79707:51 Mobius: You can also look at the Sizzle Index which is a tracking study for volume and open interest
79807:53 xiaoze8090: @Mobius, fine, I am a new trade, I try to learn more to make my trade better. if it really not use, offcause, I will give up.
79907:55 xiaoze8090: @mobius, how to get the Sizzle index?
80007:55 Mobius: There's far more BAD information in books and from so-called experts a new trader can get caught up in than there is good information. It's not easy I do sympathize
80107:55 graf: Mobius, thanx. Just learning TOS, and am an old dog trying to learn a new trick :-)
80207:56 Mobius: Sizzle index is also under the Analyze tab then Todays Option Statistics
80307:56 xiaoze8090: @Mobius, Thanks,
80407:58 Mobius: graf.. I use several platforms and have coded for all that have custom codes. I use this one more than any other because I like it more than any other. Ease of use, abilty to code, free data, lots of good options over display make it the best to me.
80508:27 Nube: ThinkScript - So easy a caveman can do it
80608:32 xiaoze8090: @Mobius, I can't find the "sizzle index" explaination in the help doc. could you tell me how to use the index properly? and also the "Call sizzle index", "Put sizzle index", "volatilty Sizzle" , "Stock Sizzle".
80708:37 Mobius: not my jb xia.. And this chat window isn't good for that sort of education. Join the SwimLessons Chat and ash the instructrs there to review those questions
80808:37 Mobius: ask too
80908:37 xiaoze8090: Thanks, I will go there to ask.
81008:38 Farmin: try searching http://tlc.thinkorswim.com/center/search.html?keyword=sizzle
81108:38 Mobius: yw
81208:39 xiaoze8090: Thank Farmin.
81308:42 TrainDoodle: Good Morning Mobius, I have better clarity on what I was refering to last night. I am in search of a code that will scan for a single candle- a "Takuri Line" It's described on thepatternsite.com as One Candle - (2) prior DOWN candles The Takuri Candle is a small bodied candle with a lower shadow that is at least 3x the height of the body and little or no upper shadow.
81408:42 TrainDoodle: ... and obviusly an in verted as well
81508:43 TrainDoodle: A great example is on the 4 hr EUR?USD on 6/28/18 at 1:00
81608:57 baron_12tg: morning is there a way to scan a mtf indicator set on a weekly time frame plot to scan in a daily scan?
81708:59 Farmin: No, each slice in the scanner must be a single agg period. YOu'll have to break up the MTF into individual components for successful scanning.
81809:00 baron_12tg: i am not sure how to do that any help if i send the code?
81909:01 Farmin: that is the typical process
82009:15 baron_12tg: ok thanks
82109:21 Farmin: looking at the code for the shooting star pattern it is NOT true that it requires the candle to close at the absolute high (hammer) or low (shooting star).
822
823For example, shooting star uses Min(open, close) - low <= ErrMargin and high - Max(open, close) > shadowFactor * BodyHeight;
824
825One really needs to master the various inputs to fine tune the code to understand how to find what the default settings do not.
82609:38 TrainDoodle: Farmin, are you talking about the difference between shooting stars / hammers and that takuri I was reffering to? It is those absolute highs and lows that miss great oppurtunities. I need help (well thats obvious)
82709:54 EvanBStock: Do you all know how to code a swing high over multiple days? For example the past 2 weeks and possibly be able to pick the 2 highest highs in that time period?
82809:59 Grit: Hi
82910:00 Grit: Is that possible to overlapping 20 TK Ranger Bar Chart on top of 5 TK Range Bar Chart?
83010:01 Grit: And 20 TK Bar Chart on top of 5 TK Bar Chart?
83110:01 amalia: Evan, Highest() function would help I’m sure
83210:02 amalia: With an index
83310:04 Farmin: train, you need to play with the parameters of the candle patterns to target your specific needs. Basically the same questions that Mobius asked of you last night. As I pointed out above, your assumption about the closing position is not accurate. Clicking on the question marks to the right of the parameter values may help you understand what the setting does:
834
835
836
83710:08 Farmin: bbl
83810:15 AlphaInvestor: Evan - look at Mobius Fractal Pivots
83910:28 amalia: I’m just wondering what new strat Rob came up with EvanBStock
84010:30 Mobius: TrainDoodle -
841
842# "Takuri Line" (2) prior DOWN candles Then a Takuri Candle. A small bodied candle with a lower shadow that is at least 3x the height of the body and little or no upper shadow.
843# Mobius
844# Chat Room Discussion 07.10.2018
845# Name the Study "Takuri_Line"
846# The Scan Code is: close crosses Takuri_Line()
847
848input TrendLength = 2;
849
850def o = open;
851def h = high;
852def l = low;
853def c = close;
854def x = barNumber();
855def nan = double.nan;
856def TakuriTrendDn = IsDescending(c, TrendLength)[1];
857def BodyHeight = AbsValue(c - o);
858def CandleRange = h - l;
859def Shadow = Min(c, o) - l;
860def Wick = h - Max(c, o);
861def TakuriDn = if TakuriTrendDn and
862 BodyHeight / CandleRange <= .033 and
863 Shadow / CandleRange >= .7 and
864 Wick / CandleRange <= .25
865 then h
866 else TakuriDn[1];
867def TakuriDnX = if h == TakuriDn
868 then x
869 else nan;
870plot TakuriLine = if x >= HighestAll(TakuriDnX)
871 then HighestAll(if isNaN(c[-1])
872 then TakuriDn
873 else nan)
874 else nan;
875 TakuriLine.SetStyle(Curve.Firm);
876 TakuriLine.SetLineWeight(1);
877 TakuriLine.SetDefaultColor(Color.Cyan);
878AddChartBubble(isNaN(close[3]) and !isNaN(close[4]), TakuriLine, "Takuri");
879# End Code
880
88110:33 Grit: Hi Mobius
88210:36 Mobius: I should have said: Not at the moment but later likely.
88310:38 Nube: Well played
88410:41 Grit: Is that possible to overlap 10 TK range bar to 2 TK Ranger Bar?
88510:41 Grit: on top of 2 TK ranger Bar
88610:43 Grit: multiple timeframe analysis
88710:45 breakout: Could someone please help me with a change I'd like to make. I have a script that currently uses "AggregationPeriod.Hour;". I'd like to change it to 30 Minutes but everything I try to represent 30 minutes fails. I've looked on the web but haven't found anything.
88810:47 Mobius: Grit No
88910:47 Mobius: AggregationPeriod.Thirty_Min
89010:48 gilpv: Thanks Mobius!!!
89110:50 breakout: Thanks!!
89210:51 AlphaInvestor: Mobius - could you whip us up a script combing all the open interest and volume for the entire option chain
89311:15 motomax: New to trading
89411:17 Grit: Thank you Mobius. Can we Addcloud function some thing like this.
89511:18 AlphaInvestor: sure - go for it
89611:18 AlphaInvestor: But - please zoom down your pics to 10% before posting them
89711:19 AlphaInvestor: Grit - Plus - Color and Bold are reserved for teaching purposes - not to draw attention to your question. Your question IS NOT more important than anyone elses.
89811:21 TrainDoodle: Mobius - Nope (I give up)
899
90011:23 Nube: grit, sure can. Just need to define start and stop points and high and low borders.
90111:23 Grit: Ok
90211:24 Grit: Great
90311:29 markps: train, look above. the code is there.
90411:29 TrainDoodle: It doesnt work
90511:29 Mobius: Train.. What I wrote above is correct and no you cant test it the way you suggest without altering the code
90611:30 Grit: Once MKT start inthe morning addcloud based on 10 TK Range Bar formed on top of 2 TK Range Bar Chart
90711:30 markps: pebak
90811:30 markps: error
90911:30 TrainDoodle: Is there anyone that can talk on the phone ?
91011:31 Mobius: Train. I can tlalk on the phone I do it all the time. just not to TOS customers
91111:32 TrainDoodle: Brilliant
91211:32 Mobius: True
91311:32 Mobius: Handsome too
91411:32 TrainDoodle: Look at te EUR/USD 4 hr today the candle before the current candle should have been hit - but no code works
91511:33 TrainDoodle: I truly apprictaiate your effort but what you wrote when inserted on a chart didnt do anything but call every candle (yes) to what you worte
91611:33 AlphaInvestor: Grit - thanks for turning off bold - here is an example using AddCloud
917
918# BLT_ChartOverlayCloudCandles
919
920input showcloud = yes;
921input agg = AggregationPeriod.hour;
922plot open = open(period = agg);
923plot close = close(period = agg);
924plot high = high(period = agg);
925plot low = low(period = agg);
926high.AssignValueColor(if open > close then Color.RED else Color.GREEN);
927low.AssignValueColor(if open > close then Color.RED else Color.GREEN);
928open.setdefaultColor(color.white);
929close.setdefaultColor(color.yellow);
930open.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
931close.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
932high.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
933low.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
934AddCloud(if showcloud and open > close then high else Double.NaN, low, Color.LIGHT_RED);
935AddCloud(if showcloud and open < close then high else Double.NaN, low, Color.LIGHT_GREEN);
936def dn = if high(period = agg) < high(period = agg)[1] and low(period = agg) <= low(period = agg)[1]
937then 1
938else if dn[1] == 1 and low(period = agg) < low(period = agg)[1] and close(period = agg)[1] > close(period = agg)
939then 1
940else 0;
941def up = if high(period = agg) >= high(period = agg)[1] and low(period = agg) > low(period = agg)[1]
942then 1
943else if up[1] == 1 and high(period = agg) > high(period = agg)[1] and close(period = agg) > close(period = agg)[1]
944then 1
945else 0;
946input pricecolor = no;
947AssignPriceColor(if pricecolor
948then if up == 1
949then Color.GREEN
950else if dn == 1
951then Color.RED
952else Color.YELLOW
953else Color.CURRENT);
954
95511:34 Mobius: I've already explained that the code would need to be altered to find that candle if you scan using the code as instructed then review the results with the study you will see the candles produced are the correct sort
95611:35 TrainDoodle: What ?
95711:35 Mobius: In fact if you do the math for the candle YOU THINK is perfect you will find the EXACT same percentages are the codes criteria. Do you know how to do that math
95811:35 Grit:
959Thank you for scrip.
96011:35 Grit:
96111:36 TrainDoodle: Mobius, I inserted the code you wrote and it called everysingle candle on the chart a (yes) canlde
96211:37 Mobius: Train then you didn;t copy and paste correctly. Try again
96311:38 Grit: Hi AlphaInvestor. Thank you for scrip. Appreciate. I am looking for 10 TK Range Bar (Add Cloud) displaying on top of 2 TK Ranger Bar Chart.
96411:39 TrainDoodle: Where would you suggest I paste it
96511:39 Mobius: Train... Here is the code confirming a Daily Scan for that candle
966
967 To zoom the image up right click the image and zoom
96811:39 markps: must resist.... time for a JD break
96911:40 TrainDoodle: Mobius - that has ZERO to do with a Takuri line - which is a CANDLE
97011:41 Mobius: Train.. IT IS A STUDY. So paste it into a NEW CUSTOM study. THEN use the scanner to reference the study as per the instructions in the header of the study.
97111:41 Mobius: OK Train... Your right and a coder with 40 years experiance is wrong
97211:42 Mobius: Please delete that study and do not use it
97311:42 AlphaInvestor: Train - disagreeing with the most prolific thinkScript coder in the room - no bonus points for that
97411:43 Vimes: Train maybe you have some misunderstanding i tested the scan and it is finding stokcs that have the reversal candle requested - isn't that what you asked for?
97511:44 minniechui: do u have any script for short sale restricion? like if current price drops 10% from yesterday's closing price, it triggers SSR, thx
97611:44 TrainDoodle: Vimes add it to the EUR/USD 4hr chart tell me what happens
97711:45 Mobius: Train Have you read what I said about EUR/USD ??
97811:47 TrainDoodle: While you were busy beating your chest and flexing you neglected to mention it doesnt work on currencies
97911:47 AlphaInvestor: TrainDoodle - quit insulting people and just go away
98011:47 TrainDoodle: Even though Ive mentioned the EUR/USD 20 times since last night as the example
98111:47 TICKZ: HI guys
98211:47 AlphaInvestor: TrainDoodle - you will get no help in this room any more
98311:48 admin_tculs: please keep comments civil please
98411:48 TICKZ: I have a question.. how do i delete all custom studies from tos?
98511:48 TrainDoodle: All he's done is brag and tell me how stupid I am
98611:48 Mobius: Another Symbol from a Daily scan
987DAL
988
98911:50 TrainDoodle: Mobius can I ask you a simple question ? I included a link to the chart pttern site that describes and shows the candle I am searching for - did you visit that site ?
99011:50 AlphaInvestor: Ignored
99111:50 admin_tculs: Train
99211:51 TrainDoodle: listening
99311:51 admin_tculs: Doodle posting of outside links is not allowed here
99411:53 Mobius: Train... I did review the specs for that candle. I listed those specs in the header of the code. The code is based on those specs. You can go into the code and alter those specs easily to suit you. I used the ones that met the percentages of the candle you showed as an ideal candidate.
99511:54 TrainDoodle: Then why instead of it identifying that candle does it identify and call every candle true (yesa)
99611:54 Mobius: Here are the specs for the candle in the FX chart you listed
997Range 1.1562-1.1530 = .0032 Open- Close 1.1553-1.1554 = .0001
998shadow 1.1553 - 1.1530 = .0023 Wick 1.1562 - 1.554 = .0008
99911:54 AlphaInvestor: Train - you don't want the answer to that question
100011:57 admin_tculs: Train Doodle these are traders taking time out to help you please be more civil toward all of them
100111:57 Mobius: Train.. lets try this a different way. Here is a share link with the study
1002http://tos.mx/MwnzYZ
100311:58 Mobius: Train here is a scan share with that study
1004http://tos.mx/NlNExU
100511:59 Mobius: Now it's VERY IMPORTANT that you name that STUDY Takuri_Line
100611:59 Mobius: otherwise the scan won't work
100712:00 Mobius: Set the scan for Daily since 4 hour scans can be hinky
100812:00 EvanBStock: how do i create oco order in an option position. I set a stop and when i set a limit order it asks about oco i hit accept and it cancels the stop and the limit
100912:00 AlphaInvestor: Mobius as always has the patience of Job
101012:00 Mobius: Evan.. Call the Trade Desk
101112:01 Grit: Hey AlphaInvestor, is it possible to change the previously sent code (BLT_ChartOverlayCloudCandles) so that it is based off either a tick bar or range bar? (tick/range as in the aggregation type.) Thanks for your help.
101212:01 admin_tculs: Evan Trade desk 800-672-2098
101312:02 EvanBStock: thanks
101412:02 AlphaInvestor: Grit - no idea, I don't use tick or range bars
101512:03 AlphaInvestor: I no of no sucessful trader who uses tick charts, not saying there isn't any .. I just never heard of them
101612:04 Grit: Here is scrit could you try it. but it does not form as 10 TK ranger Bar Formed.
101712:04 Grit: # This indicator will plot a crude facsimile of Range Bars. # # Input the Bar Range: input Range=1.0; def bar1=if barnumber()==1 then 1 else 0; # Check if we have moved the range distance from the Range Bar open: rec rangeopen=if bar1 then open else if highrangeopen[1]+Range then rangeopen[1]+Range else if lowrangeopen[1]-Range then Rangeopen[1]-Range else rangeopen[1]; # # Keep track of the prior Range Bar open: # rec rold=if bar1 then open else if rangeopen[0]!=rangeopen[1] then rangeopen[1] else rold[1]; # # Plots # plot r0=rangeopen; plot r1=rold; addcloud(r0,r1); # # Formatting # r0.setdefaultcolor(color.black); r1.setdefaultColor(color.BLACK); -------------------------------------------------
101812:05 TrainDoodle: Mobius I have no idea what to do with that
101912:06 Joebone87: yikes... glad ive been absent from class today
102012:07 AlphaInvestor: Joe - my head hurts, and their is a dent in the drywall
102112:07 Joebone87: lol.. this last one after the extra mile mobius put in...... wowzers...
102212:07 TrainDoodle: Is there a differnce between writing somethign for a study as oppossed to identfying a pattern ?
102312:07 Grit: Please if any body can help me
102412:09 Joebone87: I dont use the pattern writer train... but i believe anything you do in there can be done in regular chart scripts
102512:09 Joebone87: grit.. a range bar should work exactly the same as a minute bar... as long as you dont have time references in there
102612:09 Mobius: Train.. TOS share links can be opened by copying them then click Setup at the top right on your platfrom then click Open shared item the hit CTRL V to paste the link into the window then Enter when it asks you if you want to rename it do with the name I provided. Click Save and the go to Studies > Edit Studies scroll down the list of studies to find that one double click it to load the study.
102712:09 Joebone87: and maybe volume...
102812:10 Joebone87: not sure though.. dont use those very ofter
102912:12 Mobius: Grit - We don't use color in here except for teaching. Using it as you are is the fastest way to get ignored.
103012:12 AlphaInvestor: Well, the second fastest - after insulting the experts
103112:12 Grit: Hi Joeboner87, could you please explain me more
103212:13 Joebone87: no color
103312:14 Joebone87: leave and come back
103412:14 RVB: just a report back C&H scan attempt didnt go well. calculation of prior highs and pivot points and getting base (uptrending/downtrending) seems very tough
103512:14 Grit: sorry
103612:14 Grit: I got it
103712:14 Joebone87: use the grey
103812:15 Grit: ok
103912:15 Joebone87: light gray
104012:15 TrainDoodle: Mobius, I thank you for the link and the step by step instructions. they were very important to verify that i did actually cut and paste the code correctly the first time - but the code you wrote while functioning for what you think i was asking may be correct - but it does not work for what I am actually needing
104112:17 Grit: Hi Joebone87 thank you. I am new in chart room.
104212:17 Joebone87: thats fine.. everyone is once
104312:18 Grit: thank you
104412:20 TrainDoodle: There i a study or a pattern recognition code called "hammer" when the software finds a hammer it displays an up arrow under it. The problem with the "hammer" code is it is too restricting. It requires the close to be at the high. A Candle called "Takuri Line" is not a horizontal line it is a candle that looks similiar to a "hammer" Now i understand that I can post outside links but there are places one can find definitions of this candle. As a great example the 5AM EUR/USD 4 hour candle from today - looks like a hammer but because its close was not at the high it wont trigger a hammer. Is there any way to code the "Takuri Line" Candle ?
104512:21 Mobius: lol Train.. The horizontal line is just a wahy to identify the candel the line starts at.
104612:22 Mobius: way to show the point where the candle is. That line starts at the high of the Takuri candle
104712:22 TrainDoodle: When this study is place in the EUR/USD 4hr chart the candle it goes back at does not represent anything like I have described
104812:23 Mobius: It's clear your new to custom studies. Your nothing if not persistent.
104912:23 Grit: Joebone87, give some more ideas please . I just want to display 10 TK Range Bar (add cloud without wick) on top of 2 TK Ranger Bar Chart. every time 10 TK Ranger bar formed.
105012:24 TrainDoodle: Mobuos !!! I think I know the problem
105112:24 Mobius: lol great
105212:25 TrainDoodle: I gave a reference the EUR/USD 4 hr chart 6/28/18 1:00 I gave it last night and today - The line goes back to and you potentially coded based on the statistics of the 6/8/18 1:00 candld
105312:27 Grit: Hi
105412:27 TrainDoodle: EUR/USD 4 Hr charts - see the nice candles at 6/28/18 1:00 and today 7/10/18 5:00 see how pretty the are ? I want to find them ... lots of them ... and the inverses too but thats for another day LOL
105512:28 Grit: How to change color on show on my name
105612:28 Grit: Grit
105712:29 AlphaInvestor: Grit - only you see your name in green
105812:29 Grit: thank you
105912:36 amalia: yw
106012:38 Grit: Hi Joebone87
106112:40 Joebone87: grit im sorry bud.. im on a different project today.. good luck though
106212:41 amalia: grit, what’s wrong w using the code you posted at hh:04?
106312:42 amalia: Set price to Line and use two of those studies. One at 2ticks and another at 10ticks
106412:42 Grit: Hi Amalia,
106512:42 Grit: I just want to display 10 TK Range Bar (add cloud without wick) on top of 2 TK Ranger Bar Chart. every time 10 TK Ranger bar formed.
106612:43 amalia: You didn’t answer my question
106712:44 Grit: It didn' display when I used on Range chart.
106812:46 Grit: I want some thing like this display on Range Chart. every time 10 TK Range Chart Formed.
106912:47 AlphaInvestor: Grit - please zoom down your pictures to 10% before posting
107012:47 admin_tculs: Grit please work on smaller pics please
107112:47 Grit: Sorry, OK
107212:51 RVB: Q are crypto currency symbols available in TOS to plot studies?
107312:56 haptrade: Hey gang, i'm not really good at this, so perhaps one of the pros here can help me with what 'should' be a simple script.
107412:57 haptrade: Merely want: Bid/Ask in two upper displays of the chart on the left side. For futures quotes. Maybe a last, too?
107512:57 nextrade: and that dark blue color is almost as good as black -)
107612:58 AlphaInvestor: Bid and Ask are only available on Intraday charts, is that Okay?
107712:59 TICKZ: http://tos.mx/bXUbMQ
107812:59 haptrade: Actualy, Alpha, I found one I had... Just realized they do not function in range charts...
107912:59 TICKZ: bid / ask
108012:59 haptrade: Yes, def. ok for intra-day... Thanks for the link.
108113:00 haptrade: Thanks, TICKZ
108213:01 Grit: Hi Amalia,
108313:01 TICKZ: np
108413:02 nextrade: Mobius'atr-mean bands posted yestrdy combined with his Stoch Curve line, makes a nice combo
108513:03 Nube: Brainstorm help time. If I want to collect percent of bars over n bars that close up and compare them, is there a better way then adding counters for each various percent range? like 25-50, 50-75 etc.
108613:04 AlphaInvestor: calculate the percents, then do Sums of Betweens
108713:04 AlphaInvestor: I don't know which would be more efficient, a bumch of counters, a big IF statement, or a bunch of sums
108813:05 Nube: Sorry, meant for those to be in percents. So 3 up closes out of 10 would be 30 percent.
108913:05 TICKZ: http://tos.mx/h0UPof counter
109013:06 TICKZ: http://tos.mx/o8iNUs
109113:07 DMonkey: nube...number of closes up divided by length
109213:07 Nube: My thinking is this way I would have a way to say that we are currently in the whatever percentile of up closes per n bars to test as a possible trade condition
109313:08 Nube: DMonkey, that part I've got. it's collection each n bar segment
109413:08 AlphaInvestor: Nube - re-look at my Internal Bar Strength script - statistics behind it
109513:09 Nube: Alpha, will do. Thank you.
109613:10 DMonkey: close > open then 1 // close < open -1 else 0 // sum / length...
109713:10 Nube: And heck, maybe that's a better idea. Some sort of average bar strength over n bars.
109813:10 DMonkey: grit.....
1099input multiplier = 10;
1100def x = barNumber();
1101
1102def h = if x % multiplier == 0
1103then highest(high,multiplier)
1104else max(high, h[1]);
1105def l = if x % multiplier == 0
1106then lowest(low,multiplier)
1107else min(low, l[1]);
1108
1109plot a = h;
1110a.hide();
1111plot b = l;
1112b.hide();
1113addcloud(b,a);
1114AddVerticalLine(visible = x % multiplier == 0);
111513:11 Grit: Hi Amalia, I am waiting for you answer.
111613:11 AlphaInvestor: Nube - important values in that IBS based on the research are 40 and 90
111713:11 AlphaInvestor: Grit - Amaila is gone
111813:11 Mobius: Train... If you come back - I altered the code adding user inputs and then set the inputs to capture the candle you wanted. I also added an arrow plot to show all of the Takuri candles on a chart
1119
1120# "Takuri Line" (2) prior DOWN candles Then a Takuri Candle. A small bodied candle with a lower shadow that is at least 3x the height of the body and little or no upper shadow.
1121# Mobius
1122# Chat Room Discussion 07.10.2018
1123# Name the Study "Takuri_Line"
1124# The Scan Code is: close crosses Takuri_Line()
1125
1126input TrendLength = 2;
1127input PercentBody = .1;
1128input PercentWick = .3;
1129input PercentShadow = .6;
1130
1131def o = open;
1132def h = high;
1133def l = low;
1134def c = close;
1135def x = barNumber();
1136def nan = double.nan;
1137def TakuriTrendDn = IsDescending(c, TrendLength)[1];
1138def BodyHeight = AbsValue(c - o);
1139def CandleRange = h - l;
1140def Shadow = Min(c, o) - l;
1141def Wick = h - Max(c, o);
1142def TakuriDnX = if TakuriTrendDn and
1143BodyHeight / CandleRange <= PercentBody and
1144Shadow / CandleRange >= PercentShadow and
1145Wick / CandleRange <= PercentWick
1146then x
1147else nan;
1148def TakuriDn = if !isNaN(TakuriDnX)
1149then h
1150else TakuriDn[1];
1151plot TakuriLine = if x >= HighestAll(TakuriDnX)
1152then HighestAll(if isNaN(c[-1])
1153then TakuriDn
1154else nan)
1155else nan;
1156TakuriLine.SetStyle(Curve.Firm);
1157TakuriLine.SetLineWeight(1);
1158TakuriLine.SetDefaultColor(Color.Cyan);
1159AddChartBubble(isNaN(close[3]) and !isNaN(close[4]), TakuriLine, "Takuri");
1160plot arrow = if !isNaN(TakuriDnX) then low else double.nan;
1161arrow.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
1162# End Code
1163
1164
1165
116613:12 TICKZ: #Counter
1167declare lower;
1168
1169Def event = close >= close[1];
1170Def count = if event then count[1] + 1 else count[1];
1171Plot total = count;
117213:13 AlphaInvestor: Mobius if I had your patience I would become a monk
117313:13 Mobius: Train... EUR/USD 4 hour showing the Takuri Candle you wanted
117413:14 Mobius: Enough years in any school system you either get patient or get a gun :)
117513:14 Mobius: The code was interesting enough regardless of the request
117613:15 Grit: Hi DMonkey, Thank you for code.
117713:15 AlphaInvestor: Mobius +1
117813:15 Grit: Can you please Take out the Wick part from that code.
117913:16 Mobius: Maybe Paris will archive that one. My guess is Train.. will be back
118013:18 Vimes: Mobius it is amazing what you do here for folks - it is much appreciated
118113:19 Mobius: It helps me too Vimes. keeps my mind active :)
118213:21 Nube: DMonkey, I can collect and save the stats for each section it's the comparison of the sections that I can't think of a good way to do. Say I've got 100 bars and want to collect the percent for each 10 bars. That's pretty straightforward, it's the counting how many are each percent range. So say I want to count every section in a 25 percent range. That's 4 counters, not too bad. Next I want to show which range the current one is and how many have been in that range.
118313:23 Nube: So say 60 percent of the recent 10 closes are up close, I would want to know that 6 of the previous 10 or whatever the number is have been on that range
118413:23 Mobius: Nube - Without arrays that's tough to do
118513:25 amalia: I also have an inquiry
118613:25 amalia: Trying to locate the first bar of the week for mobile
1187
1188
1189
1190
1191
1192
1193
119413:40 amalia: I wasn't good at coding and am still not good at it but for some it takes, minutes, for others it takes months to learn how to code. If it's making you money, it's a worthwile endeavor. You can start with the link above that AlphaInvestor just sent.
119513:40 Grit: Than you AlphaInvestor and Amalia.
119613:41 DMonkey: why leave the wicks out since that is where price went?
119713:41 Nube: amalia have you tried something like getweek() crosses above getlastweek()+.01 the Barnumber? No clue if that will work but that's what comes to mind
119813:43 Grit: Becasue on range bar there is wick form only one side so that i can predict MKT direction.
119913:43 amalia: *then BN?
120013:43 amalia: Nube
120113:44 Grit: Hi Amalia, which line should I add the code you sent.
120213:45 Nube: yes, then
120313:46 Nube: Android autocorrect should nuked from orbit
120413:46 Nube: *be
120513:46 Nube: lulz
120613:47 amalia: def Hx = if Close>Open then Close else Open;
1207def Lx = if Close>Open then Open else Close;
1208def h = if x % multiplier == 0
1209 then highest(hx,multiplier)
1210 else max(hx, h[1]);
121113:47 amalia: See the changes I've made, Grit?
121213:47 amalia: Thanks, Nube. Will try after Grit gets going.
121313:47 Nube: If the cross doesn't work then maybe if getweek() != getweek()[1] then Barnumber()
121413:47 Mobius: The reason I chose mathematics instead of writing is because I can't spell.
121513:47 amalia: hahaha
121613:47 Nube: You can spell in math
121713:52 DMonkey: amalia....
1218def x = if GetDayOfWeek(GetYYYYMMDD()) == 1 then BarNumber() else double.nan;
1219AddVerticalLine(barnumber() == lowestall(x));
122013:53 amalia: Ok, ok. Getting close, Nube.
122113:53 amalia: Eyyy DM. Gonna try that and compare w what Nube suggested
122213:53 Grit: Hi Amalia,
122313:53 Grit: input multiplier = 10;
1224
1225def x = barNumber();
1226
1227def Hx = if Close>Open then Close else Open;
1228def Lx = if Close>Open then Open else Close;
1229
1230
1231def h = if x % multiplier == 0
1232 then highest(hx,multiplier)
1233 else max(hx, h[1]);
1234
1235def l = if x % multiplier == 0
1236 then lowest(lx,multiplier)
1237 else min(lx, l[1]);
1238
1239plot a = h;
1240a.hide();
1241plot b = l;
1242b.hide();
1243addcloud(b,a);
1244AddVerticalLine(visible = x % multiplier == 0);
1245
124613:54 Grit: Is this is right?
124713:54 DMonkey: did you plot and see?
124813:55 Grit: I did.
124913:55 amalia: No go, DM. Doesn't even show up.
1250Nube, your snippet start at 22:00PST. Sunday open is at 15:00PST. TOS considers Sunday 15:00-22:00 last week.
125113:55 amalia: At least according to this script.
125213:56 DMonkey: lol...I will rethink for mobile....
125313:57 amalia: haha ok
125413:58 Grit:
1255
1256
125713:59 amalia: Eureka!
125813:59 amalia: if GetDayofWeek(GetYYYYMMDD()) crosses 5 then BarNumber()
125913:59 UpTheCreek: grit, zoom you r picture posts down to 10% BEFORE hitting send
126013:59 Mobius: plot SundayStartTrading = if getTime() crosses RegularTradingStart(getYYYYMMDD()) and
1261 getWeek() != getLastWeek()
1262 then low
1263 else double.nan;
1264SundayStartTrading.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
126513:59 UpTheCreek: amalia, what if Friay is a holiday?
126614:00 Nube: lowestAll(if getweek() == getlastweek() then Barnumber() else Double.NaN)
126714:00 amalia:
1268
1269
127014:00 amalia: Then I won't trade on a Friday =)
127114:00 Mobius: The above code gets the bar that Sunday trading begins
127214:00 amalia: Cool! Thanks. So we got two replies for this dilema
127314:01 Nube: Thanks, Mobius. Saving that snippet.
127414:02 Mobius: yw
127514:02 Grit: I don't know how to zoom down to 10%.
127614:02 Mobius: right click on the image and zoom down to 10% then post to the chat window
127714:03 amalia:
1278
1279
128014:03 Mobius: If you can't figure it out DON'T post pictures to the chat
128114:04 Mobius: We really don't care unless we ask for a picture
128214:04 amalia: Thanks, Mobius. That script starts perfectly at the right time and much better suited for weird days like UTC mentioned earlier.
128314:04 Mobius: yw
128414:04 Grit: Ok Mobius. Thank youfor advise.
128514:04 amalia: =)
128614:05 AlphaInvestor: Wow it sure is colorful in here today
128714:05 Nube: I'm trying to figure out why ToS would consider Sunday until 10 last week
128814:06 Nube: But part of the Monday bar this week
128914:06 amalia: Yeah, it's weird because at 10 pst it's 12 next day in central but we're supposed to be running on NY
129014:06 DMonkey: only use it on days that end in Y
129114:07 amalia: Ahh
129214:07 amalia: smartass
129314:08 DMonkey: lol
129414:08 amalia: lmao
129514:10 Mobius: lol
129614:11 Grit: Hi Amalia,
129714:12 Nube: Now I gotta look. I assumed Sunday was part of the Monday but don't know anything. Maybe it's part of the Friday bar.
129814:12 amalia: That's like the 3rd greeting I got from you. Hola!
129914:12 Mobius: Like a goose - everytime it blinks it's eyes it wakes up in a new world
130014:13 amalia: So Mobius' script shows the current week open but also shows daily open from previous days so I modded it a little. This is what I have so far:
130114:13 amalia: http://tos.mx/1vCKy3#
130214:15 Grit: I know how to input the code in the system but I don't know how to fix the code.
130314:16 Grit: Please please help me.
130414:16 amalia: This room has gone way more than halfway to helping you, Grit. Pull up your pants, put on your thinking cap and get to grinding like the rest of us. It's turning into a vending machine at this time.
130514:17 dkbyond: hi all, hope this is the right forum to ask help for thinkscript. have got he highest high for the past n days, need to get the low and close of this particular highest high
130614:17 Grit: I know
130714:17 Grit: I really appreciate for you all help.
130814:17 amalia: yw
130914:20 amalia: I'm basically trying to put these studies (http://tos.mx/Y7QHu7) on mobile so I have to copy/paste into a new study and mod it to mobile friendly functions. Keeps me on my toes w tS also.
131014:20 amalia: http://tos.mx/Y7QHu7#
131114:20 Mobius: amalia - Maybe I didn't understand what you wanted
1312
1313This will get Only the Sunday open
1314
1315plot SundayStart = if getTime() crosses below RegularTradingStart(getYYYYMMDD()) and
1316 getDayOfWeek(getYYYYMMDD()) == 1
1317 then low
1318 else double.nan;
1319 SundayStart.SetPaintingStrategy(PaintingStrategy.Arrow_UP);
1320
132114:27 Mobius: I loaded those amalia - You've done a boatload of work on them for sure!
132214:30 amalia: you're telling me
132314:30 amalia: A fold here and there would've cut it down to half the code I'm sure. haha
132414:31 Mobius: Every Ahab needs his Moby Dick
132514:32 amalia: To think this started out as a study called Fade a couple years ago.
132614:34 AlphaInvestor: Mobius - don't know if you saw this post from yesterday
1327Read an article this weekend that the FED is looking at replacing the old die hard 10-2 Yield Curve spread as a recession probability measure. To be possibly replaced by the Near-Term Forward Spread http://tos.mx/v5A70s#
1328Two articles to go along with the study that I built "The Fed is thinking about throwing out a key recession indicator" and "(Don't Fear) The Yield Curve"
132914:34 DMonkey: amailia.....getday() == Returns the number of the current bar day in the CST timezone. The output is returned in the range from 1 through 365 (366 for leap years).
133014:35 Mobius: I was much like that with ORB then I go into Neural Nets and some other out there stuff. Came full circle to much more simple studies. But what I learned made the time well spent. I'm sure the same will be true for you.
133114:40 amalia: DM, it's weird that SecondsFrom/TillTime() uses NY though.
1332Mob, I just have to know what I have to know and sometimes the more I learn, the more I lean towards simplicity. You're right; I'll try to add something else to it and my losses tell me to keep it simple, stupid.
133314:44 DMonkey: It is a weird little snafu....I assume different developers where working and one used ET for everything and someone else used CT for that rollover on the day....but it explains your variance....15:06 amalia: Yeah, it's weird because at 10 pst it's 12 next day in central but we're supposed to be running on NY
133414:47 amalia: Can you forward this, bkTOS? Thanks.
133514:49 Nube: is the secondsfromtime function farmed out to a vendor?
133614:49 bigworm: Mobius, do you test for normality on the spread for your pairs?
133714:50 AlphaInvestor: Nube - yes, Father Time
133814:51 Nube: amalia, if I ever get the hang of fold, I'm writing a Fold School. Let's tag team it.
133914:53 Mobius: big.. No since I force the data to a gaussian distribution prior to testing anyway
134014:53 amalia: haha Deal!
134114:53 bigworm: 4 pole
134214:54 Mobius: yes
134314:54 bigworm: you do that even before cointegration
134414:54 bigworm: test
134514:54 Mobius: yes
134614:54 bigworm: or just after to generate signal
134714:54 bigworm: ohh wow you transfrom everything first then do your tests?
134814:54 Mobius: yes
134914:55 bigworm: do you ever get annoyed at my questions lol
135014:55 AlphaInvestor: If I ever have enough money outside my IRA that I can trade, I sure will know a lot about Pairs Trading
135114:55 AlphaInvestor: Big - don't ask questions you don't want the answer to
135214:55 Mobius: no. I do consider if your better off discovering some on your own though
135314:57 bigworm: ive learned so much in the past year. School has helped but they dont really know answers to things I ask sometimes. You have been a big help with guidance and I appreciate it.
135414:57 Mobius: Some of what I do has been come to by practical means and not from any text book or discipline. It's just works
135514:57 Joebone87: ill second that Big... Im even learning from your questions.. and many of my own... i feel like i owe a debt to this room
135614:58 MTS1: Nube; saw your question the other day but was after hours so could not respond: Yes I confirmed the Script function was not working correctly for multiple agg ema crossover sample, I did not confirm workaround besides running them individually for each crossover (not using Script{}; just adding one indicator multiple times to chart seamed easiest). Have not done more testing than that.
135714:58 Joebone87: AI.. neat post on the fed stuff
135814:58 Joebone87: i grabed that for further reading
135914:58 Joebone87: thansk for study share as well
136014:59 AlphaInvestor: Joe - I will be watching both the Yield Curve and the new Near-Term Forward Spread from now on
136114:59 Mobius: Is there an app for that :)
136214:59 AlphaInvestor: there is an example of how to turn the T=Bill price into an interest rate in there too
136315:00 DMonkey: Nube....
1364input n = 10;
1365plot "101" = fold School = 1 to n + 1
1366 with Class = 101
1367 do Class * School;
136815:00 bigworm: I was actually debating if I should do another analysis on the effects of two signals using 4 normality tests to create a probabilty of using z scores as signals when the the probabilty is showing high for normality as opposed to showing low. it was going to be one of my other filters but since you say you transform datay anway, maybe ill look into that.
136915:00 AlphaInvestor: Mobius - not an app, but a chart
137015:00 Mobius: Pencils Down
137115:00 amalia: Getting off desktop as I think I'm happy with what I got for mobile so far. Will update the room next chance I get. Thanks Mobius, Nube, DM for the wonderful suggestions. As mentioned earlier, this room has been a tremendous help as long as you put in as much as the volunteers do.
137215:00 amalia: Dammit DM! why you gotta be smart
137315:00 amalia: That's my line, Mobius haha
137415:01 bigworm: I think after this next year I might be able to contribute something back though. Maybe updated methods on neural networks, Mobius.
137515:02 Mobius: That field is just getting started good and has some real interesting stuff big..
137615:02 DMonkey: we will all be learning from worm in the near future....
137715:03 bigworm: yeah I know I have been reading the text book we will be covering over three semesters and theres alot of ground to cover.
137815:04 bigworm: ill be learnings baysian and machine learning at the same time so they cross over and will be good I think.
137915:05 Joebone87: exciting! good luck big
138015:05 Joebone87: out for the day
138115:05 bigworm: I think I will also do some higher level linear algebra and diffy q courses. The lower lovers were good but im seeing how they apply more and more
138215:05 bigworm: later joe
138315:06 Nube: Worm is too smart for me to learn from :(
138415:06 bigworm: lol no
138515:06 amalia: I’m your learning partner Nube.
138615:06 bigworm: often I feel like others get whats going on, but studying with them I have noticed there are more people that fake knowing whats going on.
138715:06 amalia: #mobilegang
138815:07 amalia: EQ>IQ
138915:07 AlphaInvestor: <<-- Fake it 'til you make it
139015:07 amalia: <<— master copy/paster
139115:07 AlphaInvestor: <<-- IQ < Shoe Size
139215:08 bigworm: lol im more of learn what I can from people kind of guy. In the Military I was always in leadership roles but I listened to people because sometimes people will suprise you with what they can bring to the table.
139315:09 bigworm: I dont like to fake it
139415:10 DMonkey: I'm good at arguing a point in a formal manner.....does that make me a Master Debater?
139515:10 bigworm: lol
139615:11 amalia: Whenever your ready to argue let me know
139715:11 amalia: *you’re
139815:12 amalia: Fold sucks. Prove me wrong.
139915:17 DMonkey: proof is the process or an instance of establishing the validity of a statement especially by derivation from other statements in accordance with principles of reasoning.....so here goes.....fold doesn't suck.....DMonkey.....winning.....
140015:17 Nube: I once saw DMonkey write someone directions through Manhattan using a single fold statement
140115:23 Mobius: Y'all be well. I'll likely be gone for a bit. If all goes well maybe next week.
140215:24 bigworm: what are you doing?
140315:25 bigworm: vacation?
140415:26 amalia: :)
140515:26 DMonkey: you folks take care....
140615:28 amalia: Laters
140715:30 Nube: Take care, Mobius. See ya soon.
140815:32 FrankB3: FYI: Mr Mo's Volume_Precent_R may work well as an entry, with Mr. Mo's long tail doji http://tos.mx/GLZIEt
140915:33 Nube: MTS1, there's a multiple aggregation MA study on MyTrade that doesn't use the stock aggregation periods, it just grabs price ever x bars. You could use the price measurement portion of that script to get around the aggregation period issue
141015:33 Nube: Or try defining each price and run that variable through the current script.
141115:37 AlphaInvestor: DMonkey/Amalia - when all you have is a hammer, everything looks like a nail. When you also have a FOLD, some things look screwy
141215:38 FrankB3: what if you don"t have nothing?
141315:45 MTS1: That's something Frank
141415:46 AlphaInvestor: What if you ain't got no good grammer
141515:46 FrankB3: Yep, nerver thought of it that way
141615:47 FrankB3: In this room: its the idea that counts
141715:47 Nube: If you don't have nothing, request a vend
141815:47 AlphaInvestor: Nube -1
141915:47 FrankB3: whoa
142015:49 FrankB3: there is enough arms and legs foating around in here to make a Frankenstien indicator
142115:55 Nube: If I knew how to read a Frankenstein Indicator I would trade it
142215:57 FrankB3: Which, brings me to the second point: no indicator will make you money... you need a trade plan or a mentor
142316:00 MTS1: You need a plan you've built and tested so you have confidence in it and know how it behaves. If you put 10 traders in a room and give them the best trading plan; does not mean they all make money.
142416:01 FrankB3: Yes, must have tested it
142516:04 JC_: I need a nonsense indicator.
142616:05 FrankB3: Would you say a mechanical method would be better ? I know when emotions are involved I always make the wrong decision
142716:12 Nube: Plenty of nonsense indicators out there
142816:12 AlphaInvestor: I wrote several of them
142916:12 amalia: I just gave one earlier.
143016:13 AlphaInvestor: I have 3, count them Three, Moon Phase indicators
143116:15 amalia: Joke all you want but the last three full moons gave way to buying opportunities
143216:15 JC_: Nube.. I need one that when they start - tariffs - China - Greece - Flash crash - HFT, etc . It can short the ES for 15pts.
143317:49 nickelpony65: stuck in google at 1168 what should i do into earnings
143417:49 AlphaInvestor: wrong chat room - this is thinkScript only
143517:49 amalia: Buy some more.
143617:54 DMonkey: Just evoke the part of your plan that you had before you entered the trade, if the trade went against you.
143717:58 AlphaInvestor: DMonkey +1
143818:01 TrainDoodle: I will litterally paypal someone $200 to write a code for me
143918:02 MTS1: Train; soliciting is banned here; be careful. .
144018:02 AlphaInvestor: Train - against chat rules to soiicit in TOS chat rooms
144118:02 Vimes: again?
144218:02 TrainDoodle: Isnt soliciting selling something ?? Im not selling something
144318:03 AlphaInvestor: Train - I could probably help ... but you insulted my good friends earlier today
144418:03 Vimes: everybody here is quite willing to help for free - its a forum to help develop scripts
144518:03 Vimes: + what alpha said
144618:03 TrainDoodle: I did no such thing alpha
144718:03 AlphaInvestor: Goodbye
144818:03 MTS1: Soliciting services. . You've been provided plenty of free code earlier; you can send appreciation if so listed on their MyTrade pages. .
144918:04 amalia: TD, no direct soliciting. Check out MyTrade of some people in here and there should be contact info but for the most part, we help YOU code what you want. Wether it matches what you want to see is another story.
145018:04 TrainDoodle: The code was invalid
145118:04 Vimes: Train are you looking for the same request as earlier or something new?
145218:04 amalia: Then you didn’t explain yourself fully.
145318:05 Vimes: Mobius posted a new version above that met your criteria - you need to ehlp in the process and redefine what is not correct in your criteria
145418:05 amalia: 1+1=2 so don’t expect it to equal 11.
145518:05 TrainDoodle: I explained it completly including mutiple day and time stamps on a 4 hr EUR/USD chart s
145618:05 TrainDoodle: Vimes I never saw the new version how can I see archives ??
145718:06 Vimes: i don't have it the buffer is gone for me
145818:06 MTS1: Train; do the math, explain the math, and it can be coded. Do your own homework; don't let us find your examples and do your math homework.
145918:07 TrainDoodle: Ive actually re done ll the math tonight and have been redoing the BodyHeight / CandleRange <= .18 and
1460 Shadow / CandleRange >= .65 and
1461 Wick / CandleRange <= .18
1462 then h
1463
1464Part of the code .... the second half is actually incorrect as well
146518:08 TrainDoodle: Im glad you all love each other in here but ... as tough as it is to belive, he made a mistake and not recognizing it is pretty disheartening
146618:09 Vimes: Train - sounds like you have a great starting point then to fix it - so have at it and contribute the correctinos that match what you are trying to say
146718:09 amalia: ^
146818:10 TrainDoodle: When I place
1469
1470input TrendLength = 2;
1471
1472def o = open;
1473def h = high;
1474def l = low;
1475def c = close;
1476def x = barNumber();
1477def nan = double.nan;
1478def TakuriTrendDn = IsDescending(c, TrendLength)[1];
1479def BodyHeight = AbsValue(c - o);
1480def CandleRange = h - l;
1481def Shadow = Min(c, o) - l;
1482def Wick = h - Max(c, o);
1483def TakuriDn = if TakuriTrendDn and
1484 BodyHeight / CandleRange <= .18 and
1485 Shadow / CandleRange >= .65 and
1486 Wick / CandleRange <= .18
1487 then h
1488 else TakuriDn[1];
1489def TakuriDnX = if h == TakuriDn
1490 then x
1491 else nan;
1492plot TakuriLine = if x >= HighestAll(TakuriDnX)
1493 then HighestAll(if isNaN(c[-1])
1494 then TakuriDn
1495 else nan)
1496 else nan;
1497 TakuriLine.SetStyle(Curve.Firm);
1498 TakuriLine.SetLineWeight(1);
1499 TakuriLine.SetDefaultColor(Color.Cyan);
1500AddChartBubble(isNaN(close[3]) and !isNaN(close[4]), TakuriLine, "Takuri");
1501# End Code
150218:11 TrainDoodle: when i put this study on that code results in every single candle being identified as meeting the criteria .... all i did tonight was dfine tune the .18 .65 .18
150318:11 TrainDoodle: obviously it should not say that every single candle is a (yes)
150418:12 TrainDoodle: ... and finally the feedback I was looking for from the code was an up arrow under the candle that meets this criteria
150518:13 Vimes: i don't know what you mean by every candle - the script draws a line at the dtected candle so you can identify and play the break above this candel
150618:14 Vimes: its exsactly wath the setup requires
150718:14 amalia: Train, I would suggest using the drawing tools to draw up what you’re looking for then we have something solid to go off of. Just an idea.
150818:14 TrainDoodle: what draw tool ??
150918:15 amalia: There’s a bunch
151018:15 TrainDoodle: Do you mean you want mw to mark up a chart ?
151118:15 amalia: Si
151218:15 amalia: Then share the chart link
151318:15 TrainDoodle: ok
151418:16 amalia: Also point out where the study is not matching on the same chart
151518:20 TrainDoodle: http://tos.mx/HNg0gz
151618:22 TrainDoodle: You have to zoom in a couple times.
1517The two candles I highlighted look like hammers but the hammer code doesnt pick them up.
1518
1519They have small bodies, small wicks and long shadows all relative to the candle range
152018:25 TrainDoodle: In the world of "academia" and I use that term lightly regardless of the color of the candles i showed as an examples, when it comes after a down candle the next candle is green over 70% of the time
152118:25 amalia: I’m on mobile but how I would break it down is do the math that matches the lookalike hammers and then compare the math and what the difference is.
152218:25 TrainDoodle: I did
152318:26 amalia: Don’t think so. What’s the CandleRange of that lookalike hammer?
152418:26 amalia: Then compare to the criteria in the code you posted above
152518:27 amalia: If you don’t have the value for the CandleRange for the lookalike, you don’t break it down to compare differences.
152618:27 TrainDoodle: I did the math on the one to the right
152718:27 TrainDoodle: hold on i have it all here
152818:27 amalia: What’s the BodyHeight/CandleRange on the lookalike?
152918:28 TrainDoodle: Candle Range = .0043
1530Wick = .0007
1531Shadow = .0028
1532Body Height = .0008
153318:28 TrainDoodle: The code he sent said BH / CR = < I did the cal and entered .18
153418:28 TrainDoodle: Shadow .0028 / CR = > .65 after calc
153518:29 TrainDoodle: wick .0007 / CR .0028 = < .18 after calc
153618:30 TrainDoodle: The candle to the right of the two I showed on the chart meets all three of these criteria
1537
1538 BodyHeight / CandleRange <= .18 and
1539 Shadow / CandleRange >= .65 and
1540 Wick / CandleRange <= .18
1541 then h
154218:33 amalia: That’s .6511. Doesn’t match the code’s <.18 criteria
154318:34 amalia: So it won’t return positive
154418:38 TrainDoodle: We're close
154518:42 Vimes: how about something like this:
154618:42 Vimes: #chat request
1547#vimes
1548#takuri bullish reversal
1549
1550def shadow = min(open,close)-low;
1551def body = absValue(open-close);
1552
1553def isTakuri = shadow > 3*body and high <= 1.00005*max(open,close);
1554def avgRange = 0.05 * Average(high - low, 20);
1555def inRange = (high-low)>=0.5*average(high-low,20);
1556plot whereisTakuri = IsDescending(close, 10)[1] and isTakuri and inRange;
1557
1558whereisTakuri.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
1559whereisTakuri.SetDefaultColor(GetColor(0));
156018:42 TrainDoodle: Ill try
156118:42 Vimes: you can add input paramters and adjust as needed because the candle identifycatino is somewhat subective
156218:44 TrainDoodle: http://tos.mx/sSQLBp
156318:45 TrainDoodle: it claims every candle "hits" let me see about adding the three ands
156418:47 TrainDoodle: LOL well if you open that chart I just shared it DID find the canldes I want it to find ... it just found said yes to them all :)
156518:47 Vimes: i think i see the problem you are copying the code and you need to exclue the last plot statemtn
156618:48 TrainDoodle: so just
156718:48 TrainDoodle: def shadow = min(open,close)-low;
1568def body = absValue(open-close);
1569
1570def isTakuri = shadow > 3*body and high = 1.00005*max(open,close);
1571def avgRange = 0.05 * Average(high - low, 20);
1572def inRange = (high-low)>=0.5*average(high-low,20);
157318:49 Vimes: no you left the plot Data = close; in from the default study which is why you see every bar
157418:52 TrainDoodle: No nothing comes up
157518:52 TrainDoodle: It cant be done
157618:53 Vimes: chang ethe format from a point to an up arrow on the gear box and you should see plenty of arrows
157718:53 TrainDoodle: on the code yoiu sent ? k hold on
157818:56 TrainDoodle: Now it finds none
157918:56 TrainDoodle: def shadow = min(open,close)-low;
1580def body = absValue(open-close);
1581
1582def isTakuri = shadow > 3*body and high = 1.00005*max(open,close);
1583def avgRange = 0.05 * Average(high - low, 20);
1584def inRange = (high-low)>=0.5*average(high-low,20);
1585plot whereisTakuri = IsDescending(close, 10)[1] and isTakuri and inRange;
1586
1587whereisTakuri.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
1588whereisTakuri.SetDefaultColor(GetColor(0));
158918:57 TrainDoodle: when i paste that is asking me for something fter that last semicolon
159018:57 TrainDoodle: What if we strted with something that seems like it would be incredibly simple
159118:58 DMonkey: #StudyName: Less Restritive Hammer
1592#Description: If bar opens && closes in upper 35% then color orange
1593#Author: DMonkey
1594#Requested By: chatroom discussion TrainDoodle
1595# Ver 1 Date 7/10/2018
1596# Can easily be reversed by changing upper and lower percentages.
1597# You can add an arrow as well...
1598# This finds both you candles described.....
1599
1600input upper = .65;
1601input lower = 0.00;
1602def c = close;
1603def h = high;
1604def l = low;
1605def o = open;
1606def na = double.nan;
1607def data = (c - l) / (h - l);
1608def condition = if between(data,lower,upper)
1609 then na
1610 else c;
1611def data2 = (o - l) / (h - l);
1612def condition2 = if between(data2,lower,upper)
1613 then na
1614 else o;
1615def condition3 = IsDescending(value = CLOSE, length = 2)[2];
1616AssignPriceColor(if condition && condition2 && condition3
1617 then color.orange
1618 else color.current);
1619# End Code
162018:58 TrainDoodle: What if we asked to Identify every candle with an arrow under it whose shadow was > .7 of its candle range ???
162118:58 TrainDoodle: Monkey if it works drinks all around
162218:59 DMonkey: drinks are on you cause it works just fine....
162318:59 TrainDoodle: MMMMMMMOOOOOOOOOONNNNNKKKKKKEEEEEEYEYYYYYYYYYYYYYYYY
162418:59 TrainDoodle: GOOOOOOOAAAAAAAALLLLLLLLLLLLL
162519:00 Nube: THnaks for the drink, I'll take a Macallan
162619:00 TrainDoodle: gooooooaaaaallllllll
162719:00 TrainDoodle: This isnt over Monkey - i will take care of you
162819:01 TrainDoodle: i should probably make sure I copy and paste this into pages document before I muck it up
162919:04 Nube: Time to weigh in with thoughts, fam. Two version of the same alternate aggregation study. The purple dot is the last closed hgiher agg bar. After that, the version on top uses the floating close (exactly like the stock higher aggregation would), the lower uses the close values of each shorter bar along the way until that higher agg bar closes. Do you prefer the stock style or would you prefer to see the "path" the indicator line takes?
1630
16319:08 Vimes: i would probably trade off the close of the bar - but the bottom graph gets tons of style points
163219:08 TrainDoodle: DMonkey do you have a myTrade profile ?
163319:09 Nube: Thank you, Vimes.
163419:10 DMonkey: All TOS clients do....
163519:10 TrainDoodle: Vimes and Amalia - I want to thank you as well for helping tonight - I was put on blast earlier today because a code wasnt even close. I gently brought up how it doesnt work and got lit up ... at which point people piles on me
163619:10 TrainDoodle: how do I finid yours
163719:11 Nube: Right click on his name
163819:13 Farmin: missed out on all of today's fun, but one thing you'll need to learn is that 'it doesn't work' is not the same as it doesn't do what I think it should do.
163919:15 TrainDoodle: Farmin, and I say this with a smile on my face. If a guy tells me he's the best driver in the world and I say ok go try my red porsche and he sits in the blue porsche and tells me my porsche is the problem because it wont start .... ummmm
1640
1641
164219:16 TrainDoodle: Im very grateful for anyone that tries to wirte a code for all of us. but he wouldnt listen
164319:16 Farmin: most get out of this room what they put into it and how much effort they exert. show some effort and you'll be rewarded.
164419:17 TrainDoodle: I never did give up. tonight Vimes and amlia were awsome trying (they understood) and then DMonkey banged it out
164519:18 Farmin: it's not about you giving up, it is you learning that coding is a very precise task and if you don't exactly specify what is wanted, you are going to be frustrated.
164619:18 TrainDoodle: See you just want to argue as well . I was more than clear - Mobius wouldnt listen
164719:19 Nube: Wasn't at all clear to me. I read it the same way as Mobius did.
164819:20 Vimes: Train mobius is the most respected contributor on this forum - i would drop it
164919:20 Farmin: no and no, but have your red porsche. best not to throw stones tho
165019:20 TrainDoodle: i dont have a red porsche ... that was an anology ... I have a wife and three daughters and two dogs that poop oon the floor ... my porsche is sometime away
165119:21 Farmin: pretty much for all of us.
165219:21 TrainDoodle: I have three college ans three weddings to pay for ... ill be lucky to have a red porsche hat someday
165319:22 Farmin: get them to elope
165419:22 Vimes: well step one - don't trade based on that indicator :)
165519:22 TrainDoodle: I did
165619:22 Farmin: vimes +1
165719:22 TrainDoodle: well my wife and I did and her dad gave us $10 grand as a wedding present back in 2000
165819:22 TrainDoodle: That indicator is only the first building block
165919:25 Nube: If you need an indicator, have I got a deal for you. Free, just replots a little sometimes.
166019:26 Farmin: nube, don't peeps look for entries/exits on shorter aggs and get the bigger picture from the higher agg? not sure exactly how that relates to your question, but maybe there's wisdom in there somewhwere
166119:27 Farmin: anyway, gotta run. see y'all tomorrow.
166219:28 Nube:
1663
1664
166519:28 Nube: And sometimes it happens to be the same.
166619:35 amalia: YMU8: Approximately a 120 point decline in the final five minutes of trading with less than 1500 contracts volume.
166719:37 baron_12tg: is it possible to place a mtf in a scan
166819:38 amalia: Yes. Separate rows
166919:39 baron_12tg: i want to scan a weekly mtf indicator on a daily chart. may i ask help Amalia on this ?
167019:40 amalia: I’m on mobile so not much help.
167119:40 baron_12tg: i have tried my heart out but lack the scripting ability that most have on here
167219:40 amalia: Me too
167319:41 Vimes: Baron, what indicator? Typically you just change the aggregation in the scan options
167419:41 Nube: baron, you can't reference another agg in the scanner. You will have to scan that indicator on weekly agg, then scan the daily indicator on daily agg etc. Basically one line of scan per agg
167519:41 baron_12tg: i will send it i tries adding it as a study but says its not doable
167619:43 baron_12tg: http://tos.mx/pztYlh
167719:47 davvito220: any sample scripts that deal with displaying bid and ask? trying to display bid size and highest bid for each candle
1678------ Wednesday, July 11, 2018 -------
167906:03 InFlow: Hi!
168006:04 InFlow: Trying to set up RTD for a watchlist with "Last" value
168106:04 InFlow: but having just empty cells
168206:05 InFlow: got latest excel
168306:05 InFlow: any suggestion please?
168406:06 InFlow: =RTD("tos.rtd", , "LAST", "AAPL")
168506:12 InFlow: this is ok, but =RTD("tos.rtd", , "LAST", A1), where A1 is AAPL, returns empty cells..
168607:22 Paris: Mobius, saw your comment in yesterday’s chat. Yep, I did archive all 5 versions of the Takuri work that were discussed yesterday. It was a rather extended session.
168707:25 Vimes: Inflow that statement works for me even with the reference
168807:25 Vimes: maybe close excel and re-open - if you shutdown TOS with excel open sometimes the RTD breaks
168908:20 xiaoze8090: Does anybody know there is any API to read data from a file?
169008:22 LetItSnow: No file I/O in thinkscript
169108:22 Nube: There isn't.
169208:23 xiaoze8090: oh, thanks LetItSnow and Nube.
169308:24 xiaoze8090: @Nube, do you know any API to trigger creating the BUY/SELL order?
169408:26 xiaoze8090: for example, I want to trigger BUY action when RSI <=20?
169508:26 Nube: Not for normal people. For accounts that qualify TD can provide pretty much anything
169608:27 mthfr_vaxxed: is that the example you plan to automate? b/c if so i think you need to try backtesting that first with a strategy and see if you really wanna do that
169708:27 MTS1: Xia; look up conditional orders
169808:28 MTS1: Simple scripts are allowed there; you can test them with marketwatch alerts: If they trigger there you can use them in conditional orders. (simple = no recursion or fold)
169908:28 Nube: A buy condition based on state value is going to buy every at 20 or lower. Rethink the logic.
170008:29 Nube: every *bar
170108:30 mthfr_vaxxed: and trade with paper money first...otherwise you'll regret your decisions with real money
170208:33 xiaoze8090: @mthfr_vaxxed, I see, I just give a sample, actually, my model is more complexity, I need learn how to code from simple, but If I can't read data frome a file, it is really sad
170308:38 mthfr_vaxxed: you gotta do that work outside of tos and then somehow integrate it as an input to a TOS script
170408:40 xiaoze8090: @Mthfr_vaxxed, It is a good idea, do you have any example of the TOS script, how to input the result and how to trigger creating an order?
170508:48 AlphaInvestor: Input myData = 42;
170608:49 amalia: Funny how history repeats itself. We had a volatile market on this day last year as well.
170708:52 mthfr_vaxxed: you have to create the order manually. you can only have a conditional statements that need to be True for order to submit. so you could put in a buy for a stock with condition of RSI < 20 ... and it would do it. if you need another order for another stock you gotta setup that one too. no automation for that... and for good reason. it can get you into trouble quickly if you dont know what your doing
170808:53 mthfr_vaxxed: you can backtest strategies though that create "fake" orders to check how good your strategy is. but after that its back to manually creating orders with proper conditions.
170909:00 xiaoze8090: @mthfr_vaxxed, In fact, my research team will send me a mail of the "buy" or " sell" ticker everday, I want to auto trade it on the TOC, but seems hard to do it.
171009:03 mthfr_vaxxed: get something to build your orders for you and then you can just paste them into TOS order entry.
1711
1712Example order : BUY +100 MDGS TRSTP MARK+.10 (STP 2.05) MARK
1713
171409:04 mthfr_vaxxed: right click any order and click copy and you can see what the order actually looks like so you can build it yourself
171509:07 xiaoze8090: @Mthfr_vaxxed, I will try it, thakns
171609:08 amalia: yw
171709:10 PennywiseDollaFullish: Pardon my intrusion, is there a way to setup a trigger for "sound alert" to a custom field value ?
171809:12 Grit: GM Amalia
171909:20 MTS1: Penny; not sure what you're asking; but search "alert" in the left top filter box in the Reference section of the manual for function syntax and examples
172009:20 MTS1: (http://tlc.thinkorswim.com/center/reference/thinkScript/)
172109:20 Grit: Good Moring All.
172209:21 MTS1: GM'
172309:21 Grit: I need help for script for Overlapping 10 TK Range Bar on 2 TK Ranger Bar Chart. Every time 10 TK Range Bar formed. It that possible to plot Add cloud (10 TK ranger Bar without Wicks) on 2 TK Range Bar Chart.
172409:21 Grit: Multiple time frame analysis
172509:22 MTS1: Believe this was discussed yesterday Grit; any new details? Most of us here don't use range bars, mainly time or tick. But believe you got the answers with the options you could consider?
172609:23 MTS1: 'best' option to get started may be to use a grid if you're not using that already that show the different 'timeframes'
172709:23 Paris: MTS - you're right, it was discussed at length in yesterday's chat
172809:24 Grit: I run the script and I covered Wicks parts too. and I didn't work for Tick
172909:25 Grit: Bar Chart.
173009:25 Grit: only time
173109:26 Grit: If I get scipt which only cover Body part with out wicks . It will be great.
173209:26 MTS1: OK Grit; there are restrictions on range bar charts; it may not work as you intend. Like I said most here don't use range and may not be interested in tackling this further (or may not be possible anyway). Try the grid?
173309:26 Grit: I went to website as Amalia told me.
173409:27 Grit: did some research too.
173509:27 Grit: please help me.
173609:28 MTS1: Does using a grid not work for you?
173709:28 AlphaInvestor: Grit - did you Read the Manual?
173809:28 Grit: GM AlphaInvestor.
173909:29 AlphaInvestor: Gm Grit
174009:29 PennywiseDollaFullish: Thank you MTS1, sorry for not being clear, as you know we can create "custom" fields with thinkscript, withing the script is there a way to call the "Alert" function?
174109:30 AlphaInvestor: Pennywise - look up the Alert function in the manual. There are 3 different ways to create alerts.
174209:31 MTS1: Penny; there are several alert options; sound options are only chart based, marketwatch alerts, dynamic watchlist alerts. So if you build your DL based on your custom forjula you may be able to accomplish what you are looking for.
174309:31 MTS1: *formula
174409:31 Grit: I did. I am not good coding but I know how to put script on system.
174509:31 Grit: I did read the Mannual
174609:32 MTS1: Grit - re-read my statement at hh:26
174709:34 Grit: Ok. Grid.
174809:35 PennywiseDollaFullish: MTS1: Let me clarify further, If you look at the market watch> Alerts tab, you can have a column where it says "Source", and these "Source" could be a "Price Condition" or a "Study" in my case the "Study " is basically a "Custom Field", so can the "Source" coloumn be a "Custom Field" i.e "Custom1...Custom2 etc?
174909:36 Grit: MTS1 how about TK Bar Chart.
175009:37 MTS1: Penny; check out DL Alerting? Byt yes you'd use the same study / logic
175109:37 MTS1: TK??
175209:38 amalia: Tick
175309:38 Grit: Aggregation type Tick
175409:38 Grit: GM Amalia
175509:39 AlphaInvestor: Penny - A custom field is really a study in disguise
175609:39 PennywiseDollaFullish: MTS1: I got it , it is little convoluted, you have to make the "Custom Field" as a Study" and assign the Study to the alert....it is fuunny, if the folks at tOS can assign the "Custom" Field as a source for alert, now they have "Study" only.
175709:39 amalia: The only suggestion, because I do not know the full spectrum of any other type of chart, is to make the candles appear as a Line then make two range studies: one with two tick ranges and another with ten tick ranges. That’s going to be the quickest remedy for your situation until you learn how to get what you really want. I think you’ll have to settle for that for now, Grit.
175809:40 MTS1: Grit; same restrictions afaik. You may be able to approximate maybe by checking the bar numbers and counting 5 back, but options were discussed in detail yesterday. (Counting does not get you the exext start of the higher agg as there is no 'time').
175909:40 PennywiseDollaFullish: Yes AlphaInvestor, You are correct ...that the think or swin technical t4eam should consider the "Custom Field" to be exposed as a "Class"
176009:41 MTS1: Penny; just learn the platform. But the 'source' is always ThinkScript which can be used in multiple places, like custom columns or search filters. You';re just starting in a different place and assume it all should be called custom columns?
176109:42 Vimes: Hopefully not too off-topic - but how many charts do you guys typically have open and still maintain good performance?
176209:42 PennywiseDollaFullish: Yes my fried been using TOS for 10 years, there are little "caveats" in the platform, which can be little simpler
176309:42 amalia: One, V.
176409:43 Vimes: you are a mobile trader? right
176509:43 MTS1: Vimes; I have about 30 windows open at the moment including several grids, including a 12 grid and 15 grid chart.
176609:43 MTS1: *window
176709:44 Paris: I know ALphaInvestor will have quite a few open
176809:44 AlphaInvestor: Penny - just copy your custom column script into a companion Study. Then call it using the study.
176909:44 MTS1: I've had more and don't use all actively, just what I happen to have open without impacting performance.
177009:44 Vimes: I havea round 12 open and even typing in the chat lags considerably
177109:45 MTS1: Vimes; hoe much mem assigned to TOS (settings wheel on the login window)?
177209:45 MTS1: You probably have too much (counterintuative I know).
177309:46 RayK: My buffer is missing from 15:20 to 15:34 EDT Yesterday (Tuesday). It is not in JQ’s archive. Can someone lease PB it to me? Thanks in advance.
177409:46 MTS1: You have a decent system / cpu?
177509:46 Vimes: 4096/6194 i lowered it based on mobius recco last week
177609:47 AlphaInvestor: Paris - you bet. I got about 90 open.
177709:47 Vimes: its a brand new box 32
177809:47 PennywiseDollaFullish: AlphaInvestor, I did the same ...exactly, now I will call the study within the Alert
177909:47 Paris: ALpha - heh
178009:47 MTS1: Lower it further Vimes; try starting at 2G or less with max 3G
178109:49 Vimes: k thx - its only during market hours - i lowered the data rate to 1 sec to try and help after hours its fairly peppy
178209:49 MTS1: Otherwise - Reliable / fast internet seems to be key to TOS performance
178309:49 AlphaInvestor: Ray - you don't want it, ... trust me
178409:49 PennywiseDollaFullish: ALphaInvestor, did you notice when you assign the "Custom Study' as a study in the chart, all the Upper and lower charts are assigned the same "Study" across the screen, it is interesting way to handle the screen... I dont like it, I will remove it and assign it on the "Alert Side"
178509:50 RayK: AI, I'm trying to maintain a faithful copy of the buffer...
178609:50 MTS1: Oh; that is another key setting; try 3 seconds (moderate); may not work for you daytrading, but confirm performance diff.
178709:50 Paris: Ray - you didn't miss much
178809:51 amalia: I can confirm but RayK wants it.
178909:51 amalia: Yes, V, I mainly trade on mobile.
179009:52 Paris: amalia - that explains the couple of studies you posted yesterday on Weekly Min Range
179109:54 AlphaInvestor: Ray - I don't have a copy, sorry
179209:54 RayK: AI, Paris, Amalia - thanks
179309:59 beanie: Hi. Question here, hope someone can helps Is there a limit on study alerts, I find that when I create alerts, it gets cancelled automatically. This started around June but I only realizing it now.
179410:01 Paris: Ray - I just emailed it off to you 10:01 Lh58: RayK PB gPWB85hV
179510:02 juz938: Is it possible to change the font size in the Live News window?
1796
1797The font size is huge compared to the app's UI
179810:03 UpTheCreek: that's a thinkscript q?uestion
179910:03 UpTheCreek: ?
180010:04 beanie: Mine is I think.
180110:04 UpTheCreek: beanie, , others were asking a few weeks back. don't think an answer was found here
180210:05 beanie: oh, ok. Thats great. Thought they were targetting me. (I had a lot)
180310:05 beanie: All were cancelled
180410:05 UpTheCreek: bummer
180510:05 beanie: I just tried to create some and only 2 kept alive. I thought some junior guy went in and deleted all the study alert because it takes too much CPU :)
180610:06 beanie: I will email support and see what I get
180710:06 MTS1: Beanie; sounded like an issue if the same script was used on multiple tickers; workaround was to add a # in each subsequent 'duplicate' alert.
180810:06 UpTheCreek: best idea
180910:06 beanie: Add a #?
181010:06 beanie: comment in the code?
181110:06 UpTheCreek: that for alerts or column codes?
181210:06 beanie: Alerts
181310:07 MTS1: That's what he said, did not experiment myself. He said did not need multiple copies of the script (with addl #), just in the alert I understood anyway.
181410:07 beanie: I have something similar to if a stock goes above 200MA for x days, then alert.
181510:07 MTS1: Maybe after you reference the study add a #, next time add 2, etc.
181610:07 beanie: and i put it on a bunch of tickers
181710:07 beanie: ok, let me try, #SYMBOL
181810:07 MTS1: Try it and report back?
181910:08 _Coleman_: Does anyone know of a way to scan for money volume as you can for share volume?
182010:08 UpTheCreek: multiply volume by price
182110:09 AlphaInvestor: nope, PEBKAC error
182210:12 beanie: MTS1: It seems to work (for now)
182310:13 beanie: I was actually trying to proxy thinkswim to see if I can create the alerts without using the GUI interface. Didnt have much luck and wouldn't have help this anyways. Using GUI is super tedious
182410:15 Vimes: thanks mt51 - seems better so far - i have 150MBps down but my up speed is much slower - wonder if that is causing the issue- anyway thought it might be due also to indicators which is why i posted here
182510:17 Vimes: Amalia, do you trade on your phone, ipad, or other? i travel quite a bit so was wondering a good setup
182610:17 expirationeddie: Where&aposs Steve patrol? Is he fed up w tech support forum? Lol
182710:18 amalia: iPhone 6s+. I only use about 2-3 studies for daytrading YM/ES on mobile and all of them are mobile friendly now. I get back on desktop for the other strats.
182810:21 Paris: RayK - yw, note that the timestamps are different as Im from a non-U.S. timezone, but you'll be able to select the missing sections you're looking for
182910:22 amalia: But this is americuhhhh
183010:25 AlphaInvestor: so Paris should edit all the timstamps to RayK's timezone ... ha
183110:29 amalia: lol jk. A little bored and I want the ratings in here to go up so I said what I said
183210:30 Paris: I'll ignore all future requests
183310:33 amalia: oh my we’re getting feisty in here. bbl
183410:35 mthfr_vaxxed: anyone check out wireshark and see if they can automatically gather chat logs that way?
183510:37 UpTheCreek: pretty sure the connection is SSL'd
183610:39 AlphaInvestor: it sure better be, I am transmitting my trade on it
183710:39 RayK: Paris, thanks
183810:39 RayK: AI, not to worry. I'll figure it out!
183910:41 mthfr_vaxxed: it is SSL. but if we have secrets somewhere we can decrypt. guessing secret is probably embedded in source instead of a file on system?
184010:44 mthfr_vaxxed: probably hidden in one of those jars
184110:44 mthfr_vaxxed: a task for another day
184210:45 marketcoding: How do I code an EOD exit of any open positions?
184310:45 expirationeddie: C&aposest la vie
184410:46 AlphaInvestor: Market - in a backtesting strategy, or a real trade
184510:47 marketcoding: In a conditional order for paper money?
184610:48 AlphaInvestor: why not just use MOC order
184710:48 MTS1: mth; the chat function is probably in one of those jars anyway;) Bit above my paygrade to check out. .
184810:49 marketcoding: Because they are conditional orders based on a study. Sometimes they are placed and sometimes out of the market.
184910:49 Vimes: for a study this iis what i use
185010:49 Vimes: #Exit at end of day
1851AddOrder(type = OrderType.BUY_TO_CLOSE, condition = secondsfromtime(1555)==0, tickColor = Color.ORANGE, arrowColor = Color.ORANGE, name = "CLOSE at EOD", price = CLOSE);
1852AddOrder(type = OrderType.SELL_TO_CLOSE, condition = secondsfromtime(1555)==0, tickColor = Color.ORANGE, arrowColor = Color.ORANGE, name = "CLOSE at EOD", price = CLOSE);
185310:50 Vimes: its not robust in that i'm using a 5 minute chart
185410:50 marketcoding: I didn't think 'strategies' were conditional orders.
185510:51 Vimes: no they are completely differrent - correct
185610:51 marketcoding: How would it identify which open position to close at market?
185710:51 MTS1: market; no but he gave you the syntax in the condition portion
185810:51 AlphaInvestor: they aren't, that is why I asked my question
185910:51 Vimes: there is no sort of algo trading so to speak for each postiion you have to place the order conditions into the broker
186010:52 marketcoding: Vimes, thank you. Can you help me figure it out via skype?
186110:53 MTS1: He's just sharing what he has so you can try it on your paper trade conditional order. Conditional orders are limited; no fold or recursion. You can test them on paper trade like you're doing, or marketwatch alerts are a good place also as they have the same restrictions.
186210:53 Vimes: no i don't have skype installed
186310:53 MTS1: And we can't exchange personal details in here; best option is MyTrade pages.
1864
1865
1866
1867
1868
1869
1870
1871
187211:18 Vimes: i don't know you trade logic - click on the bid on the instruemnt and for example seelct buy custom chang ethe closing order to MOC, click the gear icon on the buy order add your study logic etc..
187311:19 Vimes: i don't think its a thinkscript quesatin more than a trade question so call support and they will gladly help you
187411:20 marketcoding: So OCO for the sell orders but not OCO for the buy orders?
187511:22 MTS1: Use them however they work in your strategy; they can be buy or sell. Trade desk is best resource for this.
187611:23 marketcoding: ok, ty
187711:23 mthfr_vaxxed: 1st triggers OCO ... meaning .... 1st = buy ..... one cancels other would be SELL trigger and SELL MOC
187811:24 marketcoding: I'll try first triggers OCO in a bit.
187911:24 marketcoding: Thank you again
188011:25 mthfr_vaxxed: you have a strategy your employing ? or your just getting alerts in an email from someone elses black box strategy ?
188111:29 AlphaInvestor: MOC MOC MOC MOC
188211:30 Vimes: alpha you are funny
188311:30 AlphaInvestor: II first posted that at 11:48 ET, almost and hour ago
188411:33 Vimes: yep - i got down a rathole trying to trigger the close based on a separte study but the MOC answered his question
188511:33 mthfr_vaxxed: think he needed help implemented said MOC into his advanced order. he was probably confused b/c you cant do it with a 1st triggers sequence like he was doing
188611:41 UpTheCreek: It's still a trade desk problem, that stuff they understand
188711:57 RVB: Another Q to build a canslim strategy in TOS and refining C&H and double bottom candidates. Can EPS values plotted on a chart as a line?
188812:01 AlphaInvestor: RVB - yes to your EPS question
188913:01 RVB: beauty Alpha. from studies or custom coded scripts?
189013:02 MTS1: look up the fundamental functions in the reference
189113:03 MTS1: ^RVB
189213:04 RVB: looking thank you . I see it as separate chart feature in the new (2016) earning tab. but trying to see if I can plot those and actually scan for raising values of EPS etc.
189313:07 RayK: My buffer is missing from 13:01 to 14:04. Was there anything in that gap?
189413:07 RayK: EDT
189513:07 MTS1: RVB; You'll find it when you type "earnings" in the reference filter; it's actually under corporate actions functions.
189613:08 MTS1: Nope Ray; you'll get the same contents when you re-open chat. (if you got my replies at 1:02 -1:03 CT).
189713:09 RayK: MTS1 - thanks
189813:14 UpTheCreek: once you start looking at those earnings numbers and compare them with others on the platform and elsewhere, you will quickly realize that there is not one answer, or even 2.
189913:15 monkeystampede: Hi all. I've been thinking about trying to write an auto-ermanometry but haven't the foggiest about how to even begin defing the start and stop points called for in the native TOS study. Anyone have some ideas that may be useful?
190013:19 MTS1: Sounds like some medical procedure;)
190113:19 RVB: MTS1 - Thank you plotting it now and will throw a slope line on it.
190213:19 UpTheCreek: guess that means you call a doctor first
190313:19 RVB: or find a patient first!
190413:21 ramesh2599: Does enyone have a Chande trend meter code for TOS??
190513:21 monkeystampede: LOL
190613:22 monkeystampede: maybe that's the first step to the lobotomy that I need to get this little problem I've given myself
190713:22 amalia: ramesh, define Chande
190813:22 mthfr_vaxxed: "The fixed-ratio is established by calculating the number of bars in the first two trend segments on chart: uptrend and downtrend (or vice versa). You can specify the desired trend segments by starting date and time of the first segment and the number of bars in each."
190913:24 mthfr_vaxxed: MOBO study could get you that data monkeystampede ...
191013:25 MTS1: MonkeyS; if you google it first link is TOS reference, next link is TradersTips link (unfortunately missing TS version, but logic may help you get started).
191113:26 ramesh2599: soory
191213:26 ramesh2599: sorry
191313:26 UpTheCreek: figure out the formula ramesh
191413:26 ramesh2599: ok
191513:26 amalia: I guess that's what I meant to ask first.
191613:29 monkeystampede: thanks guys! I will look into those ideas
191713:29 monkeystampede: or gals, I dunno
191813:29 monkeystampede: or other too
191913:30 amalia: THanks ITS!
192013:30 amalia: lol
192113:37 obiehome: i'm having problem w a thinkscript "IV Rank w Futures". it stopped displayinng data after 13 june. could someone look at script and see problem?
192213:39 RVB: Ramesh TusharChandeVidyaBands are built in TOS
192313:40 obiehome: declare lower;
1924declare hide_on_intraday;
1925
1926def vol =
1927if (close-close("/ES"))==0 then close("VIX")/100
1928else if (close-close("/CL"))==0 then close("OIV")/100
1929else if (close-close("/GC"))==0 then close("GVX")/100
1930else if (close-close("/SI"))==0 then close("VXSLV")/100
1931else if (close-close("/NQ"))==0 then close("VXN")/100
1932else if (close-close("/TF"))==0 then close("RVX")/100
1933else if (close-close("/YM"))==0 then close("VXD")/100
1934else if (close-close("/6E"))==0 then close("EVZ")/100
1935else if (close-close("/ZN"))==0 then close("VXTYN")/100
1936else imp_volatility();
1937input DisplayIVPercentile = yes;
1938input DisplayImpVolatility= yes;
1939input DisplayDaily1StandardDev = yes;
1940input DisplayWeekly1StandardDev = yes;
1941input DisplayMonthly1StandardDev = yes;
1942
1943input TimePeriod = 252;
1944
1945def data = if !isNaN(vol) then vol else vol[-1];
1946def hi = highest(data, TimePeriod);
1947def lo = lowest(data, TimePeriod);
1948plot Percentile = (data - lo) / (hi - lo) * 100;
1949def lowend = Percentile < 25;
1950def highend = Percentile > 50;
1951
1952addlabel(DisplayIVPercentile , concat("IV Rank: ",aspercent(Percentile /100)), if lowend then color.red else if highend then color.green else color.yellow);
1953
1954addlabel(DisplayImpVolatility, concat("ImpVolatility: ",aspercent(vol)), if lowend then color.red else if highend then color.green else color.yellow);
1955
1956def ImpPts = (vol / Sqrt(252)) * close;
1957AddLabel(DisplayDaily1StandardDev , Concat("Daily 1 SD +/- $", Astext( ImpPts, NumberFormat.TWO_DECIMAL_PLACES)), if lowend then color.red else if highend then color.green else color.yellow); ;
1958
1959def ImpPts2 = (vol / Sqrt(52)) * close;
1960AddLabel(DisplayWeekly1StandardDev, Concat("Weekly 1 SD +/- $", Astext( ImpPts2, NumberFormat.TWO_DECIMAL_PLACES)), if lowend then color.red else if highend then color.green else color.yellow); ;
1961
1962def ImpPts3 = (vol / Sqrt(12)) * close;
1963AddLabel(DisplayMonthly1StandardDev, Concat("Monthly 1 SD +/- $", Astext( ImpPts3, NumberFormat.TWO_DECIMAL_PLACES)), if lowend then color.red else if highend then color.green else color.yellow); ;
1964
1965plot LowVol = 25;
1966plot HighVol = 50;
1967
1968LowVol.SetDefaultColor(GetColor(5));
1969HighVol.SetDefaultColor(GetColor(6));
197013:42 ramesh2599: @RVB- is it under study?
197113:45 Nube: Why would the number of bars in the first two trends on a chart mean more than the most recent two trends on the chart?
197213:47 MTS1: Obie; did you confirm all those tickers you're using in there still exist?
197313:52 MTS1: Obie; where's the header of the script, or did you write yourself? What is purpose, what chart / ticker are you running this on, etc?
197413:53 MTS1: Lost Obie?
197514:05 obiehome: script was shared at this site about 5 years ago. it worked fine until 13 june
197614:06 obiehome: it was a study that displayed under the chart. and worked for any stock symbol and futures
197714:06 amalia: 11:47 MTS1: Obie; did you confirm all those tickers you're using in there still exist?
197814:07 RVB: @ramesh yes it is under study
197914:07 obiehome: no - have not checked. possibly a symbol has been dropped or changed
198014:08 RVB: EPS plot with slope to quickly spot uptrending. next to get this into scan to find increasing eps. whew
1981
1982
198314:08 Nube: Out of curiosity, obie, is it plotting the two vol lines?
198414:09 Nube: Good work, RVB.
198514:11 RVB: Thanks Nube. now trying to go after sales growth if it is exposed in tos
198614:13 obiehome: yes, plots 2 iv rank lines. used to determine if IV Rank is high or low. used to determine if IV Rank is high then sell premium.
198714:29 ramesh2599: thank you RVB
198814:29 obiehome: no data received for symbol "VXTYN", which is vol index for /ZN. just discovered this symbol has changed to TYVIX. will change and that should fix.
198914:34 coolguy280: does watch list updates with scan items regularly?
199014:37 RVB: #coolguy if it is attached to a scanquery yes
199114:38 coolguy280: some how when i run the scan query, I don't see any stocks showing up, but in the watchlist attached to this scan query does show up few stocks
199214:39 coolguy280: not sure if I need to do any settings or there is a delay either with watchlist or scan query
199314:40 MTS1: Obie; that data did not stop in June so that's probably not it
199414:42 MTS1: Cool; no details provided to understand or replicate what you're seeing. Normally opposite is reported. But Dynamic Watchlist updates about every 3 min FYI.
199514:43 coolguy280: MTS1, Thanks, so it takes 3 minutes to update and not simaltenously with the scan results?
199614:46 eagertrader: can someone help me find a thinkscript for the following :
199714:47 eagertrader: CNBC often has analysts showing a chart of a stock vs sp500 where the sps500 appears as a flat line ... x axis. So it is mearing the stock relative to the index in this case sp500.
199814:48 eagertrader: how to do this ?
199914:48 eagertrader: any thoughts anyone?
200014:48 eagertrader: I dont know thinkscript... can someone help me?
200114:49 RVB: @eager tgat us just comparison(relative)
200214:49 RVB: there is a study in TOS called comparison
200314:49 eagertrader: comparison shows both plots together
200414:49 eagertrader: I want to see the stock relative to sop500
200514:49 eagertrader: so that sp500 appears as a flat line
200614:50 RVB: choose your proxy as SPX that works
200714:50 eagertrader: yes but spx is plotted ... not as a flat line
200814:51 eagertrader: a flat line on spx allows us to see the stock that is being studies on a relative basis to spx
200914:52 eagertrader: This is a common chart of an analyst who comes on cnbc on fast money... and the charts are visually very appealing
201014:53 eagertrader: Essentially it would be taking the difference between the percentage increase in the stock vs perc incr in spx and plotting. Should be a simple thinkscript for anyone who knows thinkscrips
201114:55 eagertrader: can anyone help ? no?
201214:55 Vimes: see the study comparison
201314:56 monkeystampede: Nube, I believe the theory is that the ratio between those initial trends has relationships to trends in the future. Very similar in essence to time fibs.
201414:57 eagertrader: vimes.... study comparison is not what I am looking for ... but something similar where the index ...spx is the horizontal axis
201514:58 Vimes: gotcah sorry didn't read above the scroll - don't know :(
201614:58 Nube: monkeystamped, what if my chart is 1 day long and then I change it to 2 days long.
201714:59 eagertrader: vimes.... where and how can I get help on this ? any idea?
201814:59 Vimes: i'm guessing you could calculate a trend of the spy and the take the differnece of each bar against this trend of the reference chart
201915:00 Vimes: there isn't really an x-y plot
202015:01 Mobius: eagertrader - your looking for the Relative Strength Indicator, Not RSI but RelativeStrength in TOS
202115:01 UpTheCreek: eager, that's called relativestrength. Its' built-in
202215:01 eagertrader: ok Mobius and upthe creek will try that.... I assume I can put it in the main panel?
202315:02 Mobius: Which you probably shouldn't be using since you saw it on CNBC
202415:02 eagertrader: lol
202515:02 eagertrader: thanks will try it ...
202615:02 Mobius: It's a lower study. Oddly enough the name describes what it does
202715:03 eagertrader: can i get it to show in the main panel?
202815:03 Mobius: Just that question alone screams DON'T USE ME
202915:03 Vimes: you can hide the upper panel in the settings
203015:04 MTS1: Eager; You can turn off the price panel, or not plot the price and drag it to the upper, if this is important.
203115:04 Mobius: You guys are encouraging disaster
203215:04 Vimes: lol
203315:05 eagertrader: why do you say that Mobius... only because I saw it on CNBC?
203415:05 Mobius: Because you've no idea what it does
203515:05 eagertrader: I have used it benefically many times before....
203615:05 eagertrader: just not that chart..
203715:06 eagertrader: have calculated it myself for indices that I have made up
203815:06 eagertrader: thanks Mobius, vimes and MTS1 for your help
203915:07 Vimes: well i must confess i like Jim Cramer don't shoot me
204015:07 Mobius: OK. Then why on God's green earth would you want to put it on an upper chart
204115:07 monkeystampede: dunno Nube, I just thought it would be a challenge to my mediocre programming skills that I could learn from
204215:08 eagertrader: Because all that I want to see is the relative strength and nothing else.
204315:09 Vimes: Eager i use a custom quote in my watchlist that tries to strength by weighting of different time periods - 2*(close/close[63]) + close/close[126] + close/close[189] + close/close[252] for example
204415:10 eagertrader: the lower panels dont seem to show all the detail .... perhaps I am not familiar with it as you are .. Mobius. I will try to see if lower panel does it for me. thanks Mobius
204515:10 Mobius: Oh. So your not trying to put it alongside the price chart! My apologies. It's just a simple ratio of any stock divided by the index. SO I couldn't understand why you'd wnat that on the chart
204615:10 Vimes: if you add SPY into your wtach list and sort you will see which stocks are performing better than the spy - or you can even scan for this
204715:13 UpTheCreek: all panels show whatever detail they have, , if you need it to be bigger, drag it so it gets bigger
204815:15 eagertrader: thanks UPTHECREEK.... it shows in the upper panel ... now how do i get rid of the stock.... meaning what do i do to see only the relative strength and not the stock ?
204915:16 Vimes: setting - unclick show price subgraph
205015:16 Vimes: but in that case you would want your indicaotr as a lower study
205115:17 obiehome: MTS1 i tried the symbol change (to TYVIX) - and same problem exists, like you said. problem must be elsewhere.
205215:19 eagertrader: vimes... yes I get it... One last question.... now if I want to see the relative strenthg of two or three different stocks .... how do I do it.... so say i want to compare aapl, fb,,,, amzn vs sp500 ?
205315:19 admin_SafetyFirst: t
205415:20 Vimes: take your new found script duplicate it and add input fields for additional stocks
205515:21 eagertrader: OK vimes... thanks a lot..... have a great day. thanks to others who helped too
205615:29 MTS1: Obie; not sure how much you tested; you did not answer questions earlier: It works fine with /ES for example; so it's likely later in that if statement. The way you troubleshoot is to change defs to plot so you can see the interim values and confirm where the problem is.
205715:32 UpTheCreek: comment them out and add back in one by one
205815:32 admin_SafetyFirst: .
205915:33 admin_SafetyFirst: Anyone here attend Mr. Script last night or other Tuesday nights @ 5:30 ET?
206015:35 UpTheCreek: admin_SafetyFirst, are you a real admin or do you just like to dress up as one for Halloween?
206115:37 Money_K: I work for TDA and just getting feedback on the Mr. Script session taught Tuesday nights. Not sure what the "Admin" means here. Do you have any thoughts on Mr. Script sessions on Tuesday nights?
206215:38 amalia: wtf
206315:42 AlphaInvestor: Admin - is Money_K for real a company employee?
206415:42 admin_SafetyFirst: yes
206515:43 amalia: bkTOS tculs
206615:43 AlphaInvestor: Thanks
206715:43 Vimes: i did not see the session don't see it in the archive - is there something you wanted to share from that sessioin?
206815:43 amalia: Please advise.
206915:44 AlphaInvestor: MoneyK - it was great when we could interact with Mr.Script in the thinkScript Lounge chat. The new setup doesn't allow that. That is a major downfall.
207015:44 admin_SafetyFirst: Actually, just your thoughts on the sessions. Have you ever attended? Find them useful? What would you like to see changed? etc.
207115:45 admin_SafetyFirst: Thanks for the input AlphaInvestor. Anyone else /
207215:46 mthfr_vaxxed: Announcement that your starting in channel would be nice, so similiar to Alpha's request. Archived with other seminars would be nice too.
207315:48 admin_SafetyFirst: So it would be beneficial if we announced here in this chat room before it starts correct?
207415:48 mthfr_vaxxed: yes
207515:48 admin_SafetyFirst: How early before start time would you suggest?
207615:49 mthfr_vaxxed: google calendar defaults to 10 min before meeting. sounds like a good number to me.
207715:49 amalia: At lunchtime and 30 minutes before the event.
207815:50 Vimes: well i can say i didn't even know there was a seminar series on thinkscript - i'm not here everyday but enough that i would have thought i would have seen it before. So i will look for it in teh future
207915:51 amalia: A breakdown of native studies and how the functions work from each example.
208015:52 admin_SafetyFirst: Thanks for the input on that. Will do. Is it a problem to log out of this chat room 5 minutes before the start time then log back in ? The reason I ask is that analytics does not assign attendees as interested parties if they are logged into to this chat room more then 10 minutes before start time.
208115:53 amalia: It’s not a problem but maybe it’s too many steps for the uninitiated.
208215:55 Nube: Tell analytics that 5 minutes is ridiculously tight for anyone not watching a clock.
208315:55 MTS1: That's the main thing MoneyK; I've attended here and that was useful as the lounge allowed to communicate. Also I find the archives hard to negotiate and find Mr Script sessions.
208415:55 MTS1: ^ in the new format
208515:55 mthfr_vaxxed: admin_SafetyFirst : i think thats a problem with your analytics. i'm pretty sure close to everyone in this channel is interested. instead of logged in within X time as your check... you should exclude by if they haven't been active in chat for days if you have that data
208615:56 mthfr_vaxxed: even then...your still missing numbers probably from those who only lurk and dont talk.
208715:58 amalia: Like 90% of this room
208815:58 admin_SafetyFirst: OK, we will post here the time, date and topic of the sessions. On the day of the sessions we will also request a log out of the chat then back in 5 mnutes before the start time. I will work toward a change in the metric process.
208915:58 Nube: I didn't even know they were archived now. Excited to look at some now.
209015:58 MTS1: ^+1; maybe roll out updates Monday nights so that everyone is 'fresh' login on Tue;). (JK; don't do updates on Mo. . )
209115:59 Nube: Good thinking, MTS. Let's get them to move the seminar to Monday
209215:59 Vimes: so where would i find the archive so i can see an example of whta is covered?
209316:00 MTS1: That's the first problem Vimes;)
209416:00 mthfr_vaxxed: an "interested parties" seems like a silly number. just use the number of people who joined. maybe you could gauge how many "interested" didnt make it....but sounds like you would never be correct b/c of unknowns
209516:00 MTS1: Once you find the site you can't filter for Mr Script; but you can find it by presenter now if you know the current presenter.. Let me see if I can find it again;)
209616:01 MTS1: Can't find it by topic ThinkScript either..
209716:01 mthfr_vaxxed: yeah i only knew they started again b/c i think MTS1 mentioned it last week
209816:01 mthfr_vaxxed: and then only caught the last 2 min
209916:01 Vimes: don't know if i'm allowed to post hyper link but this is all i found : https://events.thinkorswim.com/#/webcast/archived
210016:01 admin_SafetyFirst: Thanks everyone for your feedback I will check back in peridically. Next session we will start with a descrription of how to find the archives. On TOS - Education-Webcast-Archived Webcast-Instructor - Ken Rose
210116:02 admin_SafetyFirst: Bye eveyone and thanks again
210216:02 MTS1: Looks like Ken Rose is the new Mr Script - https://education.investools.com/tdameritrade/AllUpcoming.iedu
210316:03 Vimes: ok found one from ken rose on 6/26 will take a look
210416:06 bigworm: so mobius was here and gone huh
210516:06 bigworm: mtfhfr time for a mth question
210616:07 Nube: That's entirely too much mthrfrthr for one sentence
210716:07 bigworm: lol
210816:08 amalia: lol
210916:14 AlphaInvestor: A couple more points. For most who hang out here, the Mr.Script shows were and are way way to rudamentary. We need some good in-depth coding instruction. Examples:
2110a) What makes a good efficient program.
2111b) Deep dive into FOLD
2112c) why's and how's of RECursive variables
2113d) when you need to use CompoundValue with examples
2114
211516:17 amalia: I was gonna suggest we start with WilliamFractals for digestion :)
211616:28 MTS1: Good point Alpha; prly have to suggest that again next time they stop by though; unless BK/TCuls can pass along.
211716:29 mthfr_vaxxed: +1 to AlphaInvestor.
2118
2119bigwork: ha. mthfr doesnt stand for math. but shoot.
212016:29 Nube: agree with Alpha. Something more in depth once a month or every other month or something would be great
212116:33 MTS1: Every other month does not seem enough; separate session maybe every other week or min once/mo seems reasonable. There's lots of more advanced scripting that can be covered. Besides; fold alone could be a few sessions;). How to use subroutines (Script{}), using higher aggs, restrictions / workarounds tick charts. . Referencing scripts in alerts / dynamic watchlists seems to be issue also.
212216:51 mthfr_vaxxed: curious..those using studies and scans... how do you build your scan after your study? duplicate code ? i've seen some people do that, not realizing you can call your custom study in your scan and then just reference which plot you want to use for the scan. ie. _my_study().scan . just gotta know if you update your study you have to go resave your scan to get updates.
2123
2124so maybe a step by step process of going from study...to strategy... to scan ... to advanced orders with thinkscript. hopefully with as little duplication of code as possible.
212517:01 amalia: Good point. I usually plot a scan in a study then use HidePlot() so it doesn’t show up on the chart but I’m also able to reference it in scan. Unfortunately most of my studies use sec agg so cant scan without breaking it down to another script by itself.
212617:04 UpTheCreek: It's likely that the scanner can see def's as well, not real need to plot them. haven't tested that but it works in some other situations.
212717:16 RayK: Spkeaking of Mr Script, here is his latest for your amusement. http://tos.mx/jJPBzp# - it is a Custom Column to detect CAHOLD (close above the high of the low day) and label Bull Flags. It contains instructions for modifying it into a Study that then can be used as a Add Study Filter in the Scan Tab. This is useful when dealing with a large number of symbols. For instance, using the CAHOLD Custom Column code on all of the Russell 3,000 results in a Thinkscript "Subscription limit exceeded" error. Changing the code per the instructions contained in the script into a Study that is suitable to use as a Study in the Scan's Add Study Filter will allow you to scan the Russel 3,000 or any other large watch list. Mr. Script (Ken Rose) is currently going through the Column/Strudy a line st a time. This week (yesterday's session) was session 1 of 2. Next week he will pick up where he left off
212817:17 amalia: Thanks, RayK.
212917:17 RayK: YW
213017:22 cajun: Rayk, nice share and summary.thx
213117:23 mthfr_vaxxed: +1
213217:24 Nube: I've seen several requests for oscillators that will cloud the entire overbought or oversold area, not just the area where it is OB or OS, but have never seen a script for it. so thought I'd make one for when someone eventually asks for it again
2133#
2134# RSI with Clouded Over Bought / Sold
2135# Nube 7.11.18
2136
2137declare lower;
2138
2139input overBought = 70;
2140input overSold = 30;
2141
2142plot
2143OB = overBought;
2144OB. SetDefaultColor(Color.DownTick);
2145plot
2146OS = overSold;
2147OS. SetDefaultColor(Color.UpTick);
2148plot
2149rsi = RSI();
2150rsi. SetDefaultColor(Color.White);
2151
2152def rsiOB = rsi > OB;
2153def rsiOS = rsi < OS;
2154def bn = BarNumber();
2155def c = close;
2156def na = Double.NaN;
2157def currentBar = if !IsNaN(c) and IsNaN(c[-1])
2158 then bn
2159 else currentBar[1];
2160def hCB = HighestAll(currentBar);
2161def rsiOSV = GetValue(rsiOS,(bn-hCB));
2162def rsiOBV = GetValue(rsiOB,(bn-hCB));
2163
2164addcloud(if (rsiOSV == 1, OS, na),0, Color.Green);
2165addcloud(if (rsiOBV == 1, 100, na),OB, Color.Red);
2166
2167# f/ # RSI with Clouded Over Bought / Sold
2168
2169
2170
2171
217217:26 cajun: cool! Nube. thx
217317:26 amalia: Now can you make an upper version
217417:26 Nube: I had to lower the overbought line a little because I overbought tickers aren't super common right now, but that shoudl suffice as what it looks like
217517:28 amalia: An upper study that plots the clouds the whole time RSI is OS/OB
217617:32 mthfr_vaxxed: where was my math question bigworm?
217717:33 Nube:
2178
2179
218017:33 amalia: wtf is that haha
218117:34 mthfr_vaxxed: lol. a first try.
218217:34 Nube: That's clouded below the ticker or above the ticker instead of the OB / OS area
218317:35 amalia: Can't knock Nube. We're in the same tS graduating class.
218417:35 Nube: #
2185# RSI with Clouded Over Bought / Sold for Upper
2186# Nube 7.11.18
2187
2188SetChartType(ChartType.LINE);
2189
2190input overBought = 70;
2191input overSold = 30;
2192
2193def rsi = RSI();
2194def rsiOB = rsi > overBought;
2195def rsiOS = rsi < overSold;
2196def bn = BarNumber();
2197def c = close;
2198def na = Double.NaN;
2199def currentBar = if !IsNaN(c) and IsNaN(c[-1])
2200 then bn
2201 else currentBar[1];
2202def hCB = HighestAll(currentBar);
2203def rsiOSV = GetValue(rsiOS,(bn-hCB));
2204def rsiOBV = GetValue(rsiOB,(bn-hCB));
2205def upBoundary = Double.POSITIVE_INFINITY;
2206def dnBoundary = Double.NEGATIVE_INFINITY;
2207
2208addcloud(if (rsiOSV == 1, c, na),dnBoundary, Color.Green);
2209addcloud(if (rsiOBV == 1, upBoundary, na),c, Color.Red);
2210
2211# f/ # RSI with Clouded Over Bought / Sold for Upper
2212
221317:44 Nube: # http://tos.mx/bCTvOo
221417:44 Nube: Same as the rsi lower except for having inputs
221517:46 amalia: Nube, sloppy quick coding but this is what I was referring to http://tos.mx/vgHgtW
221617:50 Nube: Might have been quick, but it works right.
221717:55 amalia: Gonna work on making it an actual rectangle
221817:56 amalia: Needs a little more IsNaN
221917:40 siva1: How can I display the day of week on charts?
222017:57 MTS1: siva; look for the date and time functions in the reference; one of them is for day of week.
222117:59 MTS1: Type "Date" in the left top filter box in the Reference section: http://tlc.thinkorswim.com/center/reference/thinkScript/
2222------- Thursday, July 12, 2018 -------
222304:55 john2136: hey guys looking script ssr
2224
222505:03 john2136: ssr script
222605:21 Nube: what is ssr
222705:25 john2136: https://www.investopedia.com/terms/s/shortsalerule.asp
222805:25 john2136: read
222905:32 john2136: @NUBE you can create that script ssr?
223005:46 Nube: No, not in ToS.
2231
2232
2233
2234
2235
2236
2237
223813:04 bigworm: nope. Im rolling forward one year at a time 2 years train 1 year test all the way back. I want to know how pairs peform in all markets.
223913:05 bigworm: i also brideged with r for stats testing
224013:05 Joebone87: just use a really big 5 min average...
224113:05 amalia: I messed around with
2242AggregationPeriod.DAY/GetAggregationPeriod() for Length on MA
224313:07 paulw: Thanks DMonke, I'll give your code a try. It's new to me since I only used the Condition editor, but I can likely find YouTube example videos on how to correctly paste code into the thinkScript Editor. I think I'm just doing something not quite right in the final steps of the process.
224413:08 amalia: Studies, EditStudies, Create, Paste code and save it under a name you will recognize.
224513:08 amalia: Those are the steps to plug the code into thinkscript editor.
224613:09 mthfr_vaxxed: hmm. well they say history is not indicitive of future performance. you can gather good stats from it though and make a profit....but Long Term Capital Management went under b/c they were too certain into their stats. so once your done... always be aware that black swans occur which your model doesnt account for....so make sure to have proper money management once your done.... b/c the unlikely can and does happen. Your safe with proper strategy. Saying something is "unlikely" is not safe, even though im still reading articles of people saying that its a sound strategy.
224713:09 amalia: An example of a black swan
224813:09 mthfr_vaxxed: but you probably knew all that... with that said to get more data i like to go lower resolution instead of going too far back
224913:10 Joebone87: 1990's market != QE market
225013:10 bigworm: well lower resolution wont really work better or pairs
225113:10 bigworm: but market shocks will
225213:10 bigworm: a recession is perfect
225313:10 bigworm: to see how it performs
225413:10 Joebone87: QE market != post QE market
225513:11 bigworm: thing is there are so many restrictions placed on it
225613:12 bigworm: if it falls out of cointegration or if there is a market shock like a black swan, most likely i could capture that in a recession to at least compare what would happen
225713:12 cajun: Ray yw
225813:12 bigworm: thats why this has taken me so long
225913:12 paulw: Thanks Amalia for your help, Paul W
226013:13 bigworm: but i hit hiccups because there is not alot to confirm specific things aganist so i have to talk to mobius or ask an instructor
226113:13 amalia: Thanks DMonkey.
226213:17 mthfr_vaxxed: no idea about pairs trading. but i do know about data. right now your doing resampling via train-test splits. look into k fold cross validation for choosing your paramters now going forward (your ratios). your model will tell you which one to pick
226313:18 bigworm: I will do k fold for optimazation
226413:18 bigworm: already looked into it :)
226513:18 bigworm: when i adjust my hyperparamters
226613:18 bigworm: just havent figured out a cost function for that yet
226713:20 bigworm: any thoughts on that for optimaization?
226813:22 bigworm: and it cant be exactly k fold I because the data set cant be broken up random like because data depends on previous so many days
226913:22 bigworm: it will just be rolled forward during testing phase
227013:25 mthfr_vaxxed: stratified k fold ... preserving a percentage of samples for each class
227113:25 bigworm: yeah
227213:25 bigworm: but a cost function?
227313:25 bigworm: with data that you are comparing against you can use RMSE
227413:26 bigworm: but this doesnt have a profit to compare against. just want to have max profit and compare it to each test period
227513:27 mthfr_vaxxed: grab my email.. mytrade
227613:27 bigworm: ok
227713:27 mthfr_vaxxed: message will self destruct in 5...4...
227813:28 mthfr_vaxxed: 321
227913:28 bigworm: target captured
228013:51 max7688: Can I get help with Screeners?
228114:08 mthfr_vaxxed: ask and you shall receive
228214:09 ttl: big, have you looked at using Sharpe or Sortino as cost function, looking at the log of the long term account growth?
228314:10 ttl: and you're correct to use to some history to traing and then use forward data to test, walkforward is better for time series, since the days are not independent
228414:10 bigworm: no i have not looked at that but that is a good idea
228514:12 ttl: fselector library will help find the most useful featues and remove correlated features
228614:13 bigworm: yeah most of my time has been spend trying to understand all the math behind it because I dont want to use functions I dont know what its doing
228714:21 twoshoes: Ray -- much of the morning discussion was about Farmin's strategy comments.
228814:21 EvanBStock: Is there a way to make 30 min bars equal 1 hour that starts at the bottom of the hour? Using column scripts the hourly always goes 9-10-11 etc I want it to go 930-1030-1130 etc. Turning off ext hours still doesnt help. Im thinking if I combine 2 30's there may be a way.
228914:22 twoshoes: You'll need the graphic at 9:12 EDT to reference. see Justpaste.it 5c03v
229014:23 EvanBStock: def high = high [1 or 2];
2291def low = low [1 or 2];
2292def open = open[2];
2293Not sure what to do with close but this is what I have so far
229414:29 MTS1: Evan; you just want an hourly chart that starts at 9:30?
229514:32 AlphaInvestor: Evan - how will you make more money with such a chart?
229615:02 RayK: Twoshoes - thanks
229715:06 aet313: does anyone have any idea how to create a study that autoatically plots the current days open as a horizontal line on the chart ? .... as well as another line at the 50% price diffrence between the current open and the previous days close... ?
229815:09 Vimes: aet, i assume you want it to work intraday?
229915:10 amalia:
2300Plot DailyO = Open(period = "DAY");
2301Def PrevDailyC = Close(period = "DAY")[1];
2302def Fifty_ = Max(DailyO,PrevDailyC)-Min(DailyO,PrevDailyC);
2303plot Fifty = Min(DailyO,PrevDailyC) + (Fifty_*.5);
230415:10 amalia: Coding in chat so you might get some red errors.
230515:11 aet313: yes, just one day (the current day) is great... but if it can be done to plot each day for diffrent days (like on a five day intraday chart for example) that would be incredible.
230615:11 aet313: let me try one sec..
230715:11 Vimes: didn't test it but that looks right to me
230815:12 aet313: five day 1m chart* is what i meant
230915:12 aet313: ok ill give it a shot now
231015:14 aet313: thats perfect!! thanks !
231115:14 amalia: yw
231215:14 aet313: how can i add just one more line on the 75% diffrence , just like you did the 50% one?
231315:15 amalia: Yep.
231415:15 amalia: def Fifty_ should be renamed to range
231515:16 amalia: But essentially all you're doing if you're gonna change the wording is multiply by .75 instead of .5
231615:17 Vimes: gap trade?
231715:17 aet313: yep :)
231815:17 amalia: Which symbol?
231915:18 aet313: im actually trying to make the study to help me better understand the probabilities of gaps filling based on certain criteria , and making markers on the 50% ,75%, 100% levels of the fill
232015:19 aet313: so , alot of symbols... not really a specific trade... just research i guess
232115:20 amalia: Just shoot me one or two
232215:21 harndog: geez... AI, all the magic happens in relation to the London close... Yeah, Baby...
232315:22 horserider: Hi Is there a MVWAP in ToS ? Anyone have experience using it?
232415:23 MTS1: Horse; explain?
232515:23 FrankB3: Amalia: MU gaped down on 6/25, daily chart
232615:23 horserider: Moving Volume Weighted Average
232715:24 amalia: VWAP is moving.
232815:24 MTS1: Not sure what that means; how is it different from VWAP?
232915:24 harndog: Sexier
233015:24 MTS1: Sexier name or functionality;)
233115:24 amalia: lol
233215:24 AlphaInvestor: Same contents, fancy new box
233315:24 aet313: amalia is there a way to send a private message?
233415:24 harndog: Goes to 11â€
233515:25 horserider: It is a moving average of the daily VWAP
233615:25 MTS1: aet; sure, contacts on MyTrade if available. .
233715:25 amalia: aet313, contact info for some of us is on MyTrade.
233815:25 amalia: horserider, so just get VWAP() and put in the Average() function
233915:25 amalia: Average(VWAP())
234015:25 amalia: There's your MVWAP.
234115:26 MTS1: horse; VWAP is a function in TOS, so I guess combine that with the avg function.
234215:26 MTS1: Amalia is too quick;)
234315:26 MTS1: Except you may want to specify daily agg if not running on daily.
234415:29 horserider: Thanks but I think you people are way to advanced in Thinkscript for me
234515:30 amalia: ha
234615:30 amalia: That's what I think of the other coders in here who actually code
234715:30 MTS1: horse; https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Fundamentals/vwap.html
234815:30 MTS1: Combie that with https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Tech-Analysis/Average.html
234915:31 Vimes: aet you will find alot of help here if you just fully explain what you are looking for - somebody may even have already coded it or if you want to try yourself.. You could count gap ups with something like def gaUP = open>close[1]; and then count fills with def gupfill50 = if gapUP and low<=0.5*(open-close[1] then 1 else 0; you can then sum those to get a ratio or probability of fill
235015:31 MTS1: There are syntax examples; specify daily for the VWAP as listed in the options, and put that inside the average function.
235115:31 MTS1: If you get stuck we're here to help
235215:32 amalia: Only if you tried.
235315:33 horserider: Ok thanks for the references . Let me see what mess I can make of it
235415:33 MTS1: yw
235515:36 MTS1: Horse; you also asked about experience; since this is the first time I've seen a MVWAP question and it it not built-in assume we don't have experience with it and that it is not used much. I don't see the benefit of averaging out the daily VWAP, wny not just use a monthly or weekly VWAP? Averaging just adds more lag. .
235615:41 horserider: This is what the MVWAP is doing.
235715:41 horserider: 10-period MVWAP, they would simply wait for the first 10 periods to elapse, then average the first 10 VWAP calculations. This would provide the trader with the MVWAP that starts being plotted at period 10. To continue getting the MVWAP calculation, average the most recent 10 VWAP figures, include a new a VWAP from the most recent period and drop the VWAP from 11 periods earlier.
235815:42 horserider: Is that the same as the weekly or monthly you mentioned?
235915:43 AlphaInvestor: no it would not be the same
236015:44 AlphaInvestor: average(reference VWAP(),10) would be what you are after
236115:44 horserider: Thanks Alphainvestor
236215:44 Vimes: what would a trade setup be with that? why not use the actual VWAP as support or resistance?
236315:44 AlphaInvestor: Now, read the manual and find out why
236415:45 AlphaInvestor: Note, the only reason that I did post that is because VWAP is confusing. There is both a study, and a data type that are VWAP
236515:45 AlphaInvestor: data ITEM not data type
236615:48 MTS1: Horse; If you want it off the daily VWAP as you mentioned and you're not on a daily chart you probably still want to modify the VWAP portion to specify Daily period as shown in the example.
236715:49 horserider: Vimes it is to give VWAP for swing trading
236815:49 Vimes: so like trade a mvwap cross? thanks
236915:55 AlphaInvestor: I see no real use for it, but to each his/her own
237015:56 horserider: you may be correct. Just seeing if it can be helpful I do not know at this point in time
237115:57 prominantthompson: Hi All. I don't know if anyone could assist me with a backtesting strategy I want to implement. I am very new to thinkscript and trying to understand it. I want a backtesting strategy to buy when price CROSSES above VWAP and sell when it CROSSES below VWAP.
237215:59 Vimes: it might be a slower trigger and in that way keep you out of some false trades - but then again you might also miss alot of good trades - only way is to backtest and see - but i would guess a simple ma cross would give you comparable results for swing trading
237316:02 MTS1: Prominant; that's a good example to get started with thinkscript. Have you read the how-tos here? Link to the strategy section; but make sure you read all chapters as you're new to TOS: https://tlc.thinkorswim.com/center/howToTos/tutorials/Basic/Chapter-7---Creating-Strategies.html
237416:03 Vimes: def buy = close crosses above vwap();
237516:03 MTS1: You can replace def/plot avg with the VWAP function linked earlier above.
237616:04 Vimes: but i will tell you - you want to use a smooth moving avg - like a hull or exponential for your trigger
237716:06 MTS1: What do you mean Vimes; VWAP is smooth? Great on Trend days; it would have gotten you in a few times over GLOBEX, and stayed in all day;). But Prominant; realize that you'll probably won't want to trade off one indicator alone. .
237816:07 prominantthompson: @MTS1 @Vimes - Thank you, appreciated.
237916:07 Vimes: i guess i mean when he says price crosses vwap - price is noisy therefore you need some expression of price
238016:08 MTS1: YW; please note that when you copy user names it defaults to bold which is not appreciated in this lounge; just change it back before posting.
238116:09 prominantthompson: Sorry my bad.
238216:09 prominantthompson: I plan to use it with other indicators to get entries and exits.
238316:09 MTS1: yet he did it again;)
238416:09 Vimes: for example there are alot of traders that are going to fade vwap on a downtrend - so intrabar the price might cross - and give you a false entry
238516:10 MTS1: please exit and re-enter if you can't turn off bold. Bold / colors are only used for educational highlighting in this room. Exit-reenter will fix that.
238616:11 DMonkey: there is a built in VWAP stratagey....
238716:11 prominantthompson: Oh sorry. Are u seeing the green color around my name.
238816:11 Vimes: no only you see that
238916:12 prominantthompson: are u seeing my font as only bold?
239016:12 MTS1: still yes; you need to turn it off or exit and re-enter
239116:12 prominantthompson: exit and re-entering now
239216:14 prominantthompson: Font test?
239316:14 MTS1: purfect
239416:15 prominantthompson: Sorry again, the background made it hard to pickup on it
239516:15 Vimes: /CL today is a great example of that setup around 10:00 you are in a donwtrend you get a retest back ot vwap - there are going to be alot of folks shorting at the vwap
239616:15 Vimes: but the price technically crossed vwap
239716:15 prominantthompson: Give me a sec, checking ticker
239816:18 prominantthompson: Im in EST timezone, so it would have been 9:00 but yes, false breakout
239916:18 MTS1: Yep; he would have gotten back in when it crossed back down. Also I did not like the SdDev bands and used to turn them off; but surprised how often price is contained / tracking the 2StD bands, or if exceeding those the 3 StDev bands. I agree with Vimes though; would probably not use crossing as a trigger, more of a filter whether atove / below VWAP and either fade the move or consider it a target.
240016:18 MTS1: (Intraday)
240116:19 Vimes: mt51 - good point he did say crosse in both directinos by bad
240216:19 prominantthompson: Yes both directions
240316:19 MTS1: Maybe limit crosses to crosses in the direction of the VWAP trend might help. But that's what strategy backtesting is for;)
240416:19 prominantthompson: Coupled with good stop losses, I would have surged the fake breakout on /CL
240516:20 prominantthompson: survived not surged
240616:20 Vimes: code it up and see - and that is the start of a trading plan - you would want to avoid signals in a sideways market for example
240716:20 MTS1: In your example the VWAP itself would have been the stop
240816:20 prominantthompson: Exactly, it adhered strictly
240916:21 prominantthompson: DMonkey - Did u say there was a built in VWAP Strat
241016:21 prominantthompson: ?
241116:21 amalia: Look under Strategies
241216:21 MTS1: Go to the strategies tab when adding a study to a chart and you'll see built-in or custom ones there.
241316:21 prominantthompson: I saw VMWA
241416:22 prominantthompson: and I dont think its the same
241516:23 prominantthompson: VWAP is for intraday and VMWA is for daily i think
241616:23 MTS1: click on the help icon for more info; it combines VWAP with MA as Vimes I believe was suggesting.
241716:23 MTS1: also link from there for more help. Most built-in studies or functions will have this.
241816:23 prominantthompson: OK. thanks
241916:24 MTS1: If you click the scroll icon you can see the script which is a good example; you can copy the script to a custom one and modify from there if you want to use price instead.
242016:25 prominantthompson: instead of the moving aver u mean?
242116:25 MTS1: yup
242216:25 prominantthompson: thanks M
242316:25 MTS1: yw
242416:25 prominantthompson: yw?
242516:26 prominantthompson: ok. ur welcome
242616:26 prominantthompson: sorry.
242716:26 MTS1: Have fun; love TOS and TS and this lounge has been very beneficial to help me get going. .
242816:26 prominantthompson: Its after calling cust care I found out abt this chatroom
242916:26 prominantthompson: Very first time being here.
243016:27 mike: hi im still learning how to use think or swim, where can i add a code in at to be able to see pre market scaning.
243116:27 Vimes: what about the pre-market do you want to scan?
243216:27 UpTheCreek: yes, customer support loves us cuz we do their job for them
243316:28 prominantthompson: Lol lol
243416:28 prominantthompson: But so far, I am impressed fast responses and support
243516:28 prominantthompson: with the
243616:29 ckodad: is a person able to create a strategy that only trades certain times of the day on TOS. For instance, if i want to back test Crude Oil with my strategy and see how it does from 8am to Noon, can I code in that time frame on my strategy?
243716:29 Vimes: yes
243816:30 ckodad: Can you tell me how I can do it or where i should go to do it?
243916:30 Vimes: well you could try something like: input opentime = 0700;
2440input closetime = 1600;
2441def active = secondsFromTime(opentime)>0 and secondstillTime(closetime)>0;
244216:31 Vimes: and then add active to you buy condition
244316:32 ckodad: I will give that a shot. Thanks!
244416:32 Vimes: check the learning center and read it start to finish
244516:36 prominantthompson: Can anyone suggest any good strategies worth looking at or to backtest?
244616:38 amalia: I would but I’ll hold my tongue :)
244716:39 Vimes: buy and hold?
244816:41 Vimes: tounge in cheek somewhat - but if your goal is to learn thinkscript and start to formulate trade ideas - then just pick one setup start coding it and see how it performs - make obserrvatinos why and when it doesn't perform and try to add additional logic
244916:41 Vimes: if you are asking to share a guarantteed profitable trade strategy - i wouldn't be in here
245016:43 prominantthompson: No, not a one fix strategy. Just curious as to what other fellow traders are using and working for them. Yes, that is my intention to test, retest and add to my selected strats
245116:44 UpTheCreek: that's mainly a question for the trading oriented chats
245216:44 UpTheCreek: how to write them is the focus of this one
245316:46 prominantthompson: Oh. Ok.
245416:51 Vimes: prominant, there are likely more seutps than traders and each person has to find a style that works for their risk appetite and timeframe. I'd be suprised if anyone in here trades the same way. The point is to start develop your own POV, nurture it, test, etc. and use thinkscript to implement your ideas, backtest etc.
245516:53 prominantthompson: Understood. Thanks V.
245616:53 Nube: best strategy to back test is buy
245717:00 UpTheCreek: my goodness this room has gotten chatty recently, can't even put half a day in the buffer now. have a good night all.
245817:04 amalia: Laters
245917:15 cajun: gn, Up
246017:33 Nube: I just posted a study like 6 or buffers ago, Jeesh.
246118:10 mike: top movers or decliners in premarkte
246218:20 Vimes: there is a built in scan called pre-market movers - you might start there
246318:27 aet313: hey vimes , i need your help with the study i was setting up earlier, the gap fill percentage price levels.... on 50% 75% and 100% fills. the price levels are plotted correctly on gap up days but not gap down days... im assuming i need to make an IF statement to determine which direction the gap is and then set the correct calculations ....... can you help ?
246418:27 aet313: this is the code that plots correctly on gap ups ....
246518:28 aet313:
2466Plot DailyO = Open(period = "DAY");
2467Def PrevDailyC = Close(period = "DAY")[1];
2468
2469def Fifty_ = Max(DailyO,PrevDailyC)-Min(DailyO,PrevDailyC);
2470plot Fifty = Min(DailyO,PrevDailyC) + (Fifty_*.5);
2471
2472def seventyfive_ = Max(DailyO,PrevDailyC)-Min(DailyO,PrevDailyC);
2473plot seventyfive = Min(DailyO,PrevDailyC) + (seventyfive_*.25);
2474
2475def onehundred_ = Max(DailyO,PrevDailyC)-Min(DailyO,PrevDailyC);
2476plot Fill = Min(DailyO,PrevDailyC) + (onehundred_*0);
2477
2478
2479
248018:28 aet313: no idea how to code it to give an if statment for the gap downs to have diffrent calculations. (which would just be changing the .25 to .75 , and the 0 to 1 , im assuming)
248118:31 amalia: No you’re on the right track
248218:32 amalia: If DailyO>PrevDailyC then...
248318:32 amalia: On mobile now so can’t help you much
248418:32 aet313: ok let me see if i can figure out the rest considering that line to start with ..
248518:33 aet313: thank u btw
248618:38 jake75604: trying to create a scan that shows stocks which crosses lower bands of the average daily range. I see that most of the time price hits the lower bands it goes up.
248718:38 jake75604: http://tos.mx/V0SvNT#
248818:39 jake75604: i provided the chart link
248918:45 Vimes: hi aet313, sorry stepped away i can take a look and see if i can provide any additional help
249018:47 amalia: Close crosses above Average(Low), jake.
249118:55 aet313: i did it , thanks to amelias help .. i think. heres what i came up with
249218:55 aet313:
2493
2494 plot DailyO = open(period = "DAY");
2495 def PrevDailyC = close(period = "DAY")[1];
2496
2497
2498 def Fifty_ = Max(DailyO, PrevDailyC) - Min(DailyO, PrevDailyC);
2499 plot Fifty = Min(DailyO, PrevDailyC) + (Fifty_ * .5);
2500
2501
2502 def seventyfive_ = Max(DailyO, PrevDailyC) - Min(DailyO, PrevDailyC);
2503 plot seventyfive = Min(DailyO, PrevDailyC) +
2504If DailyO>PrevDailyC then (seventyfive_ * .25) else (seventyfive_ * .75);
2505
2506
2507 def onehundred_ = Max(DailyO, PrevDailyC) - Min(DailyO, PrevDailyC);
2508 plot Fill = Min(DailyO, PrevDailyC) +
2509If DailyO>PrevDailyC then (onehundred_ * 0) else (onehundred_ * 1);
2510
251118:56 aet313: that should do it .. no ?
251219:00 amalia: Try it
251319:08 Vimes: if you are just wanting teh stats try somethign like this as suggested earlier:
251419:08 Vimes:
2515#vimes - gap status - chat discussion
2516declare hide_on_intraday;
2517def GapUP = if open > close[1] then 1 else 0;
2518def GapDN = if open < close[1] then 1 else 0;
2519def cntGapUpDays = Totalsum(GapUP);
2520def cntGapDnDays = Totalsum(GapDn);
2521def GapUPFill_50 = if GapUP and low <= open-(open-close[1])*0.5 then 1 else 0;
2522def cntGapUPFill_50 = TotalSum(GapUPFill_50);
2523def GapDNFill_50 = if GapDN and high >= open+(close[1]-open)*0.5 then 1 else 0;
2524def cntGapDNFill_50 = Totalsum(GapDNFill_50);
2525addlabel(yes,"GapUPFills:" + astext(cntGapUPFill_50/cntGapUPDays*100)+"%", color = Color.LIGHT_ORANGE);
2526addlabel(yes,"GapDNFills:" + astext(cntGapDNFill_50/cntGapDnDays*100)+"%", color = Color.LIGHT_ORANGE);
2527
252819:09 Vimes: but to refine that you would need to define maybe a qualifier to which gaps should be evaulated - so for example - i want to trade gaps of the /ym greater than 10
252919:15 Vimes: or maybe you want to know how many gaps fill in teh first 15 mins etc.
253019:59 Nube: In case someone wants that study last noght for something other than RSI,
253119:59 Nube: #
2532# Multi Indicator with Clouded OB / OS
2533# v02 7.12.18 previous version RSI only
2534
2535declare lower;
2536
2537input Oscillator = {MFI, default RSI, RVI};#hint Oscillator: Choose your oscillator
2538input length = 14;
2539input overBought = 70;
2540input overSold = 30;
2541
2542def osc;
2543switch (Oscillator)
2544{
2545 case MFI:
2546Osc = MoneyFlowIndex("Length" = length);
2547 Case RSI:
2548Osc = RSI("Length" = length);
2549 Case RVI:
2550Osc = RelativeVolatilityIndex("average length" = length);
2551
2552}
2553
2554def indicator = osc;
2555def oscOB = osc > overBought;
2556def oscOS = osc < overSold;
2557def bn = BarNumber();
2558def c = close;
2559def na = Double.NaN;
2560def currentBar = if !IsNaN(c) and IsNaN(c[-1])
2561 then bn
2562 else currentBar[1];
2563def hCB = HighestAll(currentBar);
2564def oscOSV = GetValue(oscOS,(bn-hCB));
2565def oscOBV = GetValue(oscOB,(bn-hCB));
2566
2567Script onChart {
2568 input indicator = .5;
2569 def onChart = if !IsNaN(close)
2570 then indicator
2571 else Double.NaN;
2572 plot
2573 line = onChart;
2574}
2575
2576plot
2577OB = onChart(overBought);
2578OB. SetDefaultColor(Color.DownTick);
2579
2580plot
2581OS = onChart(overSold);
2582OS. SetDefaultColor(Color.UpTick);
2583
2584plot
2585rsi = onChart(indicator);
2586rsi. SetDefaultColor(Color.White);
2587
2588addcloud(if (oscOSV == 1, OS, na),0, Color.Green);
2589addcloud(if (oscOBV == 1, 100, na),OB, Color.Red);
2590#
2591------- Friday, July 13, 2018 -------
259206:34 Nube: I didn't think through well enough the impacts of turnign that cloud on and off. Replacing the cloud statements with these will prevent the script from moving the indicator up or down when the cloud activates
259306:34 Nube: #
2594plot
2595indicator = onChart(osc);
2596indicator. SetDefaultColor(Color.White);
2597# http://tos.mx/Br6SHK#
2598addcloud(if (oscOSV == 1,OS,na),LowestAll(osc),Color.Green);
2599addcloud(if (oscOBV == 1,HighestAll(osc),na),OB,Color.Red);
260006:35 Nube:
2601
2602
260306:35 Nube: That snippet makes the highest and lowest of the indicator the top and bottom of the study instead of 100 and 0 respectively
260406:46 70cuda: Folks, hopefully an easy one for the experts. I"ve done a simple script that plots vertical red or green vertical clouds on a chart...works fine...but I can't figure out how to match the background color automatically when the condition is not true. I use black background in my charts so I've forced it black but I want it to be able to plot no color...or automatically match the background color without forcing it. here's a snippet of the area i'm referring to: def cloudenabledn = if s1state==s1state.twoup and !IsNaN(close) and s1L3==0 then double.positive_infinity else double.negative_infinity;
2605addcloud (cloudenableup, -cloudenableup,color.Dark_green,color.black,no);
260606:47 70cuda: I've tried to leave the color.black blank and I get an error and I've tried double.NaN and it won't work either. I can't find any way to getBackGroundColor so I can match it either
260707:08 70cuda: The think that does not work with the black color even though it matches the background is that when i hover on a chart, everything washes out due to the black color on..it highlights the script in other words when my mouse hits the price area of a chart
260807:13 Nube: 70, 2 ideas. first, you can turn off highlight on hover so your studies won't do that. secondly, have you considered a condition that turns on the cloud only when the condition is true?
260907:15 Nube: AddCloud(if condition then double.positive_infinity else double.nan, double.negative_infinity, color.green);
261007:17 Nube: Or perhaps I'm not following, you just want your background or something else?
261107:18 70cuda: nube, I have done the don't highlight thing but it is a bandaid...it works but me no likey. The idea is interesting, let me see if I can mess with that. What I want is to plot the vertical cloud on a condition and do nothing outside of that. I hacked the script together from the basic definition of it in addcloud. Let me try your idea...
261207:22 Paris: Nube - Noted the changes with your multi indicator with clouded OB/OS
261307:31 70cuda: Nube, that worked...I knew it would be something stupid simple...lol...ty
261407:32 Paris: 70cuda - Good that it worked, I found the following very simple example in case you'd like anotjher example
2615
2616
2617# Market Hours Cloud
2618# Farmin
2619# 8.20.2017
2620
2621# Adds a cloud at defined market times as per user inputs
2622
2623input start = 0930;
2624input end = 1600;
2625
2626def Open = secondsFromTime(start) >= 0 && secondsFromTime(end) < 0;
2627
2628addcloud(if open then double.NEGATIVE_INFINITY else double.NaN,if Open then double.POSITIVE_INFINITY else double.NaN, color2 = createColor(204,153,155));
262907:33 Paris: Courtesy of Farmin, from the archives
263007:39 Nube: Paris, thanks. That change is a pretty important one. It would move the line so much it would have been a terrible user experience. I should have spent t a little more time with it before releasing it but got a little too excited about the concept working.
263107:40 Paris: I noted that in the commentary, thanks for the follow up.
263207:43 Paris: As an aside, I noted that after the chat session was closed yesterday GroWex attempted to post something, Perhaps he might try again later today.
263307:48 Nube: That would be nice, don't see him much at all
263407:52 Vimes: Nube, not sure why but for me the clouding is not working on your script, if i replace it with something like: addcloud(if(osc<=os,os,na),osc,Color.Green);
2635addcloud(if(osc>=ob,osc,na),OB,Color.Red) ; iget it to fill in the ob/os clouds
263607:53 Paris: I hear you Nube - he sure had some real interesting studies.
263708:05 Nube: Those won't work because they're wrong. Use the ones I did, not the ones written by whoever wrote those.
263808:05 Vimes: well i wrote those, are we trying to fill in the boundary of the osc and the os signal or something diffeernt
263908:16 Nube: I don't know what you're trying to do.
264008:18 Nube: I know what I was trying to do. For that you can get it at the share link in the snippet posted above.
264108:18 Vimes: Nube sorry to cause confusion - i was just trying to load your script and i'm not getting the cloud to activate on a cross of the osc - so i was trying to help. its' likely my error
264208:19 Nube: So you want it to cloud only at a cross of the line?
264308:20 Vimes: no i couldn't get the cloud to activate as you had in your screen shot - when should the cloud be active for your script?
264408:21 Nube: cross only exists at 1 bar. By the snippet posted I'm guessing you want to it cloud when the indicator is equal not the lines, not just above or belowm
264508:22 Farmin: To finalize yesterday's discussion, last night I added both horizontal and vertical lines to mark where ToS recognizes the lines crossing in the strategy. My intrepretation is the event is detected by code on the bar following the vertical white line. The order is placed at the next bar, per the description of the AddOrder command - Adds an order of specified side and position effect for the next bar when the condition is true. For those who want to play the home game - http://tos.mx/teKHAE
2646
264708:24 Nube: Vimes, oscOV and osvOBV go get the current condition and bring it back to the previous bars. Those must be used in the addcloud statement. Changes to conditions need to be made elsewhere in the script. Such as oscOB is greater than or equal to instead of just greater than
264808:24 Vimes: Nube, i sped up my chart and changed the rsi to 2 just to see the behavior of your script - i am getting it now - again sorry for confusion - just trying to understand your script
264908:25 Vimes: thanks - i've not got a lot of sleep so a little slow this morning
265008:31 Nube: No problem, Vimes. From what I can tell you were close to what was needed, you just didn't realize that the variable in the cloud statements were bringing back the current condition
265108:38 Nube: That was a lot of work, Farmin. Thank you.
265208:57 Farmin: yw, but automation is wonderful sometimes
265309:03 mthfr_vaxxed: automation keeps me employed
265409:16 Nube: I wish automation would keep me unemployed
265509:38 Matt10520: Hey guys, i have a quick question, im new to think or swim and i just wanted to know how do you add different watchnlists to the left hand side of the screen?
265609:39 harndog: Matt: Live SUpport - Free Platform tour
265709:39 harndog: Ask for free platform tour
265809:40 harndog: If your coming from another platform, discuss the setups you like
265909:44 baron_12tg: any possible way to put this in a scan on a weekly mtf to scan on a daily chart input price = close;
2660input length = 7;
2661
2662input MTF = yes;
2663input timeframe = AggregationPeriod.week;
2664def p = if MTF then timeframe else GetAggregationPeriod();
2665def c = close(period = p);
2666
2667def state = {default grn,red};
2668def current_positions;
2669def entry_filter; # criteria for entry
2670def exit_filter; # criteria for exit
2671
2672if (BarNumber() == 0) {
2673 current_positions = 0;
2674}
2675else if (entry_filter and current_positions[1] < 1)
2676{
2677 current_positions = current_positions[1] + 1;
2678# current_positions = 1;
2679}
2680else if (exit_filter and current_positions[1] > 0)
2681{
2682 current_positions = current_positions[1] - 1;
2683# current_positions = 0;
2684}
2685else
2686{
2687 current_positions = current_positions[1]; # then use prior bar's value!
2688}
2689def sdl1 = 2 * TEMA(c , length / 2) - TEMA(c , length);
2690plot SDL = sdl1;
2691
2692exit_filter = current_positions[1] and SDL[0] < SDL[1];
2693entry_filter = (current_positions[1] == 0) and SDL[0] > SDL[1];
2694
2695def color;
2696switch (state[1]) {
2697case grn:
2698 if(SDL>SDL[1]){
2699 color=1;
2700 state=state.grn;
2701 }else{
2702 color=0;
2703 state=state.red;
2704 }
2705case red:
2706 if(SDL<SDL[1]){
2707 color=0;
2708 state=state.red;
2709 }else{
2710 color=1;
2711 state=state.grn;
2712 }
2713}
2714
2715
2716
2717#TSI.SetDefaultColor(GetColor(1));
2718SDL.assignValueColor(if color==1 then Color.BLUE else color.red);
2719assignpricecolor(if color==1 then color.blue else color.red );
2720
2721
2722
2723
2724def bound1= highestall(high)*2;
2725def bound2= lowestall(low)/2;
2726def cond1 =(sdl>sdl[1] ) ;
2727def cond2= (sdl<sdl[1] ) ;
2728
2729#addcloud(if cond1 then bound1 else double.nan, if cond1 then bound2 else double.nan, color.dark_green, color.dark_green);
2730
2731
2732
2733#AddVerticalLine(cond2 and cond2[1]==0, close, Color.DARK_ORANGE, Curve.FIRM);
2734
2735#AddVerticalLine(cond1 and cond1[1]==0, close, Color.DARK_green, Curve.FIRM);
2736
2737
2738def highestBarNumber = highestAll(if !isNaN(close) then barNumber() else Double.NaN);
2739
2740def BubbleBar = BarNumber() == highestBarNumber + 4;
2741
2742#AddChartBubble(BubbleBar, sdl[4], "sdl", sdl.takeValueColor(), yes);
2743input pricesdi = close;
2744input lengthsdi = 7;
2745input priceType = FundamentalType.CLOSE;
2746
2747
2748
2749
2750
275109:47 MTS1: Baron; no higher aggs in scripts used in scans; you'd have to split them out and have separate filter lines.
275209:47 baron_12tg: can i get help on that just frustrated attepting it myself
275309:48 MTS1: What is the script; where are the notes / header?
275409:48 MTS1: And what are you trying to scan for?
275509:49 baron_12tg: its a moving average need it red to blue and blue to red similiar to a slope moving average
275609:49 MTS1: what MA? you can simply scan for the MA's directly?
275709:50 MTS1: Where are the script notes . Header? I'm not following yet so not easy to help.
275809:50 baron_12tg: based on a tema moving average works well on a weekly setting daily chart
275909:51 baron_12tg: when the blue ma turns red we go short vice versa
276009:52 MTS1: Where are the script notes / Header?
276109:55 baron_12tg: i recieved it years ago from a friend thats all i have if its that big of deal then pass
276209:56 MTS1: Not sure why you would not scan this with weekly agg in the scanner (not using script higher agg); the chart agg has nothing to do with the scan? Maybe use the built-in TEMA script as that seems simpler; get back to the root of what you;re trying to filter for.
276309:59 MTS1: Did you try using the weekly scan agg?
276410:03 ddemann: Hello all. I am looking for a good intraday indicator to assess the volume of a intraday breakout. It’s a hard to know if the volume at some point in the day, if it continues, will end up in a strong end of day volume. I need some way of seeing the the volume at that point of the day is strong compared to recent volume or the a moving average.
276510:15 Farmin: there's too much ambiguity in that request, you probably want something like volume > factor * average(volume, length )
2766you need to figure out the factor and length you care about
276710:18 ddemann: Sorry. I know I didn’t explain well enough. I apologize. I want to make sure that when I take a breakout trade that the cumulative volume so far at that point in the day will likely result in higher than “normal†end of day volume. Perhaps higher than the 50day MA of volume.
276810:18 ddemann: The 50d MA of volume
276910:22 Paris: ddemann - here is a volume above average study, currently set at length=50.
2770
2771# Volume Above Avg
2772# BLT
2773# 6.29.2017
2774
2775# Plots the volume that is above an Avg length, color white
2776# Otherwise it does not plot
2777
2778declare lower;
2779
2780input length = 50;
2781
2782plot Data = if volume > Average(volume, length) then volume else Double.NaN;
2783Data.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
2784Data.SetDefaultColor(Color.WHITE);
278510:24 AlphaInvestor: to complete Ddemann's thought we would need to figure out the Number of Bars so far today, and scale up to the number of bars in RTH at his aggregation, and ratio that volume up to expected volume by days end
278610:24 Paris: And in case you're interested here's another study I saved 2 years ago from zztop
2787
2788
2789# Volume Avg Alert
2790# zztop
2791# 8.7.2016
2792
2793input length = 50;
2794def avgVolume = Average(volume, length);
2795
2796alert(volume > avgVolume * 1.5, "Volume > Average", Alert.BAR, sound.ding);
279710:26 Farmin: say, all that logic looks pretty familiar
279810:30 ddemann: Thanks!!!!
279910:30 Farmin: if you study volume, you will notice that sometimes to often an equity's MOC volume dwarfs intra day.
280010:51 MTS1: DD; you may have noticed those are not cumulative volumes; that's based on MA of recent bars.
280110:51 MTS1: Which is a more practical way to confirm volume spikes; but something to realize when looking at open / close for example.
280210:52 nextrade: Farmin and Paris thanks for your post-they both work well together
280310:57 Farmin: to me a volume spike is that excessive vol relative to the most recent bars, YMMV
280411:06 ddemann: I also think that works well. I am trying to be less subjective so I can backtest my breakout success/ failure rate as it relates to volume at the time of the breakout.
280511:30 Mobius: Good Morning - Don't have time to stay but wanted to post a volume study that plots a comparison of yesterdays total volume at the same bar and compares an average volume to the same time yesterday.
2806
2807# Volume Comparison
2808# Plots Yesterdays Total Volume At Same Bar and Average Volume At Same Bar
2809# Mobius
2810# V02.06.2018 Posted to Chat Room 07.13.2018
2811
2812declare on_volume;
2813
2814input avgLength = 10;
2815
2816def v = volume;
2817def vD = volume(period = AggregationPeriod.Day);
2818def c = close;
2819def bn = BarNumber(); #was x
2820def nan = double.nan;
2821
2822def RTHbar1 = if GetTime() crosses above RegularTradingStart(GetYYYYMMDD())
2823 then bn
2824 else RTHbar1[1];
2825
2826def RTH = GetTime() >= RegularTradingStart(GetYYYYMMDD()) and
2827 GetTime() <= RegularTradingEnd(GetYYYYMMDD());
2828
2829def PrevRTHbar1 = if RTHbar1 != RTHbar1[1]
2830 then RTHbar1[1]
2831 else PrevRTHbar1[1];
2832
2833def indexBar = RTHbar1 - PrevRTHbar1;
2834plot prevVol = if IsNaN(c)
2835 then nan
2836 else GetValue(v, indexBar);
2837prevVol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
2838prevVol.SetDefaultColor(CreateColor(75, 75, 75));
2839prevVol.SetLineWeight(1);
2840
2841plot Vol = v;
2842Vol.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
2843Vol.AssignValueColor(if close > open then CreateColor(5, 250, 12) else CreateColor(250, 5, 25));
2844
2845AssignPriceColor(if close > open then CreateColor(5, 250, 12) else CreateColor(250, 5, 25));
2846def avgPrev = Average(prevVol, avgLength);
2847def avgCurr = Average(Vol, avgLength);
2848def prevDailyVol = if RTH and !RTH[1]
2849 then getValue(v, indexBar)
2850 else if RTH
2851 then compoundValue(1, prevDailyVol[1] + GetValue(v, indexBar), GetValue(v, indexBar))
2852 else prevDailyVol[1];
2853AddLabel(1, "Prev D Vol = " + prevDailyVol + " Prev Vol avg(" + avgLength + ") = "
2854 + Round(avgPrev, 0), prevVol.TakeValueColor());
2855AddLabel(1, "Current D Vol = " + vD +
2856 " Curr Vol avg(" + avgLength + ") = " + Round(avgCurr, 0),
2857 if vD > prevDailyVol then color.green else color.red);
2858# End Code Volume Comparison
2859
2860
286111:31 AlphaInvestor: Thanks Mobius - enjoy your time in Maine (I think you are there now)
286211:34 Mobius: Hey Alpha yeah it's my yearly forced retreat to look at the scenery and my positions and re-evaluate my lists. A real drag on the one but needed.
286312:03 AlphaInvestor: once a year he creates a list of stocks - then for the next year he only trades stocks from that list
286412:04 bigworm: i wonder if anyone will ever to be able to contribute something to that guy that he hasnt already seen
286512:06 Joebone87: I used to think my bad ideas were unique... but after hanging around this room for a while now Im starting to realise its pretty difficult to come up with something someone hasnt come up with ... and to think most of the stuff in here is just barely not retail
286612:10 dynce1: does anyone know how to change the font color in the watchlist box. for example my value is 49.5 how do i make it change red when its below 0 and green when its above 0??
286712:10 bigworm: hey alpha i downloaded way too much historical ratio data for the pairs im trading but im not really sure which ones should be looked at to determine stability of a company
286812:12 Vimes: dynce, you could try something like this
2869# EMA 8/21 Cross Custom Watchlist column
2870# SimplerTrading
2871addLabel(yes, "8/21",if ExpAverage(close,8) > ExpAverage(close,21) then color.blue else color.black);
2872assignBackgroundColor(if ExpAverage(close,8) > ExpAverage(close,21) then color.light_green else color.light_red);
287312:12 Vimes: it would change the label color and in addition the background color on your watchlist
287412:25 jmv103: Hey ! About the RTH on the mobious script, how could I make a addorder that is triggered in RTH? I already have the condition to buy, but need to restrict it to RTH
287512:27 Vimes: You could do something like:
2876def RTH = if SecondsFromTime(0930) >= 0 and
2877 SecondsFromTime(1600) >= 0
2878 then 1
2879 else 0;
2880and then RTH to your buy condition
288112:28 Vimes: def buy = blah and rth;
2882for example
288312:38 70cuda: Paris, saw your response to my question earlier today...ty
288412:39 70cuda: I had figured that out with Nube's suggestion but your item also nailed it.
288512:40 jmv103: Vimes! Thanks!
288612:41 70cuda: have a great we folks
288712:42 FrankB3: On that tema indicator, that was posted by 10:44 baron_12tg: Can anyone explain how that indicator is supposed to be used ???? Look similar to Heikin Ashi bars ????
288812:46 Vimes: I don't have experience with it but i thnk its a sort of scalping signal but overlayed now on a higher aggregation. you would go long on the switch of redu to blue and vice versa or you could wiat for a cross - Again i'm just speculating so nobody rip my head off if i'm way off
288912:48 FrankB3: Intresting:: look at the weekly and enter on the daily ??
289012:51 MTS1: That's what OP said he/she does
289113:00 FrankB3: Looks more intresting when you add Heikin Ashi candles and check for turning points at narrow range bars
289213:00 MTS1: Frank; there;s a built-in TEMA also; I've not looked at them closely, seems to be 'just another' MA comparison
289313:01 FrankB3: Thanks, never looked at it,,, until now
289413:02 MTS1: There are too many studies built-in already to look at them all;)
289513:03 FrankB3: h
289613:03 FrankB3: A
289713:04 FrankB3: yep
289813:14 Nube: lol at Mobius hosting those of in this room. Can you imagine a 360 ring of people asking ThinkScript questions and there being no way to turn that off?
289913:24 george0736: question: is it possible to chart bid and ask prices for options?
290013:27 AlphaInvestor: probably, on an intraday chart, with the specific option .OPRA code in the symbol box
290113:31 FrankB3: AI: can you think of any disadvantages trading Heikin Ashi candles ???
290213:34 MTS1: Frank; can't see actual price / price history. HA is an indicator; good way to show trend; but all indicators have downsides;)
290313:35 AlphaInvestor: Frank - I think they hide useful information that you can clearly see on a Bar or traditional Candle
290413:37 FrankB3: They had a brief seminar on trader_TV, about HA. Said thier are no gaps
290513:39 MTS1: Obviously; as the bar always starts in the middle of the prior bar..
290613:40 AlphaInvestor: so, that means there is missing information ... about gaps, at a minimum
290713:41 MTS1: Even the 'current price' is calculated; so you don't see real price. I like them as a higher agg trend indicator, but want to be able to see price / history / gaps etc.
290813:45 AlphaInvestor: I don't use 'em, I don't like 'em -- but every trader is different
290913:46 Nube: All the prices are wrong, but if you want your moving average to be shaped sort of like a candle, there isn't much other choice
291013:57 willypbm: Hello, How can I add all the volume, and the number the ticks in a Darvas box? There is a script?
291113:58 MTS1: Willy; clarify?
291214:00 UpTheCreek: lWilly, doubt there is one, write one for us
291314:01 willypbm: In a Darvas Box, in the square how can I know the volume?
291414:01 MTS1: Willy; still don't understand; volume of all bars combined? How would you like to see that?
291514:02 willypbm: yes
291614:02 willypbm: the darvas box, makes little boxes
291714:02 MTS1: thta answers part of the question. .
291814:03 UpTheCreek: find the sum of vol from the beginning of the box to the end of the box. Do you think this is tradabhle?
291914:03 willypbm: yes
292014:03 willypbm: and the number of ticks
292114:04 UpTheCreek: the diff btw the top and bottom prices or something else?
292214:05 Vimes: why would the volume matter inside the box - i thought it was teh break out of the darvas box, that was important?
292314:05 MTS1: ticks are not available in TS on Time Chart. I don't see how you could present the info to make it useful, or how you'd use it to better understand how to present volume. A bubble by any box? You realize a box' re-paints'; once it triggers it draws a line further back? As UTC mentioned; all you need to do then is to sum the volume starting at that starting bar.
292414:06 MTS1: (assuming ticks = order count in this case)
292514:09 MTS1: guess we lost Willy. .
292614:09 FrankB3: willypbm::: may be close enough for ship yard work ??? http://tos.mx/UhTpJF
292714:09 Vimes: i guess if you want to see if there is unusual volume inside a narrow range box - to anticipate a breakout
292814:11 UpTheCreek: but boxes are of inidetermned size, so what is unusual?
292914:14 MTS1: Yea; not getting it either; Darvas is a price pivot level based box. I could see doing somethign with volume w ECI/vol squeze, but not sure w Darvas, or again how to present the info to make it usable.
293014:15 Vimes: i think you are right UP not sure how that would work. A better idea is maybe just to use the high volume nodes that mobius posted
293114:16 Vimes: wily is gone he may have been on to the best idea since cheeze-wiz
293214:18 AlphaInvestor: it isn't a bad idea
293314:20 FrankB3: Yes, inception: box within a box within many boxes: http://tos.mx/wLnrH8
293414:23 UpTheCreek: need better definition on what ticks mean, the volume part is reasonably easy
293514:24 MTS1: I was intreagued AI, but not sure how to present it and we lost him for feedback. .
293614:24 Vimes: well i wasn't really trying to judge the idea i was trying to understand how he thought about brnging volume into the analysis - darvas would typically look for trades from one zone to another so to speak and the box should represent a period of consolidation until it moves to a higer or lower zone
293714:25 MTS1: exactly
293814:26 MTS1: the breakout is what counts in that method. So maybe measuring that vol compared to prior breakouts (or breakdowns) may be interesting.
293914:26 AlphaInvestor: if the higher zone (just moved up) had higher volume than the previous zone ... it might signal continuation
294014:29 MTS1: Or a turnaround; the box happens bc more 'fighting' between buyers or sellers; if the breakdout is not in the right direction to be a continuation. . The box can just be longer (more bars) and have a wider range; so not sure if the cum volume would mean anything; maybe avg per bar vs prior box avg. \
294114:55 garen5660: can anyone tell me why I'm gettings an NaN return on this line?
2942plot x = close("period" = AggregationPeriod.DAY)[1];
294314:57 Vimes: remove the " perhaps
294414:57 Vimes: close(period=day);
294514:59 Vimes: sorry that syntax wasn't correct either:
2946plot Data = close(period = AggregationPeriod.DAY);
2947
294815:04 garen5660: it's still returning NaN on a lot of my quotes. I don't get it
294915:05 MTS1: you trade low vol stuff? What do you get NaN on?
295015:06 MTS1: Where do you use this; custom colum, chart, other?
295115:06 Vimes: if you are trying to do a custom quote you can't use aggregation - instead change the time in the selector box
295215:07 Vimes: but not sure why you would need a custom quote for the daily close
295315:07 MTS1: He wanted prior day [1]
295415:08 Vimes: ooh i see that now - create a quote with simple close[1];
295515:09 MTS1: Depends on where he's using and what agg if chart;)
295615:09 willypbm: Thanks FrankB3
295715:16 garen5660: custom columns
295815:16 garen5660: oh I can't use aggregations on quotes?
295915:16 garen5660: I'm trying to create a gap % column that works premarket
296015:16 Vimes: not in the study - but when you create the logic for the quote you will see an option at the top to change the timeframe
296115:17 garen5660: basically if time >930 then open/close[1]*100
2962else open 1min /close yersterday
296315:18 MTS1: so you can compare close (current price) with close[1] (prior day)
296415:18 garen5660: ya i can make it tell me the gap in a daily candlesticks but i can't get it to work during premarket, cause the candlestick won't form till 930
296515:18 amalia: Close(period=“DAYâ€) is the correct way to shorten that instead of AggregationPeriod.DAY
296615:20 garen5660: i need to reference yesterdays close and the 1min candlestick open or if 9:30 has past, then just reference the Day close/open
296715:20 Vimes: garen this is something i have in my quote list - may match what you are looking for:
2968def GapUp = open - close[1] > 0;
2969def GapDown = close[1] - open > 0;
2970
2971def sigUp = open - high[1] > 0;
2972def sigDown = low[1] - open > 0;
2973
2974def pro = (SigUp and close[1] < open[1] and open > SimpleMovingAvg(20)) or (sigdown and close[1] > open[1] and open < simpleMovingAvg(20));
2975
2976def gapPercent = if gapUp then (open - close[1])/close[1] * 100 else if gapDown then (close[1] - open)/close[1] * 100 else 0;
2977
2978addlabel(yes, astext(gapPercent, "%1$.0f") + "%", if sigdown then color.red else if sigup then color.GREEN else color.current);
2979
2980assignBackgroundColor(if pro then color.DARK_GRAY else color.current);
2981
298215:24 garen5660: does it work premarket?
298315:25 Vimes: garen to be honest i don't know you said time>930 so in taht case it will work
298415:25 Vimes: for pre-market i use a scan watchlist
298515:26 garen5660: ya i use a scan but i want a quick glance at the gap %
298615:26 garen5660: ty though
298715:30 Vimes: np
298815:30 MTS1: Garen; if that does not work pre-market you'll have to use the same logic you use to determine the 930 open to get the prior day's close.
298915:32 DMonkey:
2990#Yesterday's close......
2991def YDC = if gettime() crosses above regularTradingEnd(getyyyymmdd())
2992 then close[1]
2993 else YDC[1];
2994plot data = YDC;
2995data.setpaintingStrategy(paintingStrategy.POINTS);
2996data.setdefaultColor(color.red);
299716:24 FrankB3: Curiosity may be a disease: have over 100 books, 79 unopned
299816:24 Vimes: i am a curator of many things books, textbooks included
299916:27 FrankB3: MTS: was trying to drop a chart to get a response... most of the time you guys test stuff, before posting, I don"t
300016:31 FrankB3: MTS: wanted to see if anyone could find a way to count waves on TPO_Profile, usually there is 5 waves and the trend changes http://tos.mx/tm9WpR
300116:33 Vimes: so you are thinking like an elliot wave kind of thing
300216:34 AlphaInvestor: I like counting waves ... when I am at the beach -- otherwise not so much
300316:37 Vimes: and what about the TPO profile would define the wave for you? between high volume areas?
300416:38 FrankB3: nope, easier to cout at the start and end of boxes ??? maybe
300516:39 Vimes: not sure what you mean - seems you could take the vah and val of each time profile and use that to determine swing hi swing low perhaps
300616:41 FrankB3: Will have to get a better take on what I,m thinking,, seen another trader count waves on the full stochastic, on chart
300716:42 Vimes: i don't have it at the ready - but i thnk mobius or others had posted a swing based indicator from CCI or other singal
300816:42 UpTheCreek: an interesting approach, frank
300916:42 FrankB3: He changed the Stoch to a cycle indicator