Quotebijinkei Do you know if there's a way to turn a recursive variable into a non-recursive one? Or some way to get around using a recursive. I'm trying to set a study alert to notify me of when a new higher/lower fractal is formed and apparently recursive variables are disabled in study alerts. It can be done with some trickery. Compare the two scripts below. Both scripts plot the 30 min oby robert - Trading Discussion
Quoteht65 am I to assume the first code you provided can be used as a scan and then set the period to week? TOS returns some inaccurate results.. for instance The previous rsi spike on ALSK occurred nearly 2 years ago. Perhaps the weekly scan doesn't look that far back. Since all scan results are done completely behind the scenes, I have no way of verifying that. Mathematically, the formulby robert - Trading Discussion
Quoteht65 I am looking for a scan that will look for all stocks breaking out above the highest RSI input length = 14; def rsi = rsi(length).rsi; plot signal = rsi == highestall(rsi); QuoteI would like to be able to define the RSI as well with values of 69.10 and 30.90 input length = 14; input threshold = 69.10 def rsi = rsi(length).rsi; plot signal = rsi >= threshold;by robert - Trading Discussion
Quotenetarchitech Is it possible to have the input "length" have a value interpreted as a percentage (default value = 100%) instead of a period (default value = 100 bars)? I don't think so. I've been messing with it for about an hour now and every time I try to set a computationally generated length for use with the InertiaAll function (this is the function that actually calculatesby robert - Trading Discussion
The Eagle Eye layout is an enhancement to the popular Bird’s Eye View earnings research tool. Several valuable data points are displayed that allow the user to conduct more detailed earnings research. This is available on my blog.by robert - Trading Discussion
QuoteRTAVERA Hi Robert, This is a great tool, but I would like to add labels next to the label date with the expected move (GetMarketMakerMove) before earnings and the actual % and $ change after earnings. Also the implied volatility drop after ER and finally the average price movement after X number of days after ER. I know it's not easy, I'm in the process but I realized have a lot to learnby robert - Trading Discussion
Quotenetarchitech If time and circumstances permit, I look forward to your reply to this issue. Thanks again! If the goal it to plot a 100 period linear regression channel, then LinearRegCH100 is not study to use. That study does a linear regression over the entire length of the chart. The 100 in that study doesn't refer to a channel with a length of 100 bars, but to setting the width of theby robert - Trading Discussion
QuoteSKumar Thank you for the regression channel angle script. That's awesome. Is there a way to apply the angle on MACD to distinguish good crossovers from bad ones as I requested before? I don't think it will work out as well as one might have hoped. The angles look alright on a daily chart, but on the intra-day charts the angles become so small as to be almost unusable. The script is belby robert - Trading Discussion
Quotenetarchitech I have one follow-up question, if I may... 1. In your proffered script below, if I understand correctly, negative values of angle are converted to positive values using the absValue() function and then compared to the user-defined input minAngle: Correct. For my scan I wasn't really concerned whether the channel was sloping upward or downward. I was really running it asby robert - Trading Discussion
Quotebijinkei since I don't particularly know how to write a code from scratch so I tend to take parts of ones that already work and build off of that That's exactly how I began teaching myself not too long ago. Congratulations on piecing together your script. With the exception of one tiny flaw in the logic, you've managed to accomplish your goal. The problem lies in how you've chosen toby robert - Trading Discussion
Quotebrazilianpillar Robert, I found this risk/reward indicator that plots your stop and target based on the amount you're trading with, how much you're willing to risk and the risk/reward ratio you want. I don't know if it's yours or not, i can't remember. Is there a simple way to plot that information based on a specific number of shares you want to buy. or even give you the number of shareby robert - Trading Discussion
Quoteht65 Robert, I am lookong to build a MA scan to display the number of days a stock has traded above a certain MA for the last say 500 days.. any help appreciated.. tip coming your way! Do you want most recent consecutive days above the MA or total number of days above? For instance, let's assume that price was above the MA for 2 days, then dipped below for 5 days, then went back abby robert - Trading Discussion
Quoteht65 Robert, I am lookong to build a MA scan to display the number of days a stock has traded above a certain MA for the last say 500 days.. any help appreciated.. tip coming your way! Do you want most recent consecutive days above the MA or total number of days above? For instance, let's assume that price was above the MA for 2 days, then dipped below for 5 days, then went back abby robert - Trading Discussion
Quotenetarchitech Is it possible to use thinkscript to simply find the slope of the Linear Regression Channel (LinearRegCh100) and use it in a scan? I've searched all over with no luck... yes Quotenetarchitech UPDATE: Further searching yielded the following: Unfortunately, if I understand correctly, this enhancement appears to only apply to user-defined drawings. Plus, I don'tby robert - Trading Discussion
Quotejluis.nra Hello, how can I plot a small horizontal line for the week open of 4 candles ago? input LookBack = 4; def lastBar = HighestAll(if IsNaN(close) then 0 else BarNumber()); def startBar = lastBar - LookBack; plot priorWeeklyOpen = if BarNumber() < startBar then Double.NaN else GetValue(open(period = "week" ), BarNumber() - startBar); edited to remove automatiby robert - Trading Discussion
Quoteasragov Hello. Found this on the Internet but it doesn't work in ToS. Apologies for the newbie question - I don't seem to be able to make it work. A version in TradingView is below the ToS code if that helps. Thanks so much. It looks like that script was forwarded back and forth between email messages too many times. The email program caused some of the lines to be wrappby robert - Trading Discussion
QuoteSKumar Thanks Robert. I did go through the think script tutorial. But still it wasn't clear for me. What I am looking for is to find the close price of 30 min. Candle that corresponds to the high of the week when I iterate all the 30 min. Candles from Monday through Friday. Hope that makes makes sense Regards SKumar The arrows point to the 30 min candle which corresponds to the hiby robert - Trading Discussion
QuoteSKumar I have a question. I am new to thinkscript. How do I get the 30 min. Candle close price of the high of the week for any ticker? If you are wanting to learn to write your own scripts, I highly recommend working your way through thinkorswim's official ThinkScript tutorials. Chapter 12 specifically details how to lookup prices for different time periods than the one the current chby robert - Trading Discussion
Quotescalper How can I turn this ADX CROSSOVER scan .Into just SCANNING when ADX IS ABOVE OR EQUAL TO input threshold ? NOT JUST WHEN IT CROSSES thanks input length = 14; input threshold = 20; plot signal = reference DMI(length).ADX >= threshold;by robert - Trading Discussion
Quotevadim Hi friends!! Hi Robert! def iDiff = 0.03; # def iRoundLevel = round(close,0); Plot FigureDiff = if (iDiff >= (close - iRoundLevel) and (close - iRoundLevel) >= -iDiff ) then 1 else 0; AssignBackgroundColor (if FigureDiff == 1 then Color.LIGHT_GREEN else color.CURRENT); this script show price near 1,2,3..., but i need 0.50, 1,50... also If you can it is very goood!by robert - Trading Discussion
Quotebrazilianpillar is there a way to get rid of volume on your charts? right-click the chart then go to "Style" --> "Settings..." —or— +"S" is the keyboard shortcut for settings Under the "Equities" tab uncheck the show volume checkbox.by robert - Trading Discussion
Quotebrazilianpillar I bought your Champion Reversal scripts but when i try doing a scan, I get a timed out error message. Itried changing the look back number to 2, 5 and 10 candles and got errors. I even changed the aggregation period and had the same result. please advise I saw the same thing a few times when I was testing it out during development. Usually, if I ran it on a smaller stock lby robert - Trading Discussion
Quotescalper Is there a way to have a text or email alert once your SCAN comes up with stocks that meet your criteria in think or swim? I have looked but cant believe that there is no option for this where you could have a list sent to you once your scan criteria is met and continue to do so through out the day with time of when criteria was met .thanks I am unaware of such a feature. That doby robert - Trading Discussion
Thank you, mtut, for sharing your valuable time to assist me in testing.by robert - Trading Discussion
Help Needed Help is no longer needed. Thank you, mtut, for your assistance. I need someone to help me test my earnings research tool. I have had two users report that the grid layout has become corrupted when they tried to reload the saved grid. Both users were running thinkorswim on a windows computer. I have not experienced what they have and, as a Mac user, I am unable to duplicate theiby robert - Trading Discussion
time to go. I'll ask for help again later.by robert - Trading Discussion
NCTrader, Please allow me to geek out for a moment. That is some beautifully formatted code. The TS scripting language seems to be much more robust than ThinkScript.by robert - Trading Discussion
Quotekbtarl when you give us code for scans and watchlist, where do you put that code? tutorial for adding a custom watchlist column. tutorial for setting up a custom scan. In the example linked, the scan is setup for a weekly scan. However, you can scan for daily, 30 min, whatever just by selecting that time period in the drop down menu.by robert - Trading Discussion
I just added a scan script for the champion reversal indicator.by robert - Trading Discussion