Advertisement
jcseattle

Untitled

Jan 16th, 2018
1,978
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.00 KB | None | 0 0
  1. This is all I have. I am missing data below.
  2.  
  3.  
  4.  
  5. ------- Tuesday, January 16, 2018 -------
  6. 03:03 stevie_s: .
  7. 04:15 Nube: And now I finally see the need for an ECI scan
  8. 04:15 Nube:
  9. 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;).
  10. 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.
  11. 05:25 Nube: Is *about
  12. 06:08 moroccanprince: hello
  13. 06:09 moroccanprince: SPI is currently a hot stock on news of trating a black-chain devision
  14. 06:19 harndog: wrong room
  15. 06:20 harndog: However, I think I got an email from a Nigerian Prince this morning...
  16. 06:21 Nube: You lucky dog.
  17. 06:23 harndog: A just friend checking in...
  18. 06:40 Nube: NQ will be 7k by lunch at this rate.
  19. 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
  20. 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?
  21. 07:28 AlphaInvestor: Nube - beautiful example of ECI at work
  22. 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.
  23. 07:30 AlphaInvestor: Hobo - there is almost always a better alternative to Exercising ... Call the Trade Desk
  24. 07:31 HoboTheClown: ok, thx guys. just wanted to get some ideas
  25. 07:31 AlphaInvestor: Hobo - in future, the Trader Lounge is a better place for trade discussions, this room is dedicated to thinkScript coding
  26. 07:32 HoboTheClown: yea. good point :) cheers
  27. 07:36 R2S2: is there a way to access the account balance and export port the live value to excel ?
  28. 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.
  29. 07:39 AlphaInvestor: what symbol was that?
  30. 07:39 AlphaInvestor: P.S. I prefer that light peach over your earlier salmon border
  31. 07:40 Nube: SAN
  32. 07:40 AlphaInvestor: ah, that one often passes my fundie screens
  33. 07:40 Nube: It's a dumpster dive that happened to work, it's not a quality pick.
  34. 07:42 Nube: Okay, maybe it does have good fundies, I didn't chose it based on any fundamental basis.
  35. 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
  36. 07:44 Joebone87: 0:36 R2S2: is there a way to access the account balance and export port the live value to excel ?
  37.  
  38. no
  39. 07:44 Joebone87: seems like an obvious feature... i dont know why they dont have it in here
  40. 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
  41. 07:45 AlphaInvestor: R2S2/Joe - you can export porfolio balances to your heart's content
  42. 07:47 Joebone87: ohh you can in the API? just not available in tos?
  43. 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
  44. 07:48 AlphaInvestor: I do it monthly to calculate Portflolio alpha and beta
  45. 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
  46. 07:50 AlphaInvestor: no, if you want you can export your positions and net liq every day, or every hour if you want
  47. 07:51 Joebone87: export it sure.. but wouldnt a graph of netliq be nice..
  48. 07:52 AlphaInvestor: that is doable too
  49. 07:52 AlphaInvestor: in thinkScript, or after an excel export
  50. 07:52 AlphaInvestor: The tools are all there, you just need to put them together
  51. 07:52 Joebone87: how would i track PnL in thinkscript?
  52. 07:52 Joebone87: not PnL.. net liq
  53. 07:53 AlphaInvestor: with the Portfolio functions
  54. 07:54 Joebone87: So i need to plug all my positions in and getopenPL() ?
  55. 07:56 AlphaInvestor: unfortunately it might be more complicated than that, but yes you need all your positions input into a thinkScript program
  56. 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
  57. 07:57 Joebone87: not really efficient if I dont trade any stock and i dont hold option positions for < 2 months
  58. 07:57 AlphaInvestor: Note: all bets are off with options positions, because you would have to put in all your .OPRA codes
  59. 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
  60. 08:01 AlphaInvestor: I have one working for all my stock positions (85-90%) plus cash (5-10%), but not the options side.
  61. 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.
  62. 08:11 siva1: Hello all
  63. 08:12 siva1: Does any one has buy and sell volume for Index Indicator?
  64. 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
  65. 08:14 R2S2: =RTD("Tos.RTD", , "...........
  66. 08:18 AlphaInvestor: would be nice
  67. 08:23 Jake-Elwood: SIVA, buy/sell volume is not available in ToS
  68. 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
  69. 08:59 R2S2: bottom of the chart there is a circle with a cross in it.... by the plus/negative zoom
  70. 09:01 1Skeptigal: Boy do I feel like a dumb blond...Thanks so much.
  71. 09:13 Nube: A slightly less than bullish morning session.
  72.  
  73. ---------------------------------------------------------------------------------
  74. ---------------------------------------------------------------------------------
  75. ---------------------------------------------------------------------------------
  76. ---------------------------------------------------------------------------------
  77. ----------------------------------------------------------------------------------
  78.  
  79. I'm missing chat buffer from 0913-1343
  80.  
  81. ---------------------------------------------------------------------------------
  82. ---------------------------------------------------------------------------------
  83. ---------------------------------------------------------------------------------
  84. ---------------------------------------------------------------------------------
  85. ---------------------------------------------------------------------------------
  86.  
  87.  
  88.  
  89. 13:43 ZupDog: Blue_Oyster_Cult, good to see you in the room. I have a question for ya.
  90. 13:43 Mobius: There are 4 variables in a chart alert
  91. Alert(condition, "text", Alert.Type, Alert.Sound)
  92. 13:43 AlphaInvestor: ^^
  93. 13:44 AlphaInvestor: YOu were only passing 2 variables, the Alert() syntax expects 4
  94. 13:44 Mobius: I hate it when I pass the wrong sounds
  95. 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
  96. 13:45 trader990: Thanks guys i will try the one posted by Mobius
  97. 13:47 AlphaInvestor: Trader - you have 2 choices -
  98. a) pass 4 parameters in the order expected by the function
  99. b) pass them in any order, but name them correctly ... the remaining ones will take defaults if available
  100.  
  101. 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
  102. 13:52 Shizznet: Reference/Inspector could take half of their job away if anyone paid attention to it.
  103. 13:54 Nube: It could take half my job away to if I could use it effectively.
  104. 13:57 Mobius: job - What is this job thing you speak of?
  105. 14:01 AlphaInvestor: Mobius - it is what the 99% do to get money
  106. 14:05 Nube: What is this money you speak of?
  107. 14:07 Shizznet: -_-
  108. 14:08 AlphaInvestor: Nube - that is what the 1% has ... for the rest, we have credit cards
  109. 14:10 Nube: Gold is money. Everything else is credit - I think JP Morgan?
  110. 14:12 Nube: I foresee another additional to the quote label
  111. 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#
  112. 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.
  113. 14:16 Nube: Misleading: it won't change the physical height of the lower study.
  114. 14:17 ZupDog: Sorry Nube. Do not understand what you mean.
  115. 14:19 ZupDog: so you saying that I should add an additional SMIscale line for 200?
  116. 14:19 Nube: Whatever the y axis value of the top of that bubble would be, plot a line there.
  117. 14:20 Nube: Plot line = sma + whateveryouneedforheadroom
  118. 14:21 Nube: Line.setdefaultcolor(color.your_background)
  119. 14:21 ZupDog: thanks Nube. will give it a try.
  120. 14:24 Shizznet: yw
  121. 14:35 ZupDog: got er done! thanks again Nube.
  122. 14:37 pdub1: wat up peeps
  123. 14:44 pdub1: have i figured out how to stop the line? no, no i have not
  124. 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
  125. 14:47 beergas: I pass them in order of ingestion
  126. 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
  127. 14:55 Mobius: First RTH Bar Range plotted
  128.  
  129. # Regular Trading Hours First Bar Range
  130. # Mobius
  131. # V01.11.03.2017
  132.  
  133. declare hide_on_daily;
  134.  
  135. def RTH = if getTime() >= RegularTradingStart(getYYYYMMDD()) and
  136. secondsTillTime(1000) > 0
  137. then 1
  138. else 0;
  139. def "RTH First Bar" = if SecondsTillTime(0930) == 0 and
  140. SecondsFromTime(0930) == 0
  141. then barNumber()
  142. else "RTH First Bar"[1];
  143. def "RTH First Bar High" = if barNumber() == HighestAll("RTH First Bar")
  144. then high
  145. else Double.NaN;
  146. def "RTH First Bar Low" = if barNumber() == HighestAll("RTH First Bar")
  147. then low
  148. else Double.NaN;
  149. plot "First Bar High" = if RTH and
  150. barNumber() >= HighestAll("RTH First Bar")
  151. then HighestAll("RTH First Bar High")
  152. else Double.NaN;
  153. "First Bar High".SetDefaultColor(Color.GREEN);
  154. "First Bar High".HideBubble();
  155. "First Bar High".HideTitle();
  156. plot "First Bar Low" = if RTH and
  157. barNumber() >= HighestAll("RTH First Bar")
  158. then HighestAll("RTH First Bar Low")
  159. else Double.NaN;
  160. "First Bar Low".SetDefaultColor(Color.RED);
  161. "First Bar Low".HideBubble();
  162. "First Bar Low".HideTitle();
  163. AddCloud("First Bar Low", "First Bar High", Color.DARK_GRAY, Color.DARK_GRAY);
  164. # End Code First Bar Range
  165.  
  166. 14:56 DMonkey: pdub...
  167. def start = 0930;
  168. def h = high;
  169. def c = close;
  170. def first_high = if secondsFromTime(start) == 0
  171. then high
  172. else first_high[1];
  173. plot scan = c crosses above first_high;
  174.  
  175. 14:56 Nube: Plot firsthigh = if getsecondsfromtime(0930) > 0 and getsecondstilltime(0931) >= 0 then high else firsthigh[1];
  176. 14:57 Nube: Holy mackerel did I get beat to the punch on this one.
  177. 14:57 Mobius: That's ok Nube just shows there's more than one way to do something
  178. 14:58 DMonkey: more than one way to skin a hairless cat....
  179. 15:00 Mobius: being hairless sure saves a lot of time in food preparation. Just dip and fry.
  180. 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 !!
  181. 15:03 UpTheCreek: think its fairly safe to say that those(mostly) weren't just written. The key for you is to understand them
  182. 15:07 Mobius: That's about it. Students don't usually write the textbook. They read it and try to understand the principles first
  183. 15:09 Nube: Now I'm hungry
  184. 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.
  185. 15:12 Shizznet: ^
  186. 15:14 AlphaInvestor: Later Traders
  187. 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
  188. 15:16 Shizznet: It’s addicting. You’d be surprised.
  189. 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
  190. 15:18 harndog: TOS time is EST
  191. 15:18 pdub1: its fine it works, this one i dont want to know why, never mind me asking that
  192. 15:20 harndog: Had the same question starting out
  193. 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?
  194. 15:20 pdub1: all 1 min charts just flipping thru my watchlist, some would work, some wouldn't
  195. 15:22 harndog: Not sure.., start with only the script in question on the chart
  196. 15:23 pdub1: ok, let me flip thru some with just this study on
  197. 15:23 harndog: Ie no one knows what else you have on chart that might be generating the “conflict.”
  198. 15:23 Shizznet: ^
  199. 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
  200. 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?
  201. 15:25 Shizznet: Latter
  202. 15:26 MTS1: txs
  203. 15:26 pdub1: ok, woked on 1 out of 10 that i flipped thru, this is only thing i have in my studies
  204. 15:26 Mobius: RegularTradingStart() is not always the same as RTH
  205. 15:27 Shizznet: Or dirty feed
  206. 15:27 pdub1: so we have some sort of problem within the script, right? how would i troubleshoot that?
  207. 15:28 Jake-Elwood: me thinks this where the understanding comes in
  208. 15:28 pdub1: well, i wrote this part of the code, so i understand at least that
  209. 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
  210. 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?
  211. 15:30 Mobius: there's a couple ways to debug a study
  212. use AddLabel() to see variable output
  213. use SetPaintingStrategy(PaintingStrategy.Values_Below) to see a stream or output
  214.  
  215. 15:31 UpTheCreek: I think you got the point MTS
  216. 15:32 MTS1: RE: 17:26 Mobius: RegularTradingStart() is not always the same as RTH
  217. 15:32 Shizznet: Mhm
  218. 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
  219. 15:34 Mobius: In Coding Semantics Are Important.
  220. 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!
  221. 15:35 fredw: Mobius is rth like "cash"hours
  222. 15:38 Mobius: Each instrument has it's own RegularTradingStart() (a function) but all instruments trade during Regular Trading Hours.
  223. 15:39 Mobius: One is a START signal. The other is a Time
  224. 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#
  225. 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
  226. 15:42 pdub1: no worries, here you go
  227. 15:42 Mobius: And, I really don't need to look at someone elses code it it's not yours.
  228. 15:42 pdub1: # Intraday Aid
  229. # Robert Payne
  230. declare upper;
  231. input NumDays = 21;
  232.  
  233. rec Calculation = fold idx = 0 to NumDays - 1 with a do (high(period = "day" )[idx] - low(period = "day" )[idx] + a);
  234. rec DailyAvg = Round(Calculation / NumDays, 2);
  235. rec MidPoint = (high(period = "day" )[0] + low(period = "day" )[0]) / 2;
  236.  
  237. AddLabel (1, DailyAvg, Color.white);
  238.  
  239. plot UB = if GetLastDay() == GetDay() AND low(period = "day" )[0] + DailyAvg > MidPoint + (DailyAvg / 2) then low(period = "day" )[0] + DailyAvg else Double.NaN;
  240. UB.SetDefaultColor(Color.DARK_GREEN);
  241. UB.SetStyle(Curve.SHORT_DASH);
  242.  
  243. plot LB = if GetLastDay() == GetDay() AND high(period = "day" )[0] - DailyAvg < MidPoint - (DailyAvg / 2) then high(period = "day" )[0] - DailyAvg else Double.NaN;
  244. LB.SetDefaultColor(Color.DARK_RED);
  245. LB.SetStyle(Curve.SHORT_DASH);
  246.  
  247. plot UpBound = if GetLastDay() == GetDay() then MidPoint + (DailyAvg / 2) else Double.NaN;
  248. UpBound.SetDefaultColor(Color.GREEN);
  249. UpBound.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
  250.  
  251. plot DnBound = if GetLastDay() == GetDay() then MidPoint - (DailyAvg / 2) else Double.NaN;
  252. DnBound.SetDefaultColor(Color.RED);
  253. DnBound.SetPaintingStrategy (PaintingStrategy.HORIZONTAL);
  254. 15:43 MTS1: But /CL 'ends' at 14:30 ET right, still considered RTH till 1600? OR 1615? Sorry, still learning lingo.
  255. 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
  256. 15:46 Shizznet: Settlement (“pit”) closes at RegularTradingEnd() for /CL but it’s still tradeable 9:30-3:00
  257. 15:46 Shizznet: If I’m not mistaken.
  258. 15:46 Mobius: MTS.. Your just confusing two different constants
  259. 15:46 MTS1: Thanks
  260. 15:48 Mobius: pdub.. That Calculation fold isn't a fold expression
  261. 15:48 Mobius: in fact none of the first variables are recursive or folds
  262. 15:49 UpTheCreek: why the heck does Payne use index [0]? was it required back in the olden days?
  263. 15:49 Mobius: no Up.. just ignorant
  264. 15:50 Mobius: nothing in fold or recursive has changed other than rec not being needed now
  265. 15:50 Shizznet: lol Mob
  266. 15:50 UpTheCreek: probbly just to wow his followers
  267. 15:50 Mobius: What followers
  268. 15:51 UpTheCreek: readers of his blog/site
  269. 15:51 Shizznet: lmao
  270. 15:51 Mobius: Ah.. Blind leading the Blind
  271. 15:51 UpTheCreek: this is complicated stuff, just let me do it
  272. 16:04 pdub1: usually doesnt get this cold in texas
  273. 16:04 pdub1: 24 right now
  274. 16:05 UpTheCreek: never been to the Panhandle?
  275. 16:05 pdub1: a long time ago i drove through it
  276. 16:05 UpTheCreek: in summer?
  277. 16:06 pdub1: i think so, but the state is huge, so the temp has to vary greatly
  278. 16:08 Shizznet: Seattle broke heat temperatures for winter season yesterday
  279. 16:08 Shizznet: 67 I think
  280. 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?
  281. 16:10 UpTheCreek: u can update that, but there's no need
  282. 16:10 DMonkey: you needto start from scratch....
  283. 16:11 pdub1: did you gents find what is wrong with it to cause it be flaky and not work sometimes?
  284. 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
  285. 16:12 UpTheCreek: yup, serioously flawed
  286. 16:13 pdub1: so since i based my addd scrip of of his UB calculation therin lies the problem?
  287. 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?
  288. 16:16 Mobius: What is your goal
  289. 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
  290. 16:17 DMonkey: tell friend, don't rewrite... start from scratch......tell friend to define goals...
  291. 16:22 fredw: pdub are you trying to use the intraday aid to predict how far a stock might move on any given day?
  292. 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
  293. 16:23 fredw: pdub this is too complicated for me
  294. 16:24 fredw: if you figure it out can you explain it later on
  295. 16:24 fredw: thanks
  296. 16:26 DMonkey: so you something like nesting the daily ATR around the open?
  297. 16:26 Shizznet: So a strategy then
  298. 16:27 UpTheCreek: ATR or ADR, decision time
  299. 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
  300. 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
  301. 16:30 pdub1: at least that is what i want to plot
  302. 16:32 UpTheCreek: so how would u plot today's range?
  303. 16:32 pdub1: um, highesthigh-lowestlow?
  304. 16:32 Shizznet: No señor
  305. 16:33 pdub1: highesthigh, must not mean high of day then
  306. 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
  307. 16:33 UpTheCreek: think daily chart
  308. 16:33 UpTheCreek: it greatly simplifies things
  309. 16:33 Shizznet: Highest(High) is the Highest High within 12 bars default.
  310. 16:34 UpTheCreek: lots of helpers here, I'm gonna go deal with dinner
  311. 16:34 pdub1: but lowestlow does mean the low of the day in intraday
  312. 16:34 pdub1: ok thx UTC
  313. 16:34 Shizznet: No señor
  314. 16:35 pdub1: welp
  315. 16:35 pdub1: hold on manual time
  316. 16:35 pdub1: i made a note to check out keltner channels too btw @mobius
  317. 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
  318. 16:38 Mobius: Fractal Pivots plot the lowest point and highest points in a range of bars
  319. 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
  320. 16:44 fredw: wise man Mobius
  321. 16:44 DMonkey: pdub....decise on calculation....decide what time to start plot....decide how to plot.....
  322. 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
  323. 16:48 Shizznet: I’m High
  324. 16:48 Shizznet: In high
  325. 16:51 pdub1: lulz
  326. 17:09 pdub1: ok,
  327. 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
  328. 17:11 pdub1: so that is not the high of the day, so lets try highest
  329. 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!
  330. 17:14 harndog: https://developer.tdameritrade.com/
  331. 17:15 Jake-Elwood: likely not what u think, Harn dog
  332. 17:15 Shizznet: pdub, while in Editor, look at the inputs for High in Inspector to the right side
  333. 17:15 harndog: If you are accusing me of thinking , your already off track...
  334. 17:15 Jake-Elwood: :0
  335. 17:16 pdub1: what do you mean 'in Inspector'?
  336. 17:17 Shizznet: Reread what I wrote
  337. 17:17 pdub1: i see it
  338. 17:17 pdub1: omg,
  339. 17:18 pdub1: def h = high(period = AggregationPeriod.DAY);
  340. plot line = h;
  341. 17:19 pdub1: THAT is the high of the day ^^
  342. 17:20 pdub1: ok, so we have to define the period we want inside of parenthesis after the high
  343. 17:20 pdub1: can we just put 'day' in parenthesis?
  344. 17:20 pdub1: let me try
  345. 17:21 Shizznet: Si
  346. 17:22 Shizznet: Abuse the use of that Inspector
  347. 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
  348. 17:24 pdub1: so we have this def h = high(period = AggregationPeriod.DAY);
  349. plot line = h;
  350. 17:25 pdub1: i'm ok if thats it for now
  351. 17:25 pdub1: now im gonna def the low
  352. 17:27 fredw: if that's the high you want then go to the next step.
  353. 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?
  354. 17:29 Jake-Elwood: no command on that line
  355. 17:29 Nube: def = !low
  356. 17:29 Stryder008: anyone want an improved RSI or MFI? (50 line and clouds for oversold/overbought zones)
  357. 17:29 Nube: oh, that a "el", sorry
  358. 17:29 fredw: look through tos native indicators. there are daily indicators that you can edit
  359. 17:30 Jake-Elwood: sure Stryder, esp if it'll make me millions
  360. 17:30 Stryder008: well i make no promises of that ;)
  361. 17:30 Jake-Elwood: always hopin'
  362. 17:30 harndog: Ok...500k works
  363. 17:31 harndog: Get the auction process going
  364. 17:31 Stryder008: ok my cut is 20%
  365. 17:31 Stryder008: improved MFI: http://tos.mx/b33fs7#
  366. 17:31 harndog: 2/20
  367. 17:32 Stryder008: improved RSI: http://tos.mx/2gSghx#
  368. 17:32 Stryder008: this is my way of giving back to the community here
  369. 17:32 Nube: I'll give you half of every billion I make
  370. 17:33 UpTheCreek: taking out expenses?
  371. 17:33 Stryder008: a big thanks to Mobius, AlphaInvestor, UpTheCreek, Nube
  372. 17:33 fredw: pdub steel dailyhighlow use it in your code
  373. 17:33 harndog: Thank you and did these scripts have headers?
  374. 17:33 Stryder008: lol Nube
  375. 17:33 Stryder008: i only put a header for the clouds
  376. 17:34 pdub1: look at this shit - def h = high(period = AggregationPeriod.DAY);
  377. plot line = h;
  378. def l = low(period = AggregationPeriod.DAY);
  379. plot linel = l;
  380.  
  381. def ADR = h-l;
  382. addlabel (yes,ADR,color.white);
  383. 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 ;)
  384. 17:35 pdub1: so that answers UTC question of what is todays average daily range - where is he? dammit
  385. 17:36 Stryder008: the RSI has this feature - but i'm still tweaking it
  386. 17:36 Shizznet: What’s next
  387. 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
  388. 17:37 fredw: pdub you are basically rewriting the average true range
  389. 17:37 pdub1: daily adr
  390. 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.
  391. 17:38 fredw: why don't you just edit tos average true range
  392. 17:38 UpTheCreek: fred, the average daily range is NOT the same as the ATR. ATR is more complicated
  393. 17:39 pdub1: i was lookin at what ATR was...
  394. 17:39 pdub1: ya fred its not the same, geez
  395. 17:39 harndog: #StudyName:
  396. #Description:
  397. #Author:
  398. #Requested By:
  399. # Ver Date Auth Change
  400. #
  401. # TOS.mx Link:
  402. # Trading Notes:
  403. 17:40 Stryder008: thanks for the tip, Jake. i will add that.
  404. 17:40 UpTheCreek: they both have their place, depends on what you are trying to do.
  405. 17:40 Stryder008: ty harn
  406. 17:40 harndog: Script of header: http://tos.mx/4Fqwmo#
  407. 17:40 Stryder008: ty
  408. 17:41 harndog: yw.... thank you for kicking back into the room
  409. 17:41 Shizznet: ^
  410. 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
  411. 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
  412. 17:44 Stryder008: it's the least i could do
  413. 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.
  414. 17:45 avshar: could somebody please PB today between 16:45 and 18:26? thank you
  415. 17:45 avshar: that's in CST
  416. 17:45 pdub1: oh no
  417. 17:45 Shizznet: I just got on desktop =\
  418. 17:46 pdub1: we need a late checkout
  419. 17:47 Jake-Elwood: /UF83NL9Q
  420. 17:47 avshar: thank you, Jake
  421. 17:48 pdub1: how would i say total of last 21 ADR's?
  422. 17:48 pdub1: hmmm
  423. 17:48 Shizznet: Sum()
  424. 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
  425. 17:49 pdub1: but i trade on an intraday chart
  426. 17:50 Nube: http://tos.mx/CI9rwH#
  427. 17:50 UpTheCreek: that doesnn't makeit easaier
  428. 17:50 Nube: Updated quote label to include a quote for when gold is on the ticker
  429. 17:50 Nube:
  430. 17:51 Shizznet: omg lol
  431. 17:51 pdub1: ok, so u want me to start again on a daily chart?
  432. 17:51 Shizznet: Such a good way to end the night haha
  433. 17:51 UpTheCreek: lol nube
  434. 17:52 UpTheCreek: yes, when you have it working on the daily, you get a bronze star
  435. 17:53 pdub1: well my plots and label are on the daily chart right now
  436. 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);
  437. 17:53 fredw: gn
  438. 17:53 pdub1: did fred just mic drop us?
  439. 17:54 UpTheCreek: looks that way
  440. 17:54 UpTheCreek: unfortunately for you, you care about ADR
  441. 17:55 pdub1: idk what fred did, imma place it in a study
  442. 17:55 UpTheCreek: double unfortunately, that doesn't solve the intraday problem
  443. 17:57 Shizznet:
  444. #TimeBased_Renko_V2
  445. ## amalia
  446. #Hint: For /Futures products mainly. Renko bars based on the Stretch by Crabel, MinimumValue by Amalia or AverageTrueRange
  447. #Notes: v1 = http://tos.mx/Onm5Wb#
  448. #Looks best when
  449. AssignBackgroundColor(Color.BLACK); #is enabled
  450.  
  451. AddVerticalLine(GetTime() crosses above RegularTradingEnd(GetYYYYMMDD()), "Globex Start", CreateColor(0, 102, 102));
  452. AddVerticalLine(GetTime() crosses above RegularTradingStart(GetYYYYMMDD()), "RTH Start", CreateColor(255, 51, 0));
  453.  
  454. declare hide_on_daily;
  455.  
  456. input showLabels = YES;
  457. input RangeMethod = {default Stretch, Min, ATR};
  458. input RangeLength = 10;
  459. input averageType = AverageType.SIMPLE;
  460. input showClouds = YES;
  461. script R {
  462. input V = 0;
  463. plot R = Round(V/TickSize(),0)*TickSize();
  464. }#TickSize rounding ^
  465. input RangeStart = {default Globex, RTH};
  466. def First;
  467. switch (RangeStart) {
  468. case Globex:
  469. First = if GetTime() crosses above RegularTradingEnd(GetYYYYMMDD()) then 1 else 0;
  470. case RTH:
  471. First = if GetTime() crosses above RegularTradingStart(GetYYYYMMDD()) then 1 else 0;
  472. }
  473.  
  474. def O = Open;
  475. def H = High;
  476. def L = Low;
  477. def bar = BarNumber();
  478. def NA = Double.NaN;
  479. def ORActive = if First==1 then bar else 0;
  480. def Whut = if bar == ORActive then bar else Whut[1];
  481. def Wut = CompoundValue(1, Max(bar, Whut) - Min(bar, Whut), O);
  482.  
  483. #Script The Stretch by T. Crabel and Minimum Value by Amalia or AverageTrueRange
  484. script Vol {
  485. def A = AggregationPeriod.DAY;
  486. input sLength = 10;
  487. input Avg = AverageType.SIMPLE;
  488. def T = TickSize();
  489. def C = close(period = A)[1];
  490. def O = open(period = A)[1];
  491. def L = low(period = A)[1];
  492. def H = high(period = A)[1];
  493.  
  494. #Minimum average of the tail end calculation
  495. plot Min = MovingAverage(Avg, (if C>=O then Min(H-C, O-L) else Min(H-O, C-L)), sLength);
  496.  
  497. #Define "The Stretch" by T. Crabel
  498. plot Stretch = MovingAverage(Avg, Min(H-O, O-L), sLength);
  499.  
  500. #AverageTrueRange
  501. plot ATR = MovingAverage(Avg, TrueRange(high, close, low), sLength);
  502. }
  503.  
  504. def Range;
  505. switch (RangeMethod) {
  506. case Stretch:
  507. Range = Vol("s length" = RangeLength, avg = averageType).Stretch;
  508. case Min:
  509. Range = Vol("s length" = RangeLength, avg = averageType).Min;
  510. case ATR:
  511. Range = Vol("s length" = RangeLength, avg = averageType).ATR;
  512. }
  513.  
  514. def BrickSize = R(Range);
  515. 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];
  516.  
  517. plot Bricks = Mortar;
  518.  
  519. def Stack = if Mortar!=Mortar[1] then Mortar[1] else Stack[1];
  520.  
  521. plot Renko = Stack;
  522.  
  523. #Direction bias
  524. input showArrows = YES;
  525. def ArrUp = if showArrows and H crosses below Min(Bricks, Renko) then H else NA;
  526. def ArrDn = if showArrows and L crosses above Max(Bricks, Renko) then L else NA;
  527. plot Arr_Up = (ArrDn);
  528. plot Arr_Dn = (ArrUp);
  529.  
  530. #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.
  531. input show_Values = YES;
  532. plot RangeValue = if show_Values and H==high(period = "DAY") then R(Range) else NA;
  533. plot StopLossValue = if show_Values and L==Low(period = "DAY") then R(Range*.618) else NA;
  534.  
  535. addLabel(showLabels,
  536. "Range = " + R(Range) + " | " +
  537. "StopLoss = " + R(Range*.618) + " | " +
  538. if Arr_Up then "Buy" else if Arr_Dn then "Sell" else ""
  539. ,Color.GREEN);
  540.  
  541. input alerts = YES;
  542. alert(if alerts and Arr_Up then 1 else 0, "Buy", Alert.ONCE, Sound.CHIMES);
  543. alert(if alerts and Arr_Dn then 1 else 0, "Sell", Alert.ONCE, Sound.CHIMES);
  544.  
  545. AddCloud(if showClouds then Bricks else 0, if showClouds then Renko else 0, Color.GRAY, Color.GRAY);
  546.  
  547. Arr_Up.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
  548. Arr_Dn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
  549. Bricks.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
  550. Renko.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
  551. RangeValue.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
  552. StopLossValue.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
  553. Arr_Up.SetDefaultColor(Color.WHITE);
  554. Arr_Dn.SetDefaultColor(Color.WHITE);
  555. Bricks.SetDefaultColor(Color.GRAY);
  556. Renko.SetDefaultColor(Color.GRAY);
  557.  
  558. #End Code
  559.  
  560.  
  561. 17:57 UpTheCreek: hey nube, it should be 'gentlemen'
  562. 17:58 Nube: Oh duh, it's not a gentleman refers bonds
  563. 17:58 Nube: or prefers them either
  564. 17:58 Nube: thanks for catching that
  565. 17:58 UpTheCreek: shizz, do you know why it's not as simple as sum()???
  566. 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.
  567. 17:59 pdub1: is that for me?
  568. 17:59 Shizznet: Mhm
  569. 17:59 Shizznet: Coding practice that is.
  570. 18:00 Shizznet: NIght
  571. 18:00 admin_bkTOS:
  572. 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
  573. TOS platform questions? email: support@thinkorswim.com
  574. 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