Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------ Tuesday, January 9, 2018 -------
- 02:58 Anonymous so far: sound
- 02:59 Anonymous so far: alerts
- 04:58 marshall2020: Good morning.
- 05:35 marshall2020: DMI System: Does anyone know of or have any advice on the development of a system to scan and or trade with DI+ (DIPlus) and DI- (DIMinus) with particular attention to cross of the + over the - and then the continued increase in the difference between the + and -. Thanks.
- 05:51 Nube: You can reference the study in the scanner. Click add Study Filter.
- 05:54 marshall2020: Nube: Thanks. Yes, I do know that and have used it. I thought I would inquire if anyone knew more sophisticated work done using it.
- 05:55 Nube: Globex might have just stolen today's trade. Time to write a study comparing overnight range to subsequent day.
- 05:57 Nube: By description it doesn't sound like what you're looking for needs much in the way of sophistication. Plus crosses above minus with maybe a sum(di+ > di+[1], 3) ==3
- 05:57 Nube: I don't think those are the correct plot names. Just throwing out an idea there.
- 06:03 marshall2020: Nube: My knowledge if the tosscript language is minimal so bear with my ignorance. Are you suggesting that after the XO, to check on increasing difference between DI+ and DI- by :asking" if today's DI+ is greater that the average value of DI+ over the last 3 days (sum of the last 3 day's DI+/3)?
- 06:05 marshall2020: Sorry I meant : check on the increasing value of D+ over past days DI+...not DI-.
- 06:08 Nube: Thay would be asking if Plus is higher than previous bar each of last 3 bars.
- 06:08 Nube: [1] is one bar ago
- 06:09 Nube: So DI+ >DI+[1] is current reading higher than reading and previous bar.
- 06:09 Nube: Reader *at previous bar
- 06:11 Nube: That will equal 1 if true, 0 if not, so we sum that value at the last 3 bars and that value is how many times it was true. If it equals 3 then it was true all 3 times.
- 06:14 marshall2020: Good. So DI+ >DI+[2] is current (or today's) DI+ is greater than the DI+ of 2 days ago? Yes?
- 06:15 Nube: Yep.
- 06:17 marshall2020: How does this expression sum(di+ > di+[1], 3) ==3 show that the DI+ on each successsive day is higher than the DI+ on the day just before it...DI+ today > DI+ yesterday and DI+ Yesterday > DI+ day before yesterday? How is that written in the tosscript?
- 06:19 marshall2020: Silly question. Now I see that the expression sum(di+ > di+[1], 3) ==3 is not intended to show progressively higer DI+s, just that meet the criteria that current DI+ is higher than the previous 3 days.
- 06:20 Nube: No, it means the value is higher than previous value at each of the last 3 bars.
- 06:20 Nube: So yes, successively higher the previous 3 times
- 06:23 marshall2020: But it would also be true if the last DI+ were higher than the last 3 DI+s and there was no increase between some of the previous days...and what I want to detect is a current DI+ that is increasingly greater than the DI+s of the preceeding d days.
- 06:39 MTS1: Nube; interested in that also about globex patterns based on tweet I saw the other day; this chart with cumulative gains during different time windows was posted by @nenexllc:
- 06:41 1MARKET: Good Morning..... I have this script that will show Percent change
- I would like it to show accumulated Percent throughout the day on a one min chart ,
- how do i fix script
- 06:41 1MARKET: instead of individual
- 06:41 1MARKET: input agg = aggregationPeriod.day;
- def open = open(period=agg);
- def close = close(period=agg);
- def high = high(period=agg);
- def low = low(period=agg);
- def PrevClose = close(period = agg)[1];
- def c = close;
- def c1 = close [1];
- plot closeprice = close-PrevClose;
- plot closePercent = close/PrevClose*100-100;
- closeprice.hide();
- closepercent.hide();
- addlabel (yes, closeprice);
- addlabel (yes, closePercent +"%");
- plot closePercent2 = close/PrevClose*100-100;
- 06:41 1MARKET: see pic
- 06:41 1MARKET:
- 06:42 1MARKET: for each candle it will represent the current percent or the total price of the stock, but keep the current precent at the moment
- 06:42 1MARKET: hope makes sense
- 06:44 1MARKET: current pic shows percent for each cancle, i do not want this, i would like each candle to represent the current percent of daily move, but show percent as price moves
- 06:45 1MARKET: not this
- 06:47 1MARKET: not this, I would like to see how the percent changed throughtout intraday
- 06:52 marshall2020: Seems this is as follows: Today's increase in some value/indicator over yesterday's value of same value/indicator is > yesterday's increase of that value/indicator over its amount the day before yesterday...If plain English representation is what is wanted, perhaps someone can write it in tosscipt for selected / different time periods...unfortunately, I cannot do that yet.
- 07:02 AlphaInvestor: Marshall - I have some advice for scanning and trading a DI+/DI- system - DON'T
- 07:03 DMonkey: 1market...
- def c = close;
- def o = open;
- def Data = if secondsFromTime(0930) == 0
- then o
- else data[1];
- def change = 1 - (data/c);
- plot change2 = round((change)* 100,2);
- change2.setpaintingStrategy(paintingStrategy.VALUES_ABOVE);
- 07:05 DMonkey: Marshall...the syntax nube gave you is correct.....
- 07:08 DMonkey: di > di[1] == increase
- sum(di > di[1],3) >= 3; sums the condition....di has to be greater than di[1] at least three times to make the condition true......
- 07:13 1MARKET: DMonkey thank you, i'm seeing diff results
- example: DFFN current percent shows +40 % but chart shows 4.4
- how to fix
- 07:14 1MARKET: example: INPX percent +4831 chart shows -29.23
- 07:14 1MARKET: +48.31%
- 07:16 marshall2020: AlphaInvestor: Could you share some of your wisdom about why not to trade a DI+/DI- system?
- 07:16 1MARKET: DMONKEY example from script PTIE percent +80.90% chart shows 30.43%
- how to fix
- 07:17 1MARKET: PTIE is halted
- 07:19 DMonkey: expand your mind is the first step......your percent change label on the chart is from yesterdays close/not the open price in the snippet i shared for you......if all you want is to follow the existing chart number change it to close time in the snippet......
- expand your mind....thats the fix.......
- 07:19 AlphaInvestor: Marshall - I have not found it to be a useful indicator for trading, there are much better choices
- 07:20 1MARKET: DMonkey , thank you for your input, i did mess with script to try and fix, i'll review again , thank you again for the input
- 07:20 DMonkey: the script isn't broke.....
- 07:21 AlphaInvestor: In fact, I turn DI+ and DI- off on my charts and leave only ADX up from that set of lines
- 07:23 AlphaInvestor: 11Market - did you use a script to find out that PTIE is halted, if not we are not interested
- 07:27 Nube: 1market, do you want the script to measure today's move or do you want to match the number ToS shows you?
- 07:34 1MARKET: Nube represent today percent move, and each days percent move
- 07:36 1MARKET: example PTIE percent move is not +165% i would like to see percent move for each candle , no total for the day on each candle but how it go there for each candle
- 07:36 1MARKET: each candle will represent current percent for that cancle
- 07:37 1MARKET: Dmoney script plot is good, its not showing current percent move
- 07:37 DMonkey: define current percent move in your words.......
- 07:37 Nube: 1market, how are you verifying that it is not showing the current percent move?
- 07:38 1MARKET: example Highest candle should show highest percent , while current candle should show current percent
- 07:38 DMonkey: highest percent from when?
- 07:38 1MARKET:
- 07:39 1MARKET: percent from yesterdays close
- 07:39 DMonkey: so change to your close time in the snippet
- 07:42 SINGHIZHEM: Hello, someone posted a indicator on here where it displayed the implied move for the day. Would anyone mind re sharing it? Thanks in advance!
- 07:57 1MARKET: Still messing with it to try and show current / correct percent from prev days close
- 08:08 Mobius: 1Market - There's PercentChg TOS native study. Look at it to see how to write what you want
- 08:08 Nube: 1m, try replacing the def of Data in the sample from DMonkey with your prevClose.
- 08:09 Mobius: Then go take a class in rudimentary math because it's disturbing to think someone that has money to trade doesn't know how to calculate a simple percent change
- 08:12 BloodyBloke: Per previous discussion on correlation of pairs, Why wouldnt covariance be the best mathematical description, over co-integration and correlation?
- 08:13 1MARKET: Mobius, LOL, i know how to do a simple %chg,
- 08:14 Mobius: Bloody... Google them.
- 08:14 sten: hey guys
- 08:14 sten: could someone provide me with the script for CCI please
- 08:15 1MARKET: and i did replace or change DATA line still not same results, i will review TOS script
- 08:15 Mobius: sten.. CCI is a TOS native study
- 08:15 sten: yeah i know
- 08:15 sten: need to double check something outside, and need to see exactly how tos calculated it
- 08:16 sten: is there a way i can see that script?
- 08:18 sten: nvm found it
- 08:18 sten: thanks guys!!
- 08:21 sten: what would "LinDiv" be?
- 08:22 DMonkey: http://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Statistical/LinDev.html
- 08:23 sten: thank you, appreciate that
- 08:30 Shizznet: One of those days. Morning room.
- 08:34 DMonkey: Shizz....
- 08:37 Mobius: Price rising and VIX rising - Traders are hedging
- 08:37 marshall2020: AlphaInvestor: Lately, I have been looking at ADX/DI+/DI- and CCI for various times frames to confirm price movement. I have not traded any of the "systems" I have considered and will do further testing. I like the DMI approach b/ as i understad it it reflects the relative power of buyers versus sellers. In the past of have used many many technical systems and like most things when they work they work and when they don't work they don't work. The old MACD, RSI, stochastic approaches just do not work well for me and do nto let me peer into the minds of the buyers and sellers as do the DMI...I think. Looking at highly selected stocks, at the present time, the ADX, DI+/DI- approach seems quite promising as a tool to put the odds in my favor. What say you?
- 08:38 AlphaInvestor: lose the bold
- 08:38 DMonkey: if it works for you...it works for you....
- 08:38 Shizznet: ^Thats a better reply.
- 08:39 bigworm: hey guys
- 08:39 Shizznet: Morning
- 08:39 bigworm: anything exciting today
- 08:39 AlphaInvestor: I find the DI+/DI- crossovers, which is what Marshall was trying to build are not indicative of anything. Reviewing a chart of those crosses does not show me any buy or sell points ... just my opinion
- 08:41 BloodyBloke: Mobi, I did google them, just wanted some discussion on them.
- 08:42 Mobius: ADX - DI+ and DI- are Just another way of looking at linearity or price expansion and contraction.
- 08:42 DMonkey: Big....corn seems exciting today......It received the farmers almanac award for outstanding in it's field
- 08:43 bigworm: mmmmm corn
- 08:43 Mobius: Bloody.. your question indicates to me a basic lack of understanding the use of the three indicators.
- 08:45 Mobius: Simply put - cointegration shows the stability of a pair. It doesn't replace or negate the other two
- 08:46 AlphaInvestor: Don't get me wrong - I love ADX ... it is one of my Go-To indicators
- 08:47 Mobius: ADX is an Alabama Indicator - "Already Done Crossed"
- 08:48 marshall2020: Sorry for the bold. Seems it want to go on almost automtically...not sure why. I will keep it in check.
- 08:49 Shizznet: lol
- 08:50 AlphaInvestor: I use ADX for strength of trend, nothing more
- 08:51 marshall2020: Consider looking at DI+ and DI- in multiple time frames in stocks that are in an uptrend and, perhaps, you will see what I see in the tea leaves. Yes, I agree that the ADX is a nice indicator of trend strength.
- 08:52 marshall2020: Shizznet: See, I did not put the last entry in bold.
- 08:52 AlphaInvestor: Thanks Marshall for killing the bold
- 08:53 Shizznet: Mhm
- 08:53 Nube: Marshall, first thing I would suggest is going to 2013 - 2015 and checking your ideas then. IF they hold up, then it might be worth pursuing. If it's worked in the last 24 months, it's not likely to nearly as good in the next 24
- 08:54 Shizznet: Good point
- 08:55 BloodyBloke: yes, yu r correct Mobi, I dont see how the stability of a pair would not have a lot to do with the pair correlation or cointegration
- 08:56 DMonkey: but the stability of the pair has a lot to do with making or losing money on the trade.....
- 08:56 BloodyBloke: I would love to see a chart of them all 3
- 08:57 BloodyBloke: to compare them
- 08:57 inbuffalo: AI DMI and ADX has to be good, think that is what the JC 10x indicator is based upon :)
- 08:58 marshall2020: I agree that is a good observation. I will do that and let you all know what I find.
- 08:58 Nube: Making money on a trade. Now I've heard it all.
- 08:58 Shizznet: lol
- 08:59 Shizznet: New ATH /YM
- 08:59 AlphaInvestor: inBuffalo - hey fellow Canadian, I haven't seen you are around a lot lately
- 09:00 AlphaInvestor: Shizz - did you use a thinkScript study to determine that, if not ... trading discusisons to another chat room
- 09:01 marshall2020: What I am really interested in is the quantification of the differences between successive DI+s and between successive DI-s and in the successive difference between DI+-Di-.
- 09:02 1MARKET: i'm getting nauseated hearing all this talk about indicators, any indicator can be manipulated to make it look good, follow price action / volume - I've studied all indicators they all pretty much follow the same criteria / principle on any timeframe - if u don't believe test yourself
- 09:03 inbuffalo: AI been working at lot out of town home for a bit
- 09:03 BloodyBloke: Indicators are simply different ways of looking at price. Its personal preference
- 09:04 AlphaInvestor: ^^ or volume
- 09:07 Nube: You won't be seeing that once I introduced my Latest Greatest New and Improved Indicator
- 09:10 1MARKET: the Grand Daddy of all indicators
- 09:11 Nube: I'm going to trademark that name before someone else uses it.
- 09:12 AlphaInvestor: didn't you already trademark your snake oil company?
- 09:15 Shizznet: Close==High is the script I used. Just putting it out there for whoever finds use for it.
- 09:16 AlphaInvestor: wouldn't it be Close == highestall(high)
- 09:17 Shizznet: More than one way to skin a cat
- 09:17 JohnGalt82: Hi all. Getting the "only constants expected" error. Is there a workaround for this?
- def barn = barnumber();
- def numb = HighestAll(barn);
- def highs = highest(close,numb - barn);
- 09:20 DMonkey: what are you trying to do john?
- 09:20 Nube: Highest(close, variable not allowed here) unfortunately
- 09:20 Nube: It would make things a lot simpler.
- 09:21 JohnGalt82: I want to identify highs starting from the current data point working backwards. so thought the highest() statement could easily achieve that
- 09:23 DMonkey: input n = 100;
- def Data = highest(high,n);
- will retrieve the highest high in the last 100 bars......
- 09:23 JohnGalt82: ya i want to do the opposite of this basically. this line plots higher highs moving fwd. i want to plot them going bacwards
- rec highs = if isnan(high[1]) then double.nan else if high > highs[1] then high else highs[1];
- 09:25 Shizznet: GL. I feel ya, jg. I tried the same with InertiaAll() to no avail.
- 09:26 DMonkey: i dont understand...
- 09:27 AlphaInvestor: Sounds like the perfect application of a FOLD ... maybe with GetValue
- 09:29 JohnGalt82: tried playing with fold to no avail. imagine a line drawn from the current point that moves left across the chart going to higher highs as it moves back in time. thats what i'm after
- 09:29 JohnGalt82: my attempt
- def highs = fold i = 1 to numb do if getvalue(high,numb-i) > getvalue(high,numb-i+1) then getvalue(high,numb-i) else getvalue(high,numb-i+1);
- 09:30 Shizznet: 3 bars after RTH closes, I want InertialAll length to be 3 and plot. After 5 bars, I want length to be 5 and the plot will show how diff it was after 3 bars and 5. Just an example but have it continue like that until next secondsfromtime or whatever.
- 09:31 Shizznet: Welp. There’s 2 diff explanations. lol
- 09:31 JohnGalt82: shiz can you just hardcode a tone of variables? inertia1 inertai2 etc. use excel to build up the code easily
- 09:35 Shizznet: If I liked excel or knew how to use it
- 09:35 AlphaInvestor: John - by "a ton" you mean less than or equal to 19 variables ... right
- 09:39 JohnGalt82: i have code with like 100 variables
- 09:40 AlphaInvestor: and how many can you read in Excel via RTD?
- 09:41 JohnGalt82: no no i meant just using excel to build the code. eg
- def bar1volume = if istoday then 0 else if barcounter == 1 then volume else 0;
- def bar2volume = if istoday then 0 else if barcounter == 2 then volume else 0;
- def bar3volume = if istoday then 0 else if barcounter == 3 then volume else 0;
- 09:45 Mobius: getValue() is the function used to index a value from the past
- 09:46 Mobius: The only function you can use with a floating variable
- 09:46 Mobius: getValue(close, conditionalVariable)
- 09:46 JohnGalt82: roger. i'll keep playing with fold but not sure what i want is doable in TOS
- 09:47 Mobius: it is I've done it
- 09:47 Shizznet: oh?
- 09:47 JohnGalt82: oh really? anything u can share?
- 09:47 Shizznet: -_-
- 09:47 Mobius: nope.. This is your learning curve
- 09:47 Shizznet: Have a good weekend everyone.
- 09:48 Tb8: I would like to paint this histogram some color if it closed lower than it opened. Also if /RTY closed up but it closed down (compared to a prior day), I would like to mark it somehow, maybe with a dot. Would somebody please tell me how to do that? Thank you.
- declare lower;
- def Data = close("$ADRLD");
- plot data1 = Data;
- data1.setpaintingStrategy(paintingStrategy.HISTOGRAM);
- plot zero = 0;
- 09:49 Mobius: john.. Think in terms of getting your first X axis position and plotting from there forward. Not in terms of using the current bar as your first X axis position and going backward. Ultimately the plot is identical and the sequence is easier to think through.
- 09:50 JohnGalt82: k ty will ponder that
- 09:52 Mobius: john.. this is your sequence
- Cond1 = ?
- Cond1_bar = ?
- Cond2 = ?
- Cond2_Bar = ?
- With those 4 conditions you can plot a line anywhere at any angle on a chart
- 09:55 Nube: I love it when school is in session. We don't need no steenking Mr Script.
- 09:56 fox_technicals: Mobius - Trying to learn from this as well out of curiosity. I've gotten my two cond's x and y values would I then need to use the fold function to connect them?
- 09:57 Nube: Also, if I am roughing out the logic correctly, fold is unnecessary, correct?
- 09:58 Mobius: no fox.. if you have the conditions and their associated bars then you just need a plot expression that links them
- plot = if bar == cond1_bar then cond1 else if bar == cond2_bar then cond2 else double.nan
- 09:58 Nube: Fox, I've found enableapproximation lifesaving for thay purpose.
- 09:58 Mobius: and EnableApproximation which allows the plot to ignore everything between
- 10:00 Mobius: you can write a slope variable and use that instead of Enable
- 10:00 Mobius: Appoximation
- 10:00 Mobius: More trouble and only needed if your plot needs to be into the expansion area
- 10:01 fox_technicals: Interesting. I've noticed that logic on a lot of scripts I've gotten from you like the conditional channel and overnight high / low
- 10:02 Mobius: I use NotePad++ with code snippets wherever possible. So you will see the same variable structure used in a lot of my stuff
- 10:03 Mobius: No reason to change what works
- 10:03 fox_technicals: I actually like that a lot though it helps me learn lol
- 10:04 fox_technicals: So basically you'd be looking at a logic similar to def cond = if high == highest(high, 20) then 1 else 0;
- def condbar = if cond then barnumber() else double.nan;
- def condition = if barnumber() == condbar then HighestAll(condbar) else condition[1];
- plot derp = condition;
- 10:04 fox_technicals: and then doing it again for the other cond
- 10:04 Nube: I've done the same thing. I have some snippets in ++ and I've basically stolen all of the logic I use from Mobius and then reuse it.
- 10:05 AlphaInvestor: Nube - in the profession it is called "code reuse"
- 10:06 Nube: For example, if condition then bn else variable[1] just can't be improved. Why mess with anything else
- 10:07 Nube: I'm more of the romantic type who likes excitement and daring do, so I steal things.
- 10:07 Mobius: better to use absolutes for finding X. Y coordinates
- def cond = if high == highest(high, 20) then 1 else double.nan;
- def condbar = if !isNaN(cond) then barnumber() else double.nan;
- plot = if barNumber() == HighestAll(condbar) then .........
- 10:07 BloodyBloke: This is the equation I find for covarience. Can anyone make it into a TOS script? How hard is it to do? Theorem.�For any random variables�X�and�Y�(discrete or continuous!) with means�X�and�Y, the covariance of�X�and�Y�can be calculated as:Cov(X,Y)=E(XY)XY
- 10:08 fox_technicals: So a code snippet is essentially a "subroutine"?
- 10:08 Shizznet: huh?
- 10:08 Mobius: fox - yes
- 10:08 BloodyBloke: Sorry, this is better; Theorem.For any random variablesXandY(discrete or continuous!) with meansXandY, the covariance ofXandYcan be calculated as:Cov(X,Y)=E(XY)XY
- 10:09 Mobius: well much of the time but a snippet can be anything you use a lot
- 10:09 fox_technicals: Slowly these cogs in my mind are going lol
- 10:09 Shizznet: omh BloodyBloke
- 10:09 Shizznet: BloodyBloke, exit and re-enter the room please.
- 10:10 BloodyBloke: X is one stock symbol and Y is the other
- 10:10 Mobius: snippets are just code blocks you save then use.
- 10:10 Mobius: Bloody.. your copy and paste is FUBAR.
- 10:11 Shizznet: BloodyBloke, please exit and re-enter the room.
- 10:12 BloodyBloke: Hang on
- 10:13 fox_technicals: Wait Mobius would the "then..." statement you wrote be followed by HighestAll(if !IsNaN(cond2) then cond2bar else double.nan) !?
- 10:13 BloodyBloke: ok, best I can do
- 10:14 Mobius: the HighestAll() uses just the highest bar in the sequence. So the plot is limited to a single X axis point
- 10:15 fox_technicals: Soooo....50% right then lol
- 10:18 AlphaInvestor: Bloody - keep looking - there are formulas linking Covariance and Correlation
- 10:20 BloodyBloke: wow, OK ty
- 10:20 AlphaInvestor: using Standard Deviation of both variables
- 10:21 Mobius: Bloody- Yes. Covariance, Correlation and Beta are all used to help determine Cointegration.
- When trading pairs you want to know if a pair is in a stable relationship since your trading back to a mean in that relationship. If the relationship is stable it is stable in a set of boundaries. Know what those bounds are helps you decide to trade or not. Outside the normal distribution is a signal the pair may be breaking down. Inside the bonds and your confidence can be high that the pair will revert to the mean
- 10:22 Mobius: And like Forrest Gump - "That's all I have to say about that."
- 10:23 Mobius: Not trading for the math code challenged.
- 10:25 Mobius: Market is going into "Irrational Exuberance" Speed.
- 10:37 Nube: I'll have what the market is having
- 10:38 Nube: Qs doubletopped 10 minutes ago, time to get the double top scans ready for passers through
- 10:47 FrankB3: Mobius:: I know nothing in buying or selling pairs:: I noticed that on certain dates on the daily SPX::: you could almost buy anything and make money. Would knowing these dates give you a advantage in trading pairs??? i.e. ::: 12/1, 11/15, 10/26, 9/7, 8/21, 8/11 ...
- 10:47 michael0093: good afternoon everyone. I was bouncing around in here yesterday asking about chaning the background color of a custom cell in a watchlist and honestly I'm lost tryng to script this. If anyone could assist witht he script I would be very greatful....
- 10:49 michael0093: in the custom cell I opened the condition wizard and loaded a condition I wrote, if its tue with in 3 bars. so the result of the cell is either 0, false or 1 true. I would like to be able to change the bakcground color of the cell that is tue, or 1
- 10:51 Shizznet: AssignBackgroundColor() functions works great for that, michael.
- 10:52 Eddie7: Anyone here trading MJX, (weed etf). It is moving around a lot, any news??
- 10:52 michael0093: Hi Shizznet, but I am unable to script this. I somehow negate my condition when I try to put script in the thinkskript section. this is what's in there now, I wrote a custom candle stick study called dropreversal
- DropReversal() is true within 3 bars
- 10:53 Mobius: Michael
- AssignBackgroundColor(if cond then color.green else color.current)
- 10:54 Tb8: Mobius: How do I Paint this histogram if it closes down for the day, red, green if up? Thank you.
- declare lower;
- def Data = close("$ADRLD");
- plot data1 = Data;
- data1.setpaintingStrategy(paintingStrategy.HISTOGRAM);
- plot zero = 0;
- 10:55 BloodyBloke: Frank, might be a way to leg into a pair trade...
- 10:55 michael0093: Hi Mobius! thank you for this. this is the content of my editor window
- DropReversal() is true within 3 bars;
- AssignBackgroundColor(if cond then color.green else color.current)
- how would I put my condition into this??
- 10:55 Shizznet: Tb8,
- Data.AssignValueColor();
- would work for you.
- 10:55 Mobius: plot DR = if DropReversal() then 1 else 0;
- AssignBackgroundColor(if DR then color.green else color.current);
- 10:56 Mobius: Bloody.. You never ever ever leg into a pairs trade.
- 10:56 Mobius: In fact traders go to great lengths to enter the pair at the ask and exit at the bid so as NOT to leg in
- 10:57 Nube: Tb8, for painting a histogram, check the stock MACD for an example.
- 10:57 Mobius: Frank.. Pairs trading is Market neutral. So what the braoder market is doing isn't a concern within reason
- 10:57 michael0093: OMG Mobius!!! thank you man! it worked!!! thank you so much!
- 10:58 Nube: I've stolen that logic to paint to about every histogram plot.
- 10:58 Mobius: yw michael
- 10:58 Shizznet: CES and what was the other one?
- 10:59 Shizznet: XL...?
- 11:01 Mobius: CMS-XEL is a well known pair
- 11:01 Tb8: Nube: Tahnk you. I've, but I cannot seem to figure it out. I would like to paint green if it the close >open, but not compared to the prior day, to the current day's open.
- 11:01 Mobius: Although it is breaking down now. Too crowded likely
- 11:03 Mobius: There was an entry signal this morning on CMS-XEL with the pair trading share for share
- 11:13 michael0093: Mobius.... um question... the code you gave me turned into this
- script DropReversal {
- # Generation time: 2018-01-07T21:50:44.572Z
- def IsUp = close > open;
- def IsDown = close < open;
- def IsDoji = IsDoji();
- def avgRange = 0.05 * Average(high - low, 20);
- plot PatternPlot =
- IsDown[2] and
- IsDown[1] and
- IsUp[0] and
- high[1] < close[0];
- PatternPlot.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
- PatternPlot.SetDefaultColor(GetColor(4));
- }
- plot DR = if DropReversal() then 1 else 0;
- AssignBackgroundColor(if DR then Color.GREEN else Color.CURRENT);
- is this the same thing???
- 11:14 Mobius: it's your code. Don't you recognize it
- 11:15 michael0093: well this is what you gave me but it turned into this after I closed the editor.
- plot DR = if DropReversal() then 1 else 0;
- AssignBackgroundColor(if DR then color.green else color.current);
- 11:16 Mobius: Dropreversal() is a reference to Your Code
- 11:16 michael0093: Oh its putting the dropreversal into script language...
- 11:16 Mobius: yep
- 11:17 michael0093: lol you can see how scripting iliterate i am!!! haha
- 11:17 Mobius: everyone starts
- 11:18 michael0093: one other queston... I have the original set to a 5min chart. is that lost in this translation?
- 11:18 Mobius: no set the watchlist column to 5 min
- 11:18 inbuffalo: Mobius - do you use TOS to find pair candidates or use outside calculations in spreadsheets, or quant opian or something else?
- 11:18 michael0093: Ok wait I see its still set to 5min at the top of the editor window. lol.
- 11:20 michael0093: Mobius is the within 3 bars included in the code here???
- 11:21 Nube: Tb8, plotname.assignvaluecolor(if open > close then color.downtick else color.uptick);
- 11:23 Mobius: inbuff.. I don't use TOS for pairs trading. And if you look into quantopian the only folks making money with that are the platform owners
- 11:23 Mobius: michael - no within 3 bars is not in the code
- 11:24 michael0093: Mobius sorry to ask you again.. but how can it be added???
- 11:25 Mobius: michael.. What line of code is used to trigger the background color change?
- 11:25 michael0093: if the condition is true I want the change in color
- 11:27 gogators: Is there a way to export the price history and indicator data from a chart to Excel?
- 11:27 inbuffalo: thanks about quant
- 11:31 Nube: Maybe I could learn whatever language that is and then bog their servers down with copies all the MTF requests that come here.
- 11:31 Mobius: gogators - TOS supports RTD if that's what your asking
- 11:34 Shizznet: lol Nube.
- 11:34 beergas: plots are so challenging when keep changing The largest prime number ever discovered is 23 million digits long
- 11:35 michael0093: Hi Mobius, Um any further help with that "within 3bars" thing? with the script code its only showing me the current bar
- 11:35 beergas: Law of Ever Larger Numbers?
- 11:35 Mobius: michael.. Which line of code is the background color using?
- 11:36 Tb8: Nube: Thank you, but it doesn't seem to work based on the daily open vs close. For example, on 1/4/18 it closed much lower than the open, but the histogram bar is green.
- 11:36 michael0093: Mobius is this a test or do I need to look at the code and tell you?? lol
- 11:36 gogators: @Mobius, I wanted to download the historical data (daily open/close/high/low) etc to do some statistical analysis
- 11:37 Mobius: gogators - TOS is free data and they don't let you export it. You can buy data from many different sources
- 11:37 gogators: @Mobius. Thanks, I will look into it.
- 11:38 Mobius: Imagine TOS letting everyone have their data for a minimal funded account.
- 11:38 Nube: Tb8, which security you looking at?
- 11:38 Tb8: Nube: $ADRLD
- 11:39 michael0093: Mobius I'm guessign her but I think this is the conditional line of the code
- plot DR = if DropReversal() then 1 else 0;
- 11:39 Tb8: Nube: For example, 1/418 and 1/5/18, $ADRLD closed below the open but both histogram bars are green
- 11:40 Mobius: yes - so where to you add the within 3 bars?
- 11:40 Nube: Oh, open and close will use data from the ticker in the ticker box
- 11:40 michael0093: after the wording dropreversal()...
- 11:41 Mobius: give it a try michael
- 11:41 michael0093: what is the appropriate syntax thought "within 3"???
- 11:41 Nube: You want to override that, I assume. Open("$ADRLD") and close("$ADRLD")
- 11:42 Mobius: look it up in the manual michael
- 11:42 RayK: Hi. My buffer is missing from 12:47 to 13:03 EDT. Can someone please PB it to me? Thanks in advance.
- 11:43 Mobius: Ray.. That was when the aliens abducted everyone on TOS
- 11:44 RayK: Tough luck for me, I guess :) Since my AutoTransport switch was not on, I missed the migration. Sigh.
- 11:44 michael0093: i see the word "within" is used in thinkscript
- 11:45 Mobius: michael - http://tlc.thinkorswim.com/center/reference/thinkScript/Reserved-Words/within.html
- 11:45 Shizznet: if DropReversal() is true within 3 bars then 1 else 0
- 11:46 MTS1: RayK, I'm missing yesterday 13:56-14:46 CT; can you PB Back?
- 11:46 Mobius: There ya go - A Fish
- 11:46 RayK: MTS1 - stand by...
- 11:46 Mobius: can I sit
- 11:46 RayK: Yes
- 11:46 Mobius: ty
- 11:47 MTS1: Ray; HY1e4LUu
- 11:48 michael0093: Mobius and Shizznet thank you for the help. I am off to try it out and to read on the manual link. thank you guys.
- 11:49 Shizznet: -_- yw
- 11:49 Tb8: Nube: Thank you very much, that worked. Besides color is there a way to put a dot or any other marker on a histogram bar? So for example, if RTY closed up but the histogram bar is red (it closed down vs the day's open) then there would be any kind of marker on the bar?
- 11:49 AlphaInvestor: Mobius - Fish +1, Fisherman +0
- 11:49 AlphaInvestor: although Michaeal has made huge progress today
- 11:49 Shizznet: It was taking the buffer. my bad
- 11:50 RayK: MTS1 - here it is. Not much there. /6Up8LLXq
- 11:50 RayK: MTS1 - thanks!
- 11:52 michael0093: hey guys I just want to mention one thing Im noticing.
- if I run the original condition with out script next to a colum with the script in it... the results are different. the cells should have the same result minus the script having the color change....
- 11:54 Shizznet: Here's all of today's chat up until 11:50PST:
- /FCXEm3fj
- 11:55 RayK: Shizznet - Thanks!
- 11:56 Shizznet: I think the funniest thing to happen was Nube thanking the admins for longer hours and then chat was closed for the night after that comment. lol I was cracking up bymyself w no one who'd understand the irony. lol
- 11:56 Shizznet: yw RayK.
- 11:57 Mobius: michael no - the result in the background color change script is 1 or 0
- 11:59 Mobius: We've been down the road many times with TDA about the use of this particular window after hours. They keep it open for a while then close it again. Makes me tired.
- 12:00 beergas: The weekly RSI, closed Friday at 85.27 -- highest since Jan. 1959. monthly RSI ended last week at 86.07, > every month-end reading since June 1996
- 12:01 Mobius: yeah - On a rocket to nowhere
- 12:01 beergas: S&P Index that is specific, yes.
- 12:02 Mobius: I'm thinking of selling everything and retiring. I'm too old to go through another massive correction
- 12:02 beergas: ps that new (only 50th Prime) is a 23mb plain text download.
- 12:03 Mobius: pay the taxes and be done with it
- 12:03 beergas: kids' education will enjoy that
- 12:03 Mobius: lol kids been out of school for years
- 12:04 Mobius: beer my youngest is nearing 40 and has his own college tuition to pay for
- 12:04 beergas: kids in general not specific I fig you could fund pubic ed for a year
- 12:05 beergas: like we need more STEM as it is....
- 12:05 beergas: give me a Red Sparrow when I need one & I'm happy to pay piper
- 12:06 beergas: 14:49 AlphaInvestor: Mobius - Fish +1, Fisherman +0 +1
- 12:09 beergas: utilites -7% while healthcare +.85% retirement begins
- 12:10 MTS1: what about the 'kids' in this room; we'd surely miss the wize Mobius;)
- 12:10 AlphaInvestor: While he may sell most of his portfolio, Mobius would be unlikely to give up entirely ... he enjoys it too much
- 12:11 beergas: hmm Maybe the tax cuts are a way to encouage Boomers to cast out?
- 12:11 michael0093: Mobius the shouldnt the results be identical from a watchlist result expect the script cell would change color and the condition version cell would just show 1 or 0.
- 12:12 Nube: Tb8, sure you can do that. You would have two conditions, if both are true then it plots, otherwise it plots nothing. Just need to define both conditions.
- 12:12 Mackenzie: Mobius: The strategy you helped me with the other day,or for any other strategy, how do I make it ext (Buy-to-close) after a certain number of ticks instead of using the Buy-to-close from an indicator?
- 12:13 Tb8: Nube: What would it plot or dot? But in any case, would you please show me how to do that? I have no idea how to do something like that.
- 12:15 growex: hi everyone.
- 12:15 growex: i have a lil joke
- 12:15 Joebone87: good afternoon growex
- 12:15 growex: here it is
- 12:15 Tb8: Nube: I still want to plot the way it plots now, I mean the colors, but in addition, I would like to have a dot or some kind of marker indicating that there is a divergence between the histogram and RTY's daily close
- 12:16 Nube: Tb8, you will be creating an additional plot, it won't mess with what you have now
- 12:16 growex: declare lower;
- plot vol = sum(high,20)-sum(low,20);
- 12:17 growex: put it on eueusd m15
- 12:17 michael0093: Mobius.. I just want you to know... I fkd up... in my condition cell I forgot to change the time from to 5 min and had it on D. that is why the script version did not match the condition version. LOL. sorry.
- 12:17 growex: eurusd m15
- 12:17 Nube: You know how to define whether $ADRLD closed up or down and our first attempt showed how to define it the ticker on the chart closed up or down
- 12:19 Joebone87: looking now growex
- 12:20 Tb8: Nube: I think I get it, I'll try to do it now.
- 12:20 Joebone87: on EUR/USD 15 min?
- 12:20 growex: yes
- 12:21 Shizznet: .01164 growex
- 12:22 Joebone87: a joke huh?
- 12:22 Joebone87: lol... feel like the kid in the room watching a complex movie....what did i miss
- 12:23 growex: yes. are you seing sinusoidal curve?
- 12:23 Joebone87: yeah
- 12:23 Joebone87: its def sine
- 12:23 Joebone87: oscilating
- 12:24 AlphaInvestor: Growex - long time no see
- 12:24 beergas: didn't do anything for me rather stay w/ GILD
- 12:24 growex: Hi AlphaInvestor god to see you
- 12:24 UpTheCreek: yes, been a while, how are you?
- 12:25 beergas: oscillators don't grab me
- 12:25 Shizznet: He's been coming up w that joke since he left the last time
- 12:25 Shizznet: jk lol
- 12:25 beergas: sad when it starts to go ain't it
- 12:27 growex: to be seruious.....i was trying to code several volatility estimators....there were fancy names like Yang_Zhang_vol, or Parkinson to name atwo of them....
- 12:28 Joebone87: ohh ok
- 12:28 Joebone87: and this is a "fancy"measure of vol?
- 12:29 beergas: "math is no laughing matter" to be seruious
- 12:31 growex: beergas...there were alot of code to calculate some of those formulas..but...this one string shows very very similar...i even say identical curve
- 12:32 growex: it is interesting to see this with dynamic window length
- 12:33 beergas: Dave Rosenberg expect a year where volatility re-emerges as an investable theme, after spending much of 2017 so dormant that you have to go back to the mid-1960s to find the last annual period of such an eerie calm -- look for some mean reversion on this file in the coming year.
- 12:33 beergas: growex perhaps but curve's ying/yang didn't wag my tail
- 12:34 beergas: EUR/USD hard trade as it is, too popular to gain an edge
- 12:35 beergas: rather find a GILD in am & ride till....
- 12:38 Tb8: Nube: I have this, but something is not right, because it plotted the signal on every bar
- def signal = close ("$ADRLD") > open ("$ADRLD") and close ("/RTY") > open ("/RTY");
- plot SignalUp = signal;
- SignalUp.SetDefaultColor(Color.GREEN);
- SignalUp.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
- 12:39 Nube: Try it with an if/then
- 12:40 Shizznet: CompoundValue and IsNaN it
- 12:40 Nube: You know your if, then is going to be where you want to the plot to be.
- 12:41 Nube: And you know you want the plot to be at whatever the histogram is when all the stuff after the if is true, so you know your then.
- 12:42 Tb8: Like this? Doesn't seem to work.
- def signal = f close ("$ADRLD") > open ("$ADRLD") and close ("/RTY") > open ("/RTY") then plot SignalUp else double.NaN;
- 12:43 Nube: Whats the value of singleup?
- 12:43 Nube: After then is the value you want to plot at.
- 12:44 Tb8: Oh, let me try again.
- 12:45 Tb8: If the condition then I want to plot an arrow
- 12:46 Nube: Too soon for the arrow, you do that with the painting strategy.
- 12:47 Nube: If condition then value
- 12:47 Nube: You need to tell it where to put the plot. You decide what type of plot later.
- 12:48 Tb8: But what is the value? If the condition is true, I want to plot an arrow. Sorry, I don't get it
- 12:49 Nube: You need to tell it WHERE to plot that arrow
- 12:50 Nube: Where is a number, a value.
- 12:51 Nube: You are probably overtbinking it. You already have that value defined elsewhere.
- 12:51 Tb8: Histogram? How do I choose between the histogram and the price plot?
- 12:54 Nube: You if it's on the lower study then you for sure don't want the price plot
- 12:55 Nube: You want it to plot on histogram, correct?
- 12:55 Mobius: Put the histogram on the top. Your sure to see it then
- 12:56 Tb8: Nube: Yes, but I also would like to have it on the price.
- 12:56 Tb8: then data1?
- 12:57 Nube: You will need two studies to put it on both the price chart and a lower study. Let's complete the lower first
- 12:58 Nube: Tb8, is that the name of histogram?
- 12:58 Tb8: Yes, I think I did it
- 12:58 Nube: More correctly, the name of the plot that is painting as a histogram.
- 12:59 Tb8: def signal = if close ("$ADRLD") > open ("$ADRLD") and close ("/RTY") > open ("/RTY") then data1 else Double.NaN;
- plot SignalUp = signal;
- SignalUp.SetDefaultColor(Color.GREEN);
- SignalUp.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
- 12:59 Tb8: How do I also put it on the price?
- 13:01 Nube: Make another study, replace the value you have it plotting at now with the value you want it plotted at on the upper.
- 13:02 Nube: Be sure to not put declare lower on the new one
- 13:03 beergas: in case run brand (common). NVIDIA's new GeForce 390.65 drivers patch Spectre problems, optimized for Fortnite and more.
- 13:03 beergas: Nube haven't tried but if put declare upper; while in Lower work for testing?
- 13:03 Tb8: Nube: Thank you very much for your help! I'll work on the upper study.
- 13:07 Nube: yw, Tb8.
- 13:08 dstockhunter: can anyone please paste script to plot opening range candle, 5min,10 min etc....
- 13:09 SudhirSS: Is there any script to plot automatic trendlines?
- 13:10 Buzza: Where is the Mr Script thing that was just announced?
- 13:10 JMC: Here in 10 min
- 13:10 Buzza: Thanks @JMC
- 13:11 Nube: Be sure not to miss Mr. Scripts biannual Lesson in the Lounge©
- 13:12 Shizznet: 1
- 13:16 bigmike: I know this is the wrong place to ask, but does anyone know if TDA has the crb raw index?
- 13:17 AlphaInvestor: BigMike - TOS has a all the FRED data, this is one of the series
- Index of Spot Market Prices of 16 Raw Industrial Commodities for United States
- 13:17 FrankB3: The reclusive Mr. Scripts may be on trader TV.... and that , fine folks, is the my scripting ability
- 13:17 AlphaInvestor: Is that what you are looking for?
- 13:18 bigmike: CRB raw index
- 13:18 bigmike: sorry. lol
- 13:18 bigmike: Let me see
- 13:20 bigmike: I believe that is it.
- 13:21 gentlejohn: Mr Script where are you?
- 13:21 mark6061: he's on tdameritradenetwork.com
- 13:21 FrankB3: Mr. Scritps is talking to his clone on Trader_TV
- 13:23 bbxriderx: has anybody tried doing custom scans on option symbols? eg, .BA180112C237.5?
- 13:23 AlphaInvestor: BigMike - that is 16 raw commodities, the CRB index is 22 commodities
- 13:25 bbxriderx: nothing seems to work even this simple one : def ask = close(priceType = "ASK");
- def bid = close(priceType = "BID");
- plot scan;
- scan = ask > .10;
- 13:25 Nube: In that case just multiple it by 14/8
- 13:26 bigmike: so that's a no on the crb raw?
- 13:27 AlphaInvestor: I don't see Mr.Script anywhere, I looked in all the usual places - Trader TV, Tdameritradenetwork ...
- 13:29 Av84fun: So is this Mr. Script @ 3:20 CT happening?
- 13:29 Mobius: bbx.. Bid and Ask are not available in scans
- 13:30 FrankB3: AI:: just missed him,,, I think he done a quick drive by
- 13:30 stevie_s: @AV8: evidently not. We've been abandoned by the Godhead. Left to waste away.
- 13:30 AlphaInvestor: BigMkke - there are 10 pages of FRED commodity data, each with about 25 indicators ... I ain't gunna look thru all of them for you - sorry
- 13:31 stevie_s: All dressed up and no place to go, we are .... : - (
- 13:31 bbxriderx: ahh, ok thks mobius, is there a list anywhere what is available in scans vs plots?
- 13:31 bigmike: where are you finding this
- 13:31 AlphaInvestor: Analyze - Economic Data - Home
- 13:32 bigmike: thanks for the help Alpha
- 13:32 AlphaInvestor: Here comes David
- 13:32 stevie_s: Oops .... life on a lifeless planet has been discovered.
- 13:32 AlphaInvestor: Loud and Clear David
- 13:32 gentlejohn: Mr Script has abandoned us again!
- 13:33 fifotrader: yes
- 13:33 Av84fun: ok great, read dis
- 13:33 AlphaInvestor: Disclaimers - I luv discclaimers
- 13:33 OldMathDock: Can see screen and hear your voice.
- 13:33 Hey-U: Aloha Mr Script.... thanks a million for PRESENTING!
- 13:33 Nube: I'm so old I remember when this used to happen regularly :)
- 13:33 fifotrader: i see it but I dont read
- 13:34 gentlejohn: roock and roll
- 13:34 AlphaInvestor: FrankB3 regularly posts in here to let us know when you are on Trader TV
- 13:35 FrankB3: Where's that case of beer,, Mr.. Scripts
- 13:38 mark6061: dang, video and audio buffering between syllables on mobile.
- 13:39 Mercor: POC is equivalent to the mean or the median price by volume?
- 13:40 R2S2: get rid of your iphone.... lol
- 13:41 ttt: where is that on studies
- 13:41 rr1: Could you repeat again how you used this to give Hincks the goalposts for his Iron Condor?
- 13:41 Shizznet: VolumeProfile
- 13:43 Mercor: sorry, meant Mode, not mean or median
- 13:45 K-9: with future , is date including 24 Hours?
- 13:47 --swimLessons:
- http://tos.mx/nqlX0w#
- 13:49 FrankB3: Thanks Mr. Scripts
- 13:52 Shizznet: I was 7yrs old. haha
- 13:53 K-9: what about Tock charts
- 13:53 hawkeye1: PLEASE LOOK AT AAPL
- 13:53 K-9: tick charts
- 13:53 AlphaInvestor: You are doing great on Trader TV David
- 13:55 Shizznet: Nooooo
- 13:55 Nube: It can't be easy coming up with what to cover here.
- 13:56 Shizznet: I'm sure there's a santa list of inquiries
- 13:56 mr_v: how did you get to that long time frame?
- 13:57 Shizznet: A variable workaround for a constant input
- 13:58 mr_v: Thank you very much
- 14:00 SudhirSS: Hi, Does any have any script to plot Automatic Trendlines?
- 14:01 Shizznet: Make Stock Market great again!
- 14:01 --swimLessons: http://tos.mx/dRZnUW#
- 14:02 Shizznet: Why does that look like LimboBars_Mobius?
- 14:02 unknown: Screen Show from user '--swimLessons' was stopped
- 14:02 MTS1: Thankyou!
- 14:03 AlphaInvestor: Later David - thanks
- 14:03 mr_v: Thnk u
- 14:04 RayK: Hi. My buffer is missing from 15:01 to 15:28 EDT. Can someone please PB it to me? Thanks in advance!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement