Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 20190919 1225 Working
- Times are Arizona = EDT - 3
- ------- Wednesday, September 19, 2018 -------
- 03:23 Nube: Mornings, all. Something I though may help people visualize the index in a Fold
- #
- # Visual Aid for Fold Index Length
- # Nube
- # v.01 9.18.18
- # Sum of bar numbers using using Sum() and Fold
- input barsAgo = 5;
- def bn = BarNumber();
- # Subscript for n bars from current
- script barsAgo {
- input n = 0;
- def bn = BarNumber();
- def c = close;
- def barsBack = if !IsNaN(c[-n]) && IsNaN(c[-(n+1)])
- then bn else barsBack[1];
- plot barsAgo = barsBack;
- }
- def checkFold = fold i = 0 to barsAgo with b do b + GetValue(bn,i);
- def checkSum = Sum(bn,barsAgo);
- AddChartBubble(bn == barsAgo(barsAgo), HL2, "Bar \n" +barsAgo(barsAgo),Color.Gray,0);
- AddChartBubble(bn == barsAgo(0), HL2, "Bar "+barsAgo(0),Color.Gray,0);
- AddChartBubble(bn == barsAgo(0), low, "Sum() of "+barsAgo+" Bars = "+checkSum+"\nNote: This Bar is 1 in a Sum()",Color.Light_Gray,0);
- AddChartBubble(bn == barsAgo(barsAgo-1), low, "Sum Last \nBar "+bn,Color.Light_Gray,0);
- AddChartBubble(bn == barsAgo(0), high, "Fold of "+barsAgo+" Bars = "+checkFold+"\nNote: This Bar is Index 0 in a Fold" ,Color.White);
- AddChartBubble(bn == barsAgo(barsAgo-1), high, "Fold Last\nBar "+bn ,Color.White);
- AddChartBubble(bn == barsAgo(barsAgo), high, "Including this bar is \nwhy you see the +1\nin the Fold index" ,Color.White);
- # f/ Visual Aid for Fold Index Length
- 04:58 Nube: Bonds down, dollar down, metals not up is going to be an environment that takes some getting used to.
- 04:58 Nube: Sorry, Teach. Wrong classroom.
- 05:22 bmckinney: Is there a way to turn off the sound on TOS without having to turn off the sound on my computer?
- 05:23 DMonkey: whats making a sound in TOS?
- 05:24 bmckinney: Closing bell, opening bell, and alerts
- 05:25 bmckinney: I'm in a classroom, and I need volume on my computer, but I don't want random bells going off.
- 05:25 DMonkey: alerts....use sound.nosound / opening & closing bell your own your own....
- 05:31 AlphaInvestor: Settings - Application Settings - Notifications - turn off the Alerts checkbox
- 05:32 DMonkey: the best solution may be focus on class........
- 05:43 MTS1: and understand windows / mac; not really a TOS question
- 05:47 AlphaInvestor: Dmonkey +1
- 05:54 UpTheCreek: The Windows Volume Mixer can also be used to control the volume and mute the sound from each application that is loaded. Right-click on the speaker icon.
- 05:55 JohnnyQuotron: Good morning all...
- 05:58 Vimes: Ahoy, Matey
- 06:05 Nube: I still don't even know how to make Windows not ask me for my password, I'll never learn that volume control trick.
- 06:13 mike__w: Alpha - the other day you suggested I check out FOLD. I watch Mr.Script's previous webinar to help better understand it and came up with with this.
- 06:13 mike__w: def aug = 20180831;
- def barsaway = fold counter = 0 to 1 with lastmonth do (CountTradingDays(aug, GetYYYYMMDD()) - 1);
- def x = highest(high[barsaway], 22);
- plot p = x;
- 06:14 mike__w: I still get an error when using highest but the FOLD part works, so thanks for helping me learn something new
- 06:20 MTS1: Is this a leaning exercise Mike at this point to learn fold while you have your combined indicator working?
- 06:20 DMonkey: bigworm....you on?
- 06:21 bigworm: i am
- 06:21 bigworm: hows the morn
- 06:22 DMonkey: this is for you....
- http://tos.mx/AKrMVG
- 06:22 bigworm: thank you so much!
- 06:22 MTS1: Can I borrow it also? ;)
- 06:23 DMonkey: nope.....
- 06:23 UpTheCreek: lemme guess, some wacky zgauss mashup
- 06:23 DMonkey: lol
- 06:23 MTS1: thanks DM!
- 06:24 DMonkey: utc...of course....
- 06:24 mike__w: MTS1 - yes, just a learning exercise I came to accept that combinding all three won't work but Alpha suggested I check out Fold to see if it could be a possible solution. but I'm still getting the CL function indexer high error
- 06:25 Nube: Mike, did you see the snippet I posted the other day for getting which bar last months high occured on?
- 06:27 JohnnyQuotron: Nube... there were some excellent educational elements of that script. Thank you.
- 06:27 bigworm: dmonkey, is the alpha and beta always adjusted this way? to put the distribution 1 sd inside the curve for the 4 pole?
- 06:42 mike__w: Nube - I did check it and appreciate your help but I never got this line to plot anything
- 06:42 mike__w: plot atBar = if priorMonthBars && high == priorMonthHigh then BarNumber() else Double.NaN;
- atBar.SetPaintingStrategy(PaintingStrategy.Boolean_arrow_up);
- 06:44 UpTheCreek: well look at the code and understand when it WILL plot something. Is the criteria met by your chart?
- 06:47 mike__w: UTC - below is the full code, my understaningd is that the critia will always be met because there will always be a highest high in any given month.
- 06:47 mike__w: #TsL for Mike_W from Nube
- # gets highest high of prior month
- def month = GetMonth();
- def thisMonth = GetLastMonth();
- plot data = month;
- data.setpaintingstrategy(paintingStrategy.Values_Below);
- plot priorMonthBars = month + 1 == thisMonth;
- priorMonthBars.SetPaintingStrategy(PaintingStrategy.Boolean_arrow_down);
- plot priorMonthHigh = HighestAll( if priorMonthBars then high else Double.Nan);
- AddLabel(1, “This Month” +thisMonth+ “ Prior Month: “ +(month -1), Color.Gray);
- plot atBar = if priorMonthBars && high == priorMonthHigh then BarNumber() else Double.NaN;
- atBar.SetPaintingStrategy(PaintingStrategy.Boolean_arrow_up);
- 06:50 UpTheCreek: welcome to debug. WHEN does the code plot the arrow? 2 conitions have to be met. Are they?
- 06:55 mike__w: No there not! thanks for making me think, I had the SPY up but when I switch to ATI I got a print. Will look into it more
- 06:59 UpTheCreek: thinking is pretty critical in this endeavor
- 07:00 UpTheCreek: :)
- 07:00 Nube: Thus why I dislike this endeavor
- 07:23 artx: I using the Williams Fractal Pattern indicator with default settings.
- 07:23 artx: But it won't show unless I update the chart. How do i get the chart to update more often?
- 07:25 artx: My candle sticks update in real time but the Willams Frac. Ind won't appear unless I type in another symbol name and then retype in the symbol name of the chart Im watching.
- 07:29 MTS1: artx; confirm how many charts / swatchlists you have open (how much data you may be pulling), make sure you have good internet speeds, and make sure you don't have memory for TOS set to high. Otherwise live support is the best option as they can connect to your TOS instance.
- 07:31 artx: thanks MTS1, I have the memory set to the Max I think. I thought that woul be a good thing. But I will change it and close some watchlist.
- 07:31 MTS1: for normal use memory should be max 2 or 3 GB; check on the maintenance wheel icon on the login window. Initial memory can be about half of that or 1GB. Should be less on a machine with less than 4GB available.
- 07:31 MTS1: No is counterintuitive for TOS'; Java has issues cleaning up memory when you give it too much.
- 07:32 artx: ok thanks for the explination
- 07:34 MTS1: artx; regarding watchlist; especially considering dynamic watchlists / quotes, or custom (script) columns.
- 08:07 mvm: Does anyone know whether you can extract indicator values for a specific time period from TOS? E.g RSI(14) values for AAPL for past 30 days. Need the data in CSV or Excel format for analysis. Thanks
- 08:14 UpTheCreek: yoiu can export watchlist columns to Excel, that's it.
- 08:15 mvm: Thanks. My understanding is that the watchlist columns can only show today's value but I am looking for historical values as well
- 08:15 mvm: Is there a way to do that via watchlist cols
- 08:18 UpTheCreek: you can put custom code in cols. there is no good way to do what you want.
- 08:20 MTS1: mvm; you can create a strategy or combination of strategies to put in buy/sell orders at certain points to extract those data points. But better way to analize is use other source or create analysis in TOS by doing the math / stats in tos.
- 08:20 mvm: Can it be done via Thinkscript -? seem s like a simple extract of data . The values can be charted so there should be a way to download the data to Excel
- 08:20 MTS1: the data is free and not simple to extract.
- 08:20 MTS1: not sure why you think it should be. .
- 08:22 mvm: You can get historiclal price data from many sites - thi s is trying to get historical indicator data. Does anyone know if Yahoo or other sites provides this data
- 08:22 mvm: if it cannot be done in TOS
- 08:23 TICKZ: Hi guys.. does anyone have a studie that alerts pin bars and doji at daily atr levels ?
- 08:23 UpTheCreek: chat rules prohibit mentioning of nonn-ToS sites
- 08:25 mvm: Ok. Appreciate any help
- 08:25 UpTheCreek: the admins will give lots of help :)
- 08:53 Vimes: mvm, i don't have a solution but can you tell us what you want to di with the historical rsi data? it likely could be done native in tos
- 08:56 mvm: I want to perform additional analysis in Excel on sveveral tech indictaors - RSI, ROC, Chaikin with some custom statistical analyses I've ceated in Excel. Just need the raw dta values extracted that are plotted on teh graph
- 09:09 MTS1: The suggestion is to replicate the statistical analysis to TOS if possible; you can probalby collect the stats you want and then run it on any chart. Otherwise another solution is the best option, either TDA API or another provider.
- 09:10 UpTheCreek: I'm not even sure if the API is going to be helpful.
- 09:12 MTS1: true; that'd just pull price data; still have to replicate the indicators. . For TOS replicating the stats is probably best, extracting data can only be done wiht a strategy; you could buy on every odd minute and sell on ever even minute at a 'price' that represents the indicator value. API or 3rd party includes having to replicate the indicators.
- 09:28 AlphaInvestor: Mvm - get your historical data from another site. RSI(4) is easy to calcualte in excel
- 09:29 wharfie: Good Morning ... how do I run a scan that shows stocks in a 52 week downtrend?i tried using one that is below it's MA but essentially that can be an uptrending stock that is just trending below it's MA right?
- 09:37 ameriman: uptrending stock won’t trend below MA
- 09:37 MTS1: Right; question is how you define downtrend. Can be longer term MA value below 52 weeks ago, sum of up weeks vs down weeks, sum of weeks with faster MA below slower ma, or probably many other options you could think off.
- 09:39 Vimes: close<close[52]; on a weekly scan - but likely not a reliable def of a downtrend
- 09:39 ameriman: According to “market makers edge”, market makers use either 8 ema or 20 ema for quick trend determination
- 09:40 AlphaInvestor: market makers are using 1 min or 5 min charts ... not year long charts
- 09:41 wharfie: Thanks guys. I just tried to scan within 3% of the 260 day New low.
- 09:41 ameriman: The book says whatever time frame you are using, they use those ema, and then they also do multi time frame analysis to make sure all time frames aligned in trend
- 09:42 ameriman: Before they take trade on lower time frames
- 09:49 UpTheCreek: ok, fine, there is a moving average scan built in to the scanner
- 09:55 GraceGu: Hi , I was advised by Tos associate to check with you guys, if someone knows how to scan the top/bottom divergence pattern? I attached the picture --Tsla yesterday's hourly chart for your reference.thank you in advance.
- 09:58 UpTheCreek: ...someday they will shrink mobile screenshots
- 09:59 GraceGu: sorry for that, I am the first time in this lounge
- 09:59 GraceGu: let me see if I can withdraw it
- 09:59 UpTheCreek: if you are on mobile there's not much you can do
- 09:59 GraceGu: no, I am use the PC
- 09:59 MTS1: Grace; I don't see indicator for 'top/bottom' divergence; just trend lines? Not sure what you're scanning for indicator related on that pic
- 10:00 UpTheCreek: for the scanner to find something, you have to describe it mathematicallyt
- 10:00 GraceGu: What I'd like to do is to scan the stocks with top/bottom divergence
- 10:00 UpTheCreek: if you can do that, then code can be applied
- 10:01 MTS1: define 'top / bottom' divergence?
- 10:01 UpTheCreek: do you have specific criteria in mind?
- 10:01 MTS1: repeating does not clarify;)
- 10:01 GraceGu: In a time period, the price is going higher but the MACD's top is going lower
- 10:02 MTS1: I believe there's a MACD divergence indicator on Mobius' MuTrade
- 10:02 MTS1: (though he's against using it iirc)
- 10:03 GraceGu: ok, I got it,
- 10:03 GraceGu: thank you for all your kind help.
- 10:09 MTS1: Grace; I stand corrected, don't think it's on his mytrade, but would check for other indicators. Here's a link; paste this under setup - open shared item: aG0Omj
- 10:09 MTS1: make sure to read the notes in the script.
- 10:16 ameriman: Alexander Elder has written a whole book on MACD histogram divergences, he says MACD histogram divergence works best only when analyzed in a particular way when in between the two Diff peaks Diff goes beyond zero line, otherwise regular way doesn&apost work well
- 10:23 AlphaInvestor: Ameriman - I have heard that crossing zero logic
- 10:24 AlphaInvestor: I still think they are informational but NOT tradable
- 10:24 AlphaInvestor: divergence = price and indicator are telling you two different things. But you don't know which one will change to get back in alignment
- 10:25 GraceGu: yes, they are informational, but they can give you some alerts for the top or bottom will come soon
- 10:25 GraceGu: I mostly use them in future daily trading, it helps to make the decision
- 10:27 ameriman: AI agreed, even the zero cross method hasn’t worked well for me when price is trending, it works when sideways range
- 10:27 AlphaInvestor: by Informational I mean - Somethings up ... watch carefully ... but still not directly tradable
- 10:28 GraceGu: yes, agree, not directly tradable
- 10:29 GraceGu: by the way, not sure , is there someone in the lounge using conditions trigger to trade directly?
- 10:29 harndog: Grace - No Retail AutoTrading in TOS
- 10:30 UpTheCreek: but conditional orders driven by simple scripts are supported
- 10:30 JohnnyQuotron: amer...I have never seen a MACD strategy that consistently makes money. That is not to say they are not out there, or that I have seen every MACD strategy. So please, if you have seen a MACD strategy that is repeatable and profitable, please share it. I think there is just too much lag in the typical MACD setup for it to be repeatable.
- 10:31 marketcoding: How do I add a marketwatch column to show yesterday's close?
- 10:31 harndog: Market, have you taken a FREE platform tour?
- 10:31 AlphaInvestor: put this in a column at D aggregation CLOSE[1]
- 10:31 marketcoding: Correction: How do I show "yesterdays High"
- 10:32 harndog: A good starting place is having questions and taking a free platform tour. Contact support@thinkorswim.com
- This is a lounge of volunteers who do not work for TOS.
- We are not TOS support, just experienced users interested in coding, and helping others learn to code.
- When you're setting up your platform tour, request the chat room scripts created by TOS support.
- When looking for scripts ask a search engine: Thinkscripts, TOS scripts or check out MyTrade/Mobius
- 10:32 harndog: Vend me a soda, AI...lol
- 10:32 UpTheCreek: Grace, no regular here has ever admitted to using conditional orders on a frequent basis
- 10:33 AlphaInvestor: Harn - dat was too easy to force them to learn a bunch of thinkScript
- 10:33 harndog: +1
- 10:33 AlphaInvestor: Up - I have never used a Condition Order ... Period
- 10:33 harndog: Only when ordering with my family...:)
- 10:34 UpTheCreek: and your intchy finger is on the mouse to sell off your TRLY
- 10:37 mthfr_vaxxed: im trying to develop a conditional order i can fire off after good signals. not there yet.
- 10:38 ameriman: JohnnyQuotron agreed with what you said, that is why I dont use it anymore
- 10:39 bigworm: you on mobius?
- 10:42 ameriman: JOhnny there used to be a trader in shadow chatroom who used MACD histogram divergence but he used it discretionarily along with tape reading and price action, he was very successful daytrading 60% annual return on account size on a million dollar account. But I have not been successful with it
- 10:42 Splectacular: Hi everyone ; first time here, are there any think sript people that have created linear channel regression scans for price approaching plus or minus 2 sigma? :)
- 10:47 mthfr_vaxxed: #Mobius channel scan
- # LRC Variable Scan
- input price = hl2;
- input n = 252;
- input widthOfChannel = 69;
- def MidLine = InertiaAll(price, n);
- def dist = HighestAll(AbsValue(MidLine - price)) * (widthOfChannel / 100.0);
- # Scan only allows one plot. Set plot to Upper or Lower and def to the other
- def "Upper Band Cross" = close crosses MidLine + dist;
- plot "Lower Band Cross" = close crosses MidLine - dist;
- 10:47 mthfr_vaxxed: change your width of channel to 2 sigma
- 10:53 bigworm: whats up mthfr
- 10:54 bigworm: I just got my textbook for machine learning. Super different from what I have been reading all summer. :(
- 10:59 mthfr_vaxxed: i liked this article "Machine learning - is the emperor wearing clothes?" ... favorite quotes ... "jargon in machine learning usually doesn't deserve the shock and awe the name inspires". and "quit anthropomorphizing machine learning already".
- 11:00 mthfr_vaxxed: textbook you wanted? or for a ML class?
- 11:00 bigworm: its for class
- 11:00 Vimes: Spectacular, there is also a built in std deviation channel scan from TOS - add study filter>statistical>standarddeviationchannel
- 11:00 bigworm: learning with kernals
- 11:00 bigworm: looks like a big proofs book
- 11:04 mthfr_vaxxed: dont know much about svm actually. gotta read more
- 11:04 Splectacular: ?Sorry just got back is there a link that you can put in the chat room?
- 11:05 bigworm: just a way to classify data
- 11:05 Splectacular: I am not a coder lol :)
- 11:06 AlphaInvestor: I am too lazy to copy that , can you please make it even easier for me - SMH
- 11:07 Splectacular: I know I can copy it sorry I just dont know where to past it :(
- 11:08 AlphaInvestor: LEARN
- 11:08 mthfr_vaxxed: study button. looks like a chemistry flask
- 11:08 Splectacular: yes I will
- 11:09 Splectacular: yes I will thanx a bunch!
- 11:13 Vimes: there is a built in scan for std deviation - just use the tool provided from tos
- 11:15 Splectacular: @mthfr_vaxxed yes I see it thanx...let me ask how do you know what number corresponds to 2 sigma to replace the "69" in the code were it says: "inputwidthofChannel =69" ? thanx
- 11:16 Splectacular: @Vimes : thanx!
- 11:25 BenPotter: Hey does anyone know how to get papermoney started?
- 11:25 BenPotter: I would like to try day trading that way before i get into it with real money
- 11:25 mthfr_vaxxed: need to learn gaussian statistics. then you'll know the answer. bell curve. and then study mandelbrot and realize there is room for error because life isn't "normal"
- 11:26 BenPotter: Anyone?
- 11:28 FrankB3: BEN:: call trade for a free tour of TOS
- 11:29 Ron1982: Hi, I would like to try an strategy that has the possibility of defining a maximum amount of days to keep the position and then close it. So, Is there any function or script that allows to count the number of days from the day I opened the position and compare it to a limit amount of days?. Thanks
- 11:29 Splectacular: I know guy that worked with mandelbrot
- 11:30 Splectacular: He is into the fractal energy thing ;)
- 11:35 MTS1: Ben; you have the choice on your login screen
- 11:35 mthfr_vaxxed: im reading taleb's book still. he's a fan. the book is a little annoying though.
- 11:36 MTS1: Ron; yes you can use recursion in a script; check out chapter 10 of the TS Tutorials.
- 11:36 mthfr_vaxxed: what else you got besides looking for 2 sigma events?
- 11:37 bigworm: so for a gaussian z score , should the length of the gaussian be the same length as the normalization moiving average and sd length
- 11:37 MTS1: Basically you record when the entry order is triggered, and add one on each subsequent bar till your max is reached and use that for the close order.
- 11:37 MTS1: OR you can record the BarNumber() and calculate the difference with the current bar.
- 11:38 MTS1: ^Ron
- 11:43 MTS1: yw. .
- 11:43 bigworm: who ron
- 11:44 JohnnyQuotron: I need a little help with math theory... At least I think its math theory.
- I have data for which I have created a five peiod Gaussian Mean using the Mobius script. The line is still choppier than I would like for trend identification purposes. Am I better off:
- a: Increasing the Periods in the Gaussian calculation
- b. Smoothing the Gaussian Mean with an SMA smoothing factor
- c. Smoothing the Gaussian mean with a Gaussian smoothers
- thoughts? Advantages or disadvantages of each?
- 11:45 bigworm: so you smooth it
- 11:45 AlphaInvestor: You are better off finding a series that isn't chopping
- 11:45 UpTheCreek: what is a Gaussian mean? a mean you calculate after you Gfilter the values?
- 11:47 mthfr_vaxxed: im assuming john ehlers 4 pole gaussian filter
- 11:48 JohnnyQuotron: # Trying to achieve Normal Distribution
- # Mobius
- # V01.09.2015
- #Hint: Plots a Gaussian Mean with Standard deviation Envelope. If Normal Distribution is met, then at minimum, 68.2% of the close values should be inside a One Standard Deviation Envelope and 95.4% of the close values should be inside a 2 Standard Deviation Envelope.
- # Mobius
- # V01.09.2015
- def c;
- def w;
- def beta;
- def alpha;
- def G;
- plot GaussianMean;
- GaussianMean.SetDefaultColor(Color.WHITE);
- GaussianMean.setLineWeight(2);
- c = new_rs;
- w = (2 * Double.Pi / GaussianLength);
- beta = (1 - Cos(w)) / (Power(1.414, 2.0 / betaDev) - 1 );
- alpha = (-beta + Sqrt(beta * beta + 2 * beta));
- G = Power(alpha, 4) * c +
- 4 * (1 – alpha) * G[1] – 6 * Power( 1 - alpha, 2 ) * G[2] +
- 4 * Power( 1 - alpha, 3 ) * G[3] - Power( 1 - alpha, 4 ) * G[4];
- GaussianMean = G;
- 11:49 JohnnyQuotron: please ignore the hint... its a left over
- 11:50 Splectacular: @mthfr_vaxxed Not much else just trying to coupl those events with multitime fram MACD analysis ...
- 12:02 UpTheCreek: well the hint pretty much describes Gaussian filtering, which is intended to force the data series to a Gaussiian or 'normal' probability distribution function. not smoothing in a MA sense.
- 12:02 Ron1982: Hi MTS1, thank you very much for your help. I will check chapter 10 and follow your recommendation. Thank you again
- 12:03 cajun: JQ, ill venture a wild guess... and suggest increasing the periods. 5 is small for an approx of normal
- 12:10 JohnnyQuotron: I really wish I had taken more math in college rather than accounting....
- 12:13 mthfr_vaxxed: never too late. turn off tv. read more books.
- 12:13 mthfr_vaxxed: im dusting off the cobwebs
- 12:14 AlphaInvestor: JQkpa - Kahn Academy
- 12:14 AlphaInvestor: I had to re-learn Calculus to help my daugher pass her university class - you can teach an old dog new tricks
- 12:15 JohnnyQuotron: alpha... on Kahn now.
- 12:23 JohnnyQs_BackupWks: On a different subject. The distribution among the Sectors today is astoundingly large. http://tos.mx/hHkI9U
- 12:24 UpTheCreek: speaking of distribution, anyone know exactly how money flow in and out of ETFs is calculated?
- 12:25 Tb8: JohnnyQ: Do you have a buffer from the start of the day?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement