Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is all I have. I am missing data below.
- ------- Tuesday, January 16, 2018 -------
- 03:03 stevie_s: .
- 04:15 Nube: And now I finally see the need for an ECI scan
- 04:15 Nube:
- 05:22 MTS1: Room just closed last night as I was trying to post: Paris; thanks for Brian's details; he has several functions that I don't have highlighted and separate groups, so this will be helpfull; I'll reconcile and combine for who's interested in the future. There is no folding except for the comment sections; but I don't think TS has something usefull to use here anyway so that may be confirmed. Not in love with his color selections but to each their own and easilly changed to user prefs;).
- 05:25 Nube: Thanks, MTS. When you are done I will check it out. ++ is something I need to puts with more so looking forward to seeing what all this color stuff is a out.
- 05:25 Nube: Is *about
- 06:08 moroccanprince: hello
- 06:09 moroccanprince: SPI is currently a hot stock on news of trating a black-chain devision
- 06:19 harndog: wrong room
- 06:20 harndog: However, I think I got an email from a Nigerian Prince this morning...
- 06:21 Nube: You lucky dog.
- 06:23 harndog: A just friend checking in...
- 06:40 Nube: NQ will be 7k by lunch at this rate.
- 07:26 HoboTheClown: wondering if you guys can help out with options. if i exercised some call options, do i have to have the full amount in my account or can it be on margin? never exercised them before
- 07:28 HoboTheClown: i have some NVDA calls , 222.5 jan calls, it's negative now but the stock is at 226. so if i exercise right now, i would be green overall. is that right?
- 07:28 AlphaInvestor: Nube - beautiful example of ECI at work
- 07:29 Nube: I'm pretty sure there isn't a single rule regarding that so I suspect only the desk can answer that for sure.
- 07:30 AlphaInvestor: Hobo - there is almost always a better alternative to Exercising ... Call the Trade Desk
- 07:31 HoboTheClown: ok, thx guys. just wanted to get some ideas
- 07:31 AlphaInvestor: Hobo - in future, the Trader Lounge is a better place for trade discussions, this room is dedicated to thinkScript coding
- 07:32 HoboTheClown: yea. good point :) cheers
- 07:36 R2S2: is there a way to access the account balance and export port the live value to excel ?
- 07:39 Nube: Alpha, it's been in that range for so long I've forgotten about it. Had ECI on the chart yesterday and the bulb lit after I saw that. MonsterFlag Scan is needed.
- 07:39 AlphaInvestor: what symbol was that?
- 07:39 AlphaInvestor: P.S. I prefer that light peach over your earlier salmon border
- 07:40 Nube: SAN
- 07:40 AlphaInvestor: ah, that one often passes my fundie screens
- 07:40 Nube: It's a dumpster dive that happened to work, it's not a quality pick.
- 07:42 Nube: Okay, maybe it does have good fundies, I didn't chose it based on any fundamental basis.
- 07:43 AlphaInvestor: It is a monster bank that fell on hard times because of its location, from what I understand it is well managed
- 07:44 Joebone87: 0:36 R2S2: is there a way to access the account balance and export port the live value to excel ?
- no
- 07:44 Joebone87: seems like an obvious feature... i dont know why they dont have it in here
- 07:44 AlphaInvestor: Nube - it was a great IronCondor candidate based on what you saw (past tense) on the ECI. Not so much any more
- 07:45 AlphaInvestor: R2S2/Joe - you can export porfolio balances to your heart's content
- 07:47 Joebone87: ohh you can in the API? just not available in tos?
- 07:47 AlphaInvestor: Not the API, and not in RTD, but you can export your portfolio and all your positions from the Monitor - Account Statement tab
- 07:48 AlphaInvestor: I do it monthly to calculate Portflolio alpha and beta
- 07:50 Joebone87: right.. net liq seems like such an obvious thing to track within TOS.... i mean its why we are all here. to increase netliq.. yet there no way to track its change other than monthly statements
- 07:50 AlphaInvestor: no, if you want you can export your positions and net liq every day, or every hour if you want
- 07:51 Joebone87: export it sure.. but wouldnt a graph of netliq be nice..
- 07:52 AlphaInvestor: that is doable too
- 07:52 AlphaInvestor: in thinkScript, or after an excel export
- 07:52 AlphaInvestor: The tools are all there, you just need to put them together
- 07:52 Joebone87: how would i track PnL in thinkscript?
- 07:52 Joebone87: not PnL.. net liq
- 07:53 AlphaInvestor: with the Portfolio functions
- 07:54 Joebone87: So i need to plug all my positions in and getopenPL() ?
- 07:56 AlphaInvestor: unfortunately it might be more complicated than that, but yes you need all your positions input into a thinkScript program
- 07:57 AlphaInvestor: it is more complicated, because positions enter and exit your portfolio. As they do they may become N/A and you need to trap for that
- 07:57 Joebone87: not really efficient if I dont trade any stock and i dont hold option positions for < 2 months
- 07:57 AlphaInvestor: Note: all bets are off with options positions, because you would have to put in all your .OPRA codes
- 07:59 Joebone87: yeah... i thought so.. I think we tried this before.. just seems like its such an easy feature to implement on the backseide
- 08:01 AlphaInvestor: I have one working for all my stock positions (85-90%) plus cash (5-10%), but not the options side.
- 08:02 AlphaInvestor: It needs more testing and refinement before it is ready to see the wild an wonderful real world. Otherwise I will be in maintenance hell.
- 08:11 siva1: Hello all
- 08:12 siva1: Does any one has buy and sell volume for Index Indicator?
- 08:12 R2S2: wanting to have live data to make buying power calc's to be able to make better choices as to how much I should put into each trade... have been manually copying to my spread sheet
- 08:14 R2S2: =RTD("Tos.RTD", , "...........
- 08:18 AlphaInvestor: would be nice
- 08:23 Jake-Elwood: SIVA, buy/sell volume is not available in ToS
- 08:57 1Skeptigal: I lost the cross hairs on hover for time and price on on the chart screen anyone know where I should go to reset them back? Thanks
- 08:59 R2S2: bottom of the chart there is a circle with a cross in it.... by the plus/negative zoom
- 09:01 1Skeptigal: Boy do I feel like a dumb blond...Thanks so much.
- 09:13 Nube: A slightly less than bullish morning session.
- ---------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------
- ----------------------------------------------------------------------------------
- I'm missing chat buffer from 0913-1343
- ---------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------
- ---------------------------------------------------------------------------------
- 13:43 ZupDog: Blue_Oyster_Cult, good to see you in the room. I have a question for ya.
- 13:43 Mobius: There are 4 variables in a chart alert
- Alert(condition, "text", Alert.Type, Alert.Sound)
- 13:43 AlphaInvestor: ^^
- 13:44 AlphaInvestor: YOu were only passing 2 variables, the Alert() syntax expects 4
- 13:44 Mobius: I hate it when I pass the wrong sounds
- 13:45 trader990: Thanks Mobius and Alpha ,i understand what you guys mean now , i could swear i tried the syntax i wrote earlier and it worked before
- 13:45 trader990: Thanks guys i will try the one posted by Mobius
- 13:47 AlphaInvestor: Trader - you have 2 choices -
- a) pass 4 parameters in the order expected by the function
- b) pass them in any order, but name them correctly ... the remaining ones will take defaults if available
- 13:51 trader990: Thanks Alpha ,Mobius , you guys are teaching me something new everytime i go through a code ,seriously guys can't thank you enough
- 13:52 Shizznet: Reference/Inspector could take half of their job away if anyone paid attention to it.
- 13:54 Nube: It could take half my job away to if I could use it effectively.
- 13:57 Mobius: job - What is this job thing you speak of?
- 14:01 AlphaInvestor: Mobius - it is what the 99% do to get money
- 14:05 Nube: What is this money you speak of?
- 14:07 Shizznet: -_-
- 14:08 AlphaInvestor: Nube - that is what the 1% has ... for the rest, we have credit cards
- 14:10 Nube: Gold is money. Everything else is credit - I think JP Morgan?
- 14:12 Nube: I foresee another additional to the quote label
- 14:13 ZupDog: Hi Scripters. I need help with my lower SMI study on this chart. The bubbles at the top of the pane are not always easy to see. I tried adding * 1.002 to the end of line for the BUY bubble, but that did not work. Any help here would be appreciated. http://tos.mx/Ozwgej#
- 14:15 Nube: Zup, change the height of the lower study by adding an additional line the same color as the background slightly higher and slightly lower than what you need.
- 14:16 Nube: Misleading: it won't change the physical height of the lower study.
- 14:17 ZupDog: Sorry Nube. Do not understand what you mean.
- 14:19 ZupDog: so you saying that I should add an additional SMIscale line for 200?
- 14:19 Nube: Whatever the y axis value of the top of that bubble would be, plot a line there.
- 14:20 Nube: Plot line = sma + whateveryouneedforheadroom
- 14:21 Nube: Line.setdefaultcolor(color.your_background)
- 14:21 ZupDog: thanks Nube. will give it a try.
- 14:24 Shizznet: yw
- 14:35 ZupDog: got er done! thanks again Nube.
- 14:37 pdub1: wat up peeps
- 14:44 pdub1: have i figured out how to stop the line? no, no i have not
- 14:46 pdub1: but thats ok, i'm working on something else now, if anyone would care to guide or confirm my findings (or guesses), it would be much appreciated
- 14:47 beergas: I pass them in order of ingestion
- 14:48 pdub1: i want to run a scan that will populate once the high of the 1st candle of the day has been broken, preferably 1 min, but i'm not sure that aggregation period would matter, but not sure, 1st order of busines is to isolate the 1st candle of the days high
- 14:55 Mobius: First RTH Bar Range plotted
- # Regular Trading Hours First Bar Range
- # Mobius
- # V01.11.03.2017
- declare hide_on_daily;
- def RTH = if getTime() >= RegularTradingStart(getYYYYMMDD()) and
- secondsTillTime(1000) > 0
- then 1
- else 0;
- def "RTH First Bar" = if SecondsTillTime(0930) == 0 and
- SecondsFromTime(0930) == 0
- then barNumber()
- else "RTH First Bar"[1];
- def "RTH First Bar High" = if barNumber() == HighestAll("RTH First Bar")
- then high
- else Double.NaN;
- def "RTH First Bar Low" = if barNumber() == HighestAll("RTH First Bar")
- then low
- else Double.NaN;
- plot "First Bar High" = if RTH and
- barNumber() >= HighestAll("RTH First Bar")
- then HighestAll("RTH First Bar High")
- else Double.NaN;
- "First Bar High".SetDefaultColor(Color.GREEN);
- "First Bar High".HideBubble();
- "First Bar High".HideTitle();
- plot "First Bar Low" = if RTH and
- barNumber() >= HighestAll("RTH First Bar")
- then HighestAll("RTH First Bar Low")
- else Double.NaN;
- "First Bar Low".SetDefaultColor(Color.RED);
- "First Bar Low".HideBubble();
- "First Bar Low".HideTitle();
- AddCloud("First Bar Low", "First Bar High", Color.DARK_GRAY, Color.DARK_GRAY);
- # End Code First Bar Range
- 14:56 DMonkey: pdub...
- def start = 0930;
- def h = high;
- def c = close;
- def first_high = if secondsFromTime(start) == 0
- then high
- else first_high[1];
- plot scan = c crosses above first_high;
- 14:56 Nube: Plot firsthigh = if getsecondsfromtime(0930) > 0 and getsecondstilltime(0931) >= 0 then high else firsthigh[1];
- 14:57 Nube: Holy mackerel did I get beat to the punch on this one.
- 14:57 Mobius: That's ok Nube just shows there's more than one way to do something
- 14:58 DMonkey: more than one way to skin a hairless cat....
- 15:00 Mobius: being hairless sure saves a lot of time in food preparation. Just dip and fry.
- 15:01 pdub1: I just went to the restroom real quick (Thanks Philly Cheesesteaks!) and came back and Mobius and DMonkey wrote scripts? amazing, ty, i was planning on working it out myself, but I guess you guys are fed up with my BS - fair enuf !!
- 15:03 UpTheCreek: think its fairly safe to say that those(mostly) weren't just written. The key for you is to understand them
- 15:07 Mobius: That's about it. Students don't usually write the textbook. They read it and try to understand the principles first
- 15:09 Nube: Now I'm hungry
- 15:12 AlphaInvestor: Pdub - people saw that you gave it an honest try. That is all we ask. You will learn and will soon be helping others in this chatroom.
- 15:12 Shizznet: ^
- 15:14 AlphaInvestor: Later Traders
- 15:14 pdub1: i appreciate it, i do try but my brain isn't good with this script writing, but with some guidance from y'all I'll get there eventually, but i dont think i'll be helping others in the chatroom anytime soon, lol
- 15:16 Shizznet: It’s addicting. You’d be surprised.
- 15:17 pdub1: @mobius, this may be silly question, but when you define the RTH FB, you place the time at 930, im CST so I start at 830, does ToS, just make this simple adjustment? this is silly question but just wondering
- 15:18 harndog: TOS time is EST
- 15:18 pdub1: its fine it works, this one i dont want to know why, never mind me asking that
- 15:20 harndog: Had the same question starting out
- 15:20 pdub1: ive got a few other issues tho, today, i was using my average daily range 'clouds' study, and why would it work on some charts but not others?
- 15:20 pdub1: all 1 min charts just flipping thru my watchlist, some would work, some wouldn't
- 15:22 harndog: Not sure.., start with only the script in question on the chart
- 15:23 pdub1: ok, let me flip thru some with just this study on
- 15:23 harndog: Ie no one knows what else you have on chart that might be generating the “conflict.”
- 15:23 Shizznet: ^
- 15:23 Mobius: pdub.. As harn.. said ALL times in ThinkScript MUST be in EST no matter where you are or what time your charts are set to
- 15:24 MTS1: Mobius; curious: Why do you use RegularTradingStart to define RTH start, but if SecondsTillTime(0930) to def "RTH First Bar"; can RegularTradingStart not be used to find the first bar, or are you just showing multiple cat-skinning options?
- 15:25 Shizznet: Latter
- 15:26 MTS1: txs
- 15:26 pdub1: ok, woked on 1 out of 10 that i flipped thru, this is only thing i have in my studies
- 15:26 Mobius: RegularTradingStart() is not always the same as RTH
- 15:27 Shizznet: Or dirty feed
- 15:27 pdub1: so we have some sort of problem within the script, right? how would i troubleshoot that?
- 15:28 Jake-Elwood: me thinks this where the understanding comes in
- 15:28 pdub1: well, i wrote this part of the code, so i understand at least that
- 15:30 UpTheCreek: sometimes its something stupid that you did that if you think about you'll figure out. Most of us use extra plots and labels in an attempt to understand what is going on inside
- 15:30 MTS1: RTH stands for Regular Trading Hours right, thought RegularTradingStart() is meant to find the start of RTH so you can use it across different futures that have different regular trading hrs?
- 15:30 Mobius: there's a couple ways to debug a study
- use AddLabel() to see variable output
- use SetPaintingStrategy(PaintingStrategy.Values_Below) to see a stream or output
- 15:31 UpTheCreek: I think you got the point MTS
- 15:32 MTS1: RE: 17:26 Mobius: RegularTradingStart() is not always the same as RTH
- 15:32 Shizznet: Mhm
- 15:32 Mobius: MTS.. You answered your own question. Yes RTH is at 9:30 EST always. But futures start at other times than 9:30. Sometimes you want the RugularTradingStart and sometimes you want the Regular Trading Hours
- 15:34 Mobius: In Coding Semantics Are Important.
- 15:35 MTS1: OK; I thought RTH for say /CL was not 9:30. But I did notice volume still sometimes does not really kick in till 9:30, but thought RTH was instrument specific. Thanks!
- 15:35 fredw: Mobius is rth like "cash"hours
- 15:38 Mobius: Each instrument has it's own RegularTradingStart() (a function) but all instruments trade during Regular Trading Hours.
- 15:39 Mobius: One is a START signal. The other is a Time
- 15:40 pdub1: ok, this is what i started with and this may be the issue, this is the average daily range calculation with plots, and this is from Robert (fun with thinkscript), this does not show the outer dashed lines on every chart maybe 1/10 for whatever reason, but honestly there is no way i could look at this and go, oh ya, there is the problem, take a look if you want - http://tos.mx/v9WJgB#
- 15:41 Mobius: pdub.. I don't open links for discussion purposes. I find it far easier to just read the code in chat. So if you want my input post the script. If not that's fine too
- 15:42 pdub1: no worries, here you go
- 15:42 Mobius: And, I really don't need to look at someone elses code it it's not yours.
- 15:42 pdub1: # Intraday Aid
- # Robert Payne
- declare upper;
- input NumDays = 21;
- rec Calculation = fold idx = 0 to NumDays - 1 with a do (high(period = "day" )[idx] - low(period = "day" )[idx] + a);
- rec DailyAvg = Round(Calculation / NumDays, 2);
- rec MidPoint = (high(period = "day" )[0] + low(period = "day" )[0]) / 2;
- AddLabel (1, DailyAvg, Color.white);
- plot UB = if GetLastDay() == GetDay() AND low(period = "day" )[0] + DailyAvg > MidPoint + (DailyAvg / 2) then low(period = "day" )[0] + DailyAvg else Double.NaN;
- UB.SetDefaultColor(Color.DARK_GREEN);
- UB.SetStyle(Curve.SHORT_DASH);
- plot LB = if GetLastDay() == GetDay() AND high(period = "day" )[0] - DailyAvg < MidPoint - (DailyAvg / 2) then high(period = "day" )[0] - DailyAvg else Double.NaN;
- LB.SetDefaultColor(Color.DARK_RED);
- LB.SetStyle(Curve.SHORT_DASH);
- plot UpBound = if GetLastDay() == GetDay() then MidPoint + (DailyAvg / 2) else Double.NaN;
- UpBound.SetDefaultColor(Color.GREEN);
- UpBound.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
- plot DnBound = if GetLastDay() == GetDay() then MidPoint - (DailyAvg / 2) else Double.NaN;
- DnBound.SetDefaultColor(Color.RED);
- DnBound.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
- 15:43 MTS1: But /CL 'ends' at 14:30 ET right, still considered RTH till 1600? OR 1615? Sorry, still learning lingo.
- 15:45 Mobius: MTS.. that has no bearing on when RTH is. RTH never changes. It's from 9:30 to 3:00 regardless of what the symbol's trading hours are
- 15:46 Shizznet: Settlement (“pit”) closes at RegularTradingEnd() for /CL but it’s still tradeable 9:30-3:00
- 15:46 Shizznet: If I’m not mistaken.
- 15:46 Mobius: MTS.. Your just confusing two different constants
- 15:46 MTS1: Thanks
- 15:48 Mobius: pdub.. That Calculation fold isn't a fold expression
- 15:48 Mobius: in fact none of the first variables are recursive or folds
- 15:49 UpTheCreek: why the heck does Payne use index [0]? was it required back in the olden days?
- 15:49 Mobius: no Up.. just ignorant
- 15:50 Mobius: nothing in fold or recursive has changed other than rec not being needed now
- 15:50 Shizznet: lol Mob
- 15:50 UpTheCreek: probbly just to wow his followers
- 15:50 Mobius: What followers
- 15:51 UpTheCreek: readers of his blog/site
- 15:51 Shizznet: lmao
- 15:51 Mobius: Ah.. Blind leading the Blind
- 15:51 UpTheCreek: this is complicated stuff, just let me do it
- 16:04 pdub1: usually doesnt get this cold in texas
- 16:04 pdub1: 24 right now
- 16:05 UpTheCreek: never been to the Panhandle?
- 16:05 pdub1: a long time ago i drove through it
- 16:05 UpTheCreek: in summer?
- 16:06 pdub1: i think so, but the state is huge, so the temp has to vary greatly
- 16:08 Shizznet: Seattle broke heat temperatures for winter season yesterday
- 16:08 Shizznet: 67 I think
- 16:08 pdub1: ok, so does the entire code need to be rewritten, or can i just change or update some simple things like rec to def?
- 16:10 UpTheCreek: u can update that, but there's no need
- 16:10 DMonkey: you needto start from scratch....
- 16:11 pdub1: did you gents find what is wrong with it to cause it be flaky and not work sometimes?
- 16:11 Mobius: i don't now what the purpose is of the code - The first variable returns the high and low of the highest indexed bars all the time and it never changes so you could just use high[21] - low[21
- 16:12 UpTheCreek: yup, serioously flawed
- 16:13 pdub1: so since i based my addd scrip of of his UB calculation therin lies the problem?
- 16:15 pdub1: ok, well wats the level of difficulty for a low I.Q. (pdub1) person that doesn't write code to rewrite this code? asking for a friend?
- 16:16 Mobius: What is your goal
- 16:16 UpTheCreek: if I recall, you were given 3 examples that each make more sense than this Payne thing that we don't understand
- 16:17 DMonkey: tell friend, don't rewrite... start from scratch......tell friend to define goals...
- 16:22 fredw: pdub are you trying to use the intraday aid to predict how far a stock might move on any given day?
- 16:22 pdub1: well, i do like to know the last months or last 21 trading days average daily range of an equity i'm looking at, i like to know, because i base my targets and stops off of this, adr/6 + entry = target, adr/4 - entry = stop, and then i like to see the top of the adr on the chart so i know where the stock is within that range, low, middle or high, that is why i made the additional script that added my pretty clouds, so i could quickly glance at it
- 16:23 fredw: pdub this is too complicated for me
- 16:24 fredw: if you figure it out can you explain it later on
- 16:24 fredw: thanks
- 16:26 DMonkey: so you something like nesting the daily ATR around the open?
- 16:26 Shizznet: So a strategy then
- 16:27 UpTheCreek: ATR or ADR, decision time
- 16:27 pdub1: i mean #1, i'm not sure if i am capable of writing a script to do this, but certainly would need guidance which would test at least 1 persons patience, #2, it certainly will not be as fancy as this one with its painting strategies and what not, and #3, if someone is going to help me, i still would like help on getting that damn line to stop in Mobius pivot array script, that i been trying to do since last friday, #4 go 'f' yourself - cast your #'d votes now
- 16:28 pdub1: um the adr is based on the day's lowest low, so since i only trade long right now, i'm just concerned with how high it is
- 16:30 pdub1: at least that is what i want to plot
- 16:32 UpTheCreek: so how would u plot today's range?
- 16:32 pdub1: um, highesthigh-lowestlow?
- 16:32 Shizznet: No señor
- 16:33 pdub1: highesthigh, must not mean high of day then
- 16:33 Mobius: pdub.. if your wanting to plot the daily average range around an average then look at the TOS native study Keltner Channel
- 16:33 UpTheCreek: think daily chart
- 16:33 UpTheCreek: it greatly simplifies things
- 16:33 Shizznet: Highest(High) is the Highest High within 12 bars default.
- 16:34 UpTheCreek: lots of helpers here, I'm gonna go deal with dinner
- 16:34 pdub1: but lowestlow does mean the low of the day in intraday
- 16:34 pdub1: ok thx UTC
- 16:34 Shizznet: No señor
- 16:35 pdub1: welp
- 16:35 pdub1: hold on manual time
- 16:35 pdub1: i made a note to check out keltner channels too btw @mobius
- 16:36 Mobius: Highest(high, length) and Lowest(low, length) plotted is Darvas Box, Stochastic Oscillator and if you average the Highest - Lowest that's Keltner Channel
- 16:38 Mobius: Fractal Pivots plot the lowest point and highest points in a range of bars
- 16:39 Mobius: Like Solomon said 3000 years ago -"There's nothing new under the sun" decide what you want an how you want it plotted and somebody has already done it
- 16:44 fredw: wise man Mobius
- 16:44 DMonkey: pdub....decise on calculation....decide what time to start plot....decide how to plot.....
- 16:46 pdub1: yep, just a sec, im working out high, highest and highall is, brb, but i told you guys this would be excruciating
- 16:48 Shizznet: I’m High
- 16:48 Shizznet: In high
- 16:51 pdub1: lulz
- 17:09 pdub1: ok,
- 17:11 pdub1: when Forrest tells Jenny that "I am not a smart man, Jenny", this is what you are dealing with, ok, so to break this down or figure out the high of day only, i wrote a simple script - def h = high; plot line = h; so high is the high of each candle/bar
- 17:11 pdub1: so that is not the high of the day, so lets try highest
- 17:13 harndog: Just hit on Twitter from John Hart: Hello all of our individual trader-developers! I have a new treat for you: https://developer.tdameritrade.com we just launched a new individual developer website for you!
- 17:14 harndog: https://developer.tdameritrade.com/
- 17:15 Jake-Elwood: likely not what u think, Harn dog
- 17:15 Shizznet: pdub, while in Editor, look at the inputs for High in Inspector to the right side
- 17:15 harndog: If you are accusing me of thinking , your already off track...
- 17:15 Jake-Elwood: :0
- 17:16 pdub1: what do you mean 'in Inspector'?
- 17:17 Shizznet: Reread what I wrote
- 17:17 pdub1: i see it
- 17:17 pdub1: omg,
- 17:18 pdub1: def h = high(period = AggregationPeriod.DAY);
- plot line = h;
- 17:19 pdub1: THAT is the high of the day ^^
- 17:20 pdub1: ok, so we have to define the period we want inside of parenthesis after the high
- 17:20 pdub1: can we just put 'day' in parenthesis?
- 17:20 pdub1: let me try
- 17:21 Shizznet: Si
- 17:22 Shizznet: Abuse the use of that Inspector
- 17:24 pdub1: ok, will do, but it seems like that there is a term that may better describe this, or you guys i think write it more simply than that, i couldn't get it to take just def h = high(day); that didnt work
- 17:24 pdub1: so we have this def h = high(period = AggregationPeriod.DAY);
- plot line = h;
- 17:25 pdub1: i'm ok if thats it for now
- 17:25 pdub1: now im gonna def the low
- 17:27 fredw: if that's the high you want then go to the next step.
- 17:27 pdub1: when i type in def l = low and go to the inspector, it just has like a calculator there now, how come?
- 17:29 Jake-Elwood: no command on that line
- 17:29 Nube: def = !low
- 17:29 Stryder008: anyone want an improved RSI or MFI? (50 line and clouds for oversold/overbought zones)
- 17:29 Nube: oh, that a "el", sorry
- 17:29 fredw: look through tos native indicators. there are daily indicators that you can edit
- 17:30 Jake-Elwood: sure Stryder, esp if it'll make me millions
- 17:30 Stryder008: well i make no promises of that ;)
- 17:30 Jake-Elwood: always hopin'
- 17:30 harndog: Ok...500k works
- 17:31 harndog: Get the auction process going
- 17:31 Stryder008: ok my cut is 20%
- 17:31 Stryder008: improved MFI: http://tos.mx/b33fs7#
- 17:31 harndog: 2/20
- 17:32 Stryder008: improved RSI: http://tos.mx/2gSghx#
- 17:32 Stryder008: this is my way of giving back to the community here
- 17:32 Nube: I'll give you half of every billion I make
- 17:33 UpTheCreek: taking out expenses?
- 17:33 Stryder008: a big thanks to Mobius, AlphaInvestor, UpTheCreek, Nube
- 17:33 fredw: pdub steel dailyhighlow use it in your code
- 17:33 harndog: Thank you and did these scripts have headers?
- 17:33 Stryder008: lol Nube
- 17:33 Stryder008: i only put a header for the clouds
- 17:34 pdub1: look at this shit - def h = high(period = AggregationPeriod.DAY);
- plot line = h;
- def l = low(period = AggregationPeriod.DAY);
- plot linel = l;
- def ADR = h-l;
- addlabel (yes,ADR,color.white);
- 17:35 Stryder008: i plan to add a 'q score' to the RSI and MFI scripts to utilize a lookback to give buy/sell signals with arrows. but that's quite a bit more complicated ;)
- 17:35 pdub1: so that answers UTC question of what is todays average daily range - where is he? dammit
- 17:36 Stryder008: the RSI has this feature - but i'm still tweaking it
- 17:36 Shizznet: What’s next
- 17:37 pdub1: next we need to total the last months period of ADR's and divide by 21 total trading days to get our average adr
- 17:37 fredw: pdub you are basically rewriting the average true range
- 17:37 pdub1: daily adr
- 17:37 Jake-Elwood: Stryder you should really put a header at the top of the code so we know what version it is, when it was written, who to blame, etc.
- 17:38 fredw: why don't you just edit tos average true range
- 17:38 UpTheCreek: fred, the average daily range is NOT the same as the ATR. ATR is more complicated
- 17:39 pdub1: i was lookin at what ATR was...
- 17:39 pdub1: ya fred its not the same, geez
- 17:39 harndog: #StudyName:
- #Description:
- #Author:
- #Requested By:
- # Ver Date Auth Change
- #
- # TOS.mx Link:
- # Trading Notes:
- 17:40 Stryder008: thanks for the tip, Jake. i will add that.
- 17:40 UpTheCreek: they both have their place, depends on what you are trying to do.
- 17:40 Stryder008: ty harn
- 17:40 harndog: Script of header: http://tos.mx/4Fqwmo#
- 17:40 Stryder008: ty
- 17:41 harndog: yw.... thank you for kicking back into the room
- 17:41 Shizznet: ^
- 17:42 pdub1: looks like ATR uses prior days close in its calculations, but dont hold me to that, i clearly do not know what i'm doing
- 17:43 pdub1: ok, so UTC i found the what (1) days adr was, so now i have to add up all of these for the last period, being a month
- 17:44 Stryder008: it's the least i could do
- 17:45 admin_bkTOS: This is a reminder that the thinkorswim chat rooms will be closing in 15 min. Forum hours are from 5am-8pm CT Monday-Thursday, and 5am-5pm CT on Friday. Please finish your conversations before 8pm CT.
- 17:45 avshar: could somebody please PB today between 16:45 and 18:26? thank you
- 17:45 avshar: that's in CST
- 17:45 pdub1: oh no
- 17:45 Shizznet: I just got on desktop =\
- 17:46 pdub1: we need a late checkout
- 17:47 Jake-Elwood: /UF83NL9Q
- 17:47 avshar: thank you, Jake
- 17:48 pdub1: how would i say total of last 21 ADR's?
- 17:48 pdub1: hmmm
- 17:48 Shizznet: Sum()
- 17:48 UpTheCreek: patrick, one of my previous suggestions was to do this on a daily chart. doing it intraday is going to be significantly more painful
- 17:49 pdub1: but i trade on an intraday chart
- 17:50 Nube: http://tos.mx/CI9rwH#
- 17:50 UpTheCreek: that doesnn't makeit easaier
- 17:50 Nube: Updated quote label to include a quote for when gold is on the ticker
- 17:50 Nube:
- 17:51 Shizznet: omg lol
- 17:51 pdub1: ok, so u want me to start again on a daily chart?
- 17:51 Shizznet: Such a good way to end the night haha
- 17:51 UpTheCreek: lol nube
- 17:52 UpTheCreek: yes, when you have it working on the daily, you get a bronze star
- 17:53 pdub1: well my plots and label are on the daily chart right now
- 17:53 fredw: #by Lash #Apr 27, 2017 input ATRLength = 5; input period = AggregationPeriod.DAY; def ATR = Average(TrueRange(high(period = period), close(period = period), low(period = period)), ATRLength); AddLabel(yes, "Average True Range " + ATR, if ATR > ATR[1] then Color.GREEN else Color.RED);
- 17:53 fredw: gn
- 17:53 pdub1: did fred just mic drop us?
- 17:54 UpTheCreek: looks that way
- 17:54 UpTheCreek: unfortunately for you, you care about ADR
- 17:55 pdub1: idk what fred did, imma place it in a study
- 17:55 UpTheCreek: double unfortunately, that doesn't solve the intraday problem
- 17:57 Shizznet:
- #TimeBased_Renko_V2
- ## amalia
- #Hint: For /Futures products mainly. Renko bars based on the Stretch by Crabel, MinimumValue by Amalia or AverageTrueRange
- #Notes: v1 = http://tos.mx/Onm5Wb#
- #Looks best when
- AssignBackgroundColor(Color.BLACK); #is enabled
- AddVerticalLine(GetTime() crosses above RegularTradingEnd(GetYYYYMMDD()), "Globex Start", CreateColor(0, 102, 102));
- AddVerticalLine(GetTime() crosses above RegularTradingStart(GetYYYYMMDD()), "RTH Start", CreateColor(255, 51, 0));
- declare hide_on_daily;
- input showLabels = YES;
- input RangeMethod = {default Stretch, Min, ATR};
- input RangeLength = 10;
- input averageType = AverageType.SIMPLE;
- input showClouds = YES;
- script R {
- input V = 0;
- plot R = Round(V/TickSize(),0)*TickSize();
- }#TickSize rounding ^
- input RangeStart = {default Globex, RTH};
- def First;
- switch (RangeStart) {
- case Globex:
- First = if GetTime() crosses above RegularTradingEnd(GetYYYYMMDD()) then 1 else 0;
- case RTH:
- First = if GetTime() crosses above RegularTradingStart(GetYYYYMMDD()) then 1 else 0;
- }
- def O = Open;
- def H = High;
- def L = Low;
- def bar = BarNumber();
- def NA = Double.NaN;
- def ORActive = if First==1 then bar else 0;
- def Whut = if bar == ORActive then bar else Whut[1];
- def Wut = CompoundValue(1, Max(bar, Whut) - Min(bar, Whut), O);
- #Script The Stretch by T. Crabel and Minimum Value by Amalia or AverageTrueRange
- script Vol {
- def A = AggregationPeriod.DAY;
- input sLength = 10;
- input Avg = AverageType.SIMPLE;
- def T = TickSize();
- def C = close(period = A)[1];
- def O = open(period = A)[1];
- def L = low(period = A)[1];
- def H = high(period = A)[1];
- #Minimum average of the tail end calculation
- plot Min = MovingAverage(Avg, (if C>=O then Min(H-C, O-L) else Min(H-O, C-L)), sLength);
- #Define "The Stretch" by T. Crabel
- plot Stretch = MovingAverage(Avg, Min(H-O, O-L), sLength);
- #AverageTrueRange
- plot ATR = MovingAverage(Avg, TrueRange(high, close, low), sLength);
- }
- def Range;
- switch (RangeMethod) {
- case Stretch:
- Range = Vol("s length" = RangeLength, avg = averageType).Stretch;
- case Min:
- Range = Vol("s length" = RangeLength, avg = averageType).Min;
- case ATR:
- Range = Vol("s length" = RangeLength, avg = averageType).ATR;
- }
- def BrickSize = R(Range);
- def Mortar = if Wut==0 then H else if H>=Mortar[1]+BrickSize then Mortar[1]+BrickSize else if Wut==0 then L else if L<=Mortar[1]-BrickSize then Mortar[1]-BrickSize else Mortar[1];
- plot Bricks = Mortar;
- def Stack = if Mortar!=Mortar[1] then Mortar[1] else Stack[1];
- plot Renko = Stack;
- #Direction bias
- input showArrows = YES;
- def ArrUp = if showArrows and H crosses below Min(Bricks, Renko) then H else NA;
- def ArrDn = if showArrows and L crosses above Max(Bricks, Renko) then L else NA;
- plot Arr_Up = (ArrDn);
- plot Arr_Dn = (ArrUp);
- #In order to improve trade risk management while daytrading, you can use Range*1 as a target and use Range*.618 as a stoploss. I sometimes use Range*3 as targets and Range*1 as a stoploss depending on parameters and market conditions.
- input show_Values = YES;
- plot RangeValue = if show_Values and H==high(period = "DAY") then R(Range) else NA;
- plot StopLossValue = if show_Values and L==Low(period = "DAY") then R(Range*.618) else NA;
- addLabel(showLabels,
- "Range = " + R(Range) + " | " +
- "StopLoss = " + R(Range*.618) + " | " +
- if Arr_Up then "Buy" else if Arr_Dn then "Sell" else ""
- ,Color.GREEN);
- input alerts = YES;
- alert(if alerts and Arr_Up then 1 else 0, "Buy", Alert.ONCE, Sound.CHIMES);
- alert(if alerts and Arr_Dn then 1 else 0, "Sell", Alert.ONCE, Sound.CHIMES);
- AddCloud(if showClouds then Bricks else 0, if showClouds then Renko else 0, Color.GRAY, Color.GRAY);
- Arr_Up.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
- Arr_Dn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
- Bricks.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
- Renko.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
- RangeValue.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
- StopLossValue.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
- Arr_Up.SetDefaultColor(Color.WHITE);
- Arr_Dn.SetDefaultColor(Color.WHITE);
- Bricks.SetDefaultColor(Color.GRAY);
- Renko.SetDefaultColor(Color.GRAY);
- #End Code
- 17:57 UpTheCreek: hey nube, it should be 'gentlemen'
- 17:58 Nube: Oh duh, it's not a gentleman refers bonds
- 17:58 Nube: or prefers them either
- 17:58 Nube: thanks for catching that
- 17:58 UpTheCreek: shizz, do you know why it's not as simple as sum()???
- 17:59 Shizznet: You can use that to plot targets. Put something in like def TgtUp = Max(Bricks, Renko)+(Max(Bricks, Renko)*2); or whatever. Vice-versa for lower target.
- 17:59 pdub1: is that for me?
- 17:59 Shizznet: Mhm
- 17:59 Shizznet: Coding practice that is.
- 18:00 Shizznet: NIght
- 18:00 admin_bkTOS:
- Thank you for using thinkorswim. Chat Rooms are available daily from 5am-8pm CT Monday-Thursday, and 5am-5pm CT on Friday for open discussion on the markets and trade related content
- TOS platform questions? email: support@thinkorswim.com
- or check out the Learning Center, full of demos on how to use thinkorswim trading and charting tools: http://tlc.thinkorswim.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement