Welcome! Log In Create A New Profile

Get Earnings and Seasonal Trends - Subscribe Today!

Advanced

Fun with ThinkScript

Posted by robert 
Re: Fun with ThinkScript
May 09, 2015 09:24AM
Hi Robert.
Have a request for you.
Is there any way to plot a moving average in this fashion.

Rather than the plot dma lines throughout the entire chart in the traditional way I would like to shorten those lines so that the dma lines plot over say the last 5 candles only.

I like to keep my charts clean but having 3 or 4 moving average lines crossing all over my charts creates too much noise for me.

Thanks for any help you can provide.
Re: Fun with ThinkScript
May 09, 2015 10:19AM
Quote
mark1234
Hi Robert.
Have a request for you.
Is there any way to plot a moving average in this fashion.

Rather than the plot dma lines throughout the entire chart in the traditional way I would like to shorten those lines so that the dma lines plot over say the last 5 candles only.

I like to keep my charts clean but having 3 or 4 moving average lines crossing all over my charts creates too much noise for me.

Thanks for any help you can provide.

Yes, very easy to do.



- robert


Professional ThinkorSwim indicators for the average Joe
Re: Fun with ThinkScript
May 09, 2015 03:33PM
Thanks Robert, Great work here btw and much appreciated
Re: Fun with ThinkScript
May 09, 2015 03:55PM
Quote
mark1234
Thanks Robert, Great work here btw and much appreciated

you're welcome

- robert


Professional ThinkorSwim indicators for the average Joe
Re: Fun with ThinkScript
May 09, 2015 04:56PM
Quote
awerllow
Hi Robert,

I would just like to ask if the eSignal indicator on this website can be done in TOS? It seems that the below criteria must meet to trigger the Arrow up/down (green/red) to show.

1) I look for stocks hitting new highs or new lows
2) I look for at least 5-10 consecutive 5min candles of the same color
3) I look for RSI below 10 or above 90 to indicate extreme conditions

Also, would be nice if the first 5 minute candle making a new high vs previous candle (for bottom reversal) or new low (for top reversal) to change its color to yellow, to alert me to buy/sell respectively.

Please let me know. Thanks!

Yes, it can be done and it's available here.

eSignal version



vs. thinkorswim version



- robert


Professional ThinkorSwim indicators for the average Joe
Re: Fun with ThinkScript
May 09, 2015 06:21PM
Thanks Robert! You're freaking awesome!
Re: Fun with ThinkScript
May 09, 2015 07:11PM
Dang, I forgot that I am using daily sma incorporated with the 4 hour charts and just the sma isn't going to work for me.
Have you got a quick fix for the DailySMA.
Sorry and thanks again.
Re: Fun with ThinkScript
May 09, 2015 07:40PM
Quote
mark1234
Dang, I forgot that I am using daily sma incorporated with the 4 hour charts and just the sma isn't going to work for me.
Have you got a quick fix for the DailySMA.
Sorry and thanks again.

updated on my blog

Quote
awerllow
Thanks Robert! You're freaking awesome!

I know. grinning smiley <kidding>

You're welcome.

- robert


Professional ThinkorSwim indicators for the average Joe
Re: Fun with ThinkScript
May 09, 2015 08:50PM
Thanks Robert, sent a little something your way for your time.
Re: Fun with ThinkScript
May 09, 2015 09:19PM
Quote
mark1234
Thanks Robert, sent a little something your way for your time.

So very kind of you. I really appreciate it. Thanks.

- robert


Professional ThinkorSwim indicators for the average Joe
Re: Fun with ThinkScript
May 10, 2015 03:46PM
Re: Fun with ThinkScript
May 11, 2015 02:03AM
First let me apologize for my ignorance but when you give us code for scans and watchlist, where do you put that code?



robert Wrote:
-------------------------------------------------------
> > Robert:
> I wanted to create a signal on my watchlist in TOS
> that flags a stock when it is outside of the BB:
> Can I just use your code below and add that as a
> scan?
>
>
> NMR,
>
> The code needs to be modified a little bit to
> function as a watchlist signal. Give the
> following a try.
>
>
> #Out of Bounds
> def sDev = StDev(close, 21);
> def MidLine = Average(close, 21);
> def UpperBand = MidLine + 2 * sDev;
> def LowerBand = MidLine - 2 * sDev;
> plot OOB = if close > UpperBand then Round(close -
> UpperBand, 2) else if close < LowerBand then
> Round(close - LowerBand, 2) else Double.NaN;
> AssignBackgroundColor(if !isnan(oob) then
> color.white else color.gray);
> OOB.assignvalueColor(if !isnan(oob) then
> color.black else color.gray);
>
>
> [i.imgur.com]
>
> The scan shown above is checking the daily chart.
> If you wish to use a different time frame, hourly
> perhaps, then change the aggregation period when
> you set up the scan.
>
> [i.imgur.com]
Re: Fun with ThinkScript
May 11, 2015 08:07PM
Quote
kbtarl
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.

- robert


Professional ThinkorSwim indicators for the average Joe
Re: Fun with ThinkScript
May 12, 2015 07:47AM
time to go. I'll ask for help again later.

- robert


Professional ThinkorSwim indicators for the average Joe



Edited 1 time(s). Last edit at 05/12/2015 10:03AM by robert.
Re: Fun with ThinkScript
May 13, 2015 03:02PM
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 their setups.

So, I am looking for someone who runs TOS on a windows machine to help me with a little testing.

If you are willing to test a few things and answer some questions in a few back and forth emails, I would really appreciate it. This should not require more than about 20-30 minutes of your time.

If you already have the "A Bird's Eye View" script, great. If not, also great. I'll send it to you.

Please contact me via PM if you are willing to help.

Thank you.

- robert


Professional ThinkorSwim indicators for the average Joe



Edited 3 time(s). Last edit at 05/13/2015 04:55PM by robert.
Re: Fun with ThinkScript
May 13, 2015 04:32PM
Thank you, mtut, for sharing your valuable time to assist me in testing.

- robert


Professional ThinkorSwim indicators for the average Joe
Re: Fun with ThinkScript
May 14, 2015 12:46AM
rookie30 Wrote:
-------------------------------------------------------
> Good evening Robert and other really technically
> sharp folks,
>
> Is it possible to create an alert that will notify
> me audibly or by text message when the first
> bullish candle closes above the 8MA- after coming
> out of oversold conditions (Stochastic 20 or
> below)? I would love to have the same happen on
> the other side..... alert when the first bearish
> candles closes below the 8MA after coming out of
> overbought conditions (Stochastic 80 or above).
> I greatly appreciate it.
>
> R30

R30...Look into the TMV study in TOS. It paints the bars when price is above/below the 8ma and ADX is trending above 20.It also has a volume oscillator for vol spikes.
Re: Fun with ThinkScript
May 14, 2015 10:21AM
Robert,

You are welcome. Little in return for all that you have done. I have spoke with TOS support about this problem ( tos needing to be loaded for all users) and they do not not know why this has suddenly started to appear.
Re: Fun with ThinkScript
May 14, 2015 10:37AM
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
Re: Fun with ThinkScript
May 14, 2015 10:45AM
Quote
scalper
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 doesn't mean that is isn't available, just that I don't know about it.

I would suggest clicking on "Support/Chat" in the top-right corner of your thinkorswim window. Then select the "Live Support" tab in the window that pops up and click on the "Create support request" button. The support team is very good about quickly responding to your questions.

Good luck.

- robert


Professional ThinkorSwim indicators for the average Joe
Re: Fun with ThinkScript
May 14, 2015 11:28AM
Just talked to TOS support and they said good idea and they will pass it on to developers, but as of now no alerts on scans . Told them if they could put alert text on once your scan criteria is met and continue during the day with time of when scan was triggered in list form so you could see how many stocks and times of when criteria was met so you can trade off of that. This would be great for scans that are rare so you don't got to sit there and continue to press scan button .
Re: Fun with ThinkScript
May 14, 2015 04:41PM
Robert,

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
Re: Fun with ThinkScript
May 14, 2015 05:02PM
Quote
brazilianpillar
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 list (say S&P 500 instead of the entire universe of stocks) it would run fine. I think it may be related to how overloaded the TOS servers may be at the time because sometimes just waiting a bit and rerunning it on the entire universe of stocks would work just fine.

Here is a video I recorded just a minute ago to see what would happen. The scan is using the default settings on a 5 min chart and is run against all stocks.

It seems to be working for me right now. The best I can say is to wait a bit and try it again.

- robert


Professional ThinkorSwim indicators for the average Joe
Re: Fun with ThinkScript
May 15, 2015 06:04PM
Thanks I'll try that



Edited 1 time(s). Last edit at 05/15/2015 06:08PM by brazilianpillar.
Re: Fun with ThinkScript
May 15, 2015 06:11PM
Quote
brazilianpillar
is there a way to get rid of volume on your charts?

right-click the chart then go to "Style" --> "Settings..." —or— [CTRL]+"S" is the keyboard shortcut for settings

Under the "Equities" tab uncheck the show volume checkbox.



- robert


Professional ThinkorSwim indicators for the average Joe
Re: Fun with ThinkScript
May 19, 2015 04:41PM
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!!!!
Re: Fun with ThinkScript
May 19, 2015 10:59PM
Quote
vadim
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!!!!



def iDiff = 0.03;
plot FigureDiff = AbsValue(close - (Round(close * 2, 0) / 2)) <= iDiff;
FigureDiff.AssignValueColor(if FigureDiff then Color.LIGHT_GREEN else Color.DARK_GRAY);
AssignBackgroundColor (if FigureDiff then Color.LIGHT_GREEN else Color.DARK_GRAY);

- robert


Professional ThinkorSwim indicators for the average Joe
Re: Fun with ThinkScript
May 20, 2015 11:09AM
thank you Robert!!!
Re: Fun with ThinkScript
May 21, 2015 12:12PM
#
# TD Ameritrade IP Company, Inc. (c) 2009-2015
#

#wizard text: ADX crosses
#wizard input: crossingType
#wizard input: threshold
#wizard text: Inputs: length:
#wizard input: length

input length = 14;
input crossingType = {default above, below};
input threshold = 20;
input averageType = AverageType.WILDERS;

plot signal = crosses(DMI(length, averageType).ADX, threshold, crossingType == CrossingType.above);

signal.DefineColor("Above", GetColor(0));
signal.DefineColor("Below", GetColor(1));
signal.AssignValueColor(if crossingType == CrossingType.above then signal.color("Above"winking smiley else signal.color("Below"winking smiley);

signal.SetPaintingStrategy(if crossingType == CrossingType.above
then PaintingStrategy.BOOLEAN_ARROW_UP
else PaintingStrategy.BOOLEAN_ARROW_DOWN);




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
Re: Fun with ThinkScript
May 21, 2015 12:41PM
Quote
scalper
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;

- robert


Professional ThinkorSwim indicators for the average Joe
Sorry, only registered users may post in this forum.

Click here to login