Scan Help for RSI Fractal Pivots in TOS

M

Miket

New member
How do I create a scan in TOS to show me when I have a buy signal for the following study http://tos.mx/Zy5LSO ? Thank you for any help

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
Assuming you're trying to scan for the up and down signals. Here is the code:

Rich (BB code):
From_ContrariaBEAR_on_May_30()."UpFractal" is true within 3 bars or From_ContrariaBEAR_on_May_30()."DownFractal" is true within 3 bars
Change the _From_ContrariaBEAR_on_May_30_ to the name of your indicator. Also, I put 3 as the lookback. Change that value to how far back you want to scan for the signals.

 
Last edited:
M

Miket

New member
@BenTen Thank you. In addition, I'd like to have a watchlist where I add the tickers and be notified when I get a green arrow and when I get red arrow.

When I get a green arrow notification the cell turns green and turns off after 5 minutes. I like using the 5 minute chart.

When I get a red arrow notification the cell turns red and turns off after 5 minutes.

I have 15 different stocks I trade and do not want to have 15 charts up at all times. When I get a green arrow or red arrow I can populate my chart and make a decision to move forward. I'm new to thinkscript but love it and am trying to figure out how to customize it to my liking.



I have a John Carter squeeze indicator that turns colors based on the squeeze stage and would like something similiar except with the RSI Fractal indicator. Any help would be greatly appreciated.

 
Last edited:
markos

markos

Well-known member
VIP
Warehouse
@Miket, have you tried the "Universe of ThinkScript" at the top of the main page?

 
Last edited:
M

Miket

New member
I've looked in there as well as well as some other sites with no luck.

 
Last edited:
markos

markos

Well-known member
VIP
Warehouse
It's not for me to send you elsewhere for help. @BenTen would have to do that unless he has a programmer with time.

If you have looked all the way through the "Universe of Thinkscript", which has all of the TOS Tutorials, the Thinkscript manual, the Indianapolis Options Meetup Onenote, UpTheCreek's Onenote and StanL's 200 page manual along with the past two years of text from the thinkscript lounge, and you still couldn't find anything, I am dumbfounded. And grumpy... Don't give up. If you figure it out, please come back and share what you have learned.

Unless @BenTen want's to get involved here, your best bet would be to call TOS support. Sorry for the tough love, but sometimes it has to be given.

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Miket An alternative to what you mentioned would be to create 2 separate scanners. One of bearish (red arrow) and bullish (green arrow). Then save those 2 scanners as 2 different watchlists.



Add them to your left column. Whenever the scanner detects that there is a green arrow it would pop up on your bullish scanner (as a watchlist) and vice versa. This is the simplest and easiest to do.

@markos Any comments regarding what I just said above?

 
Last edited:
M

Miket

New member
@BenTen How do I create a bearish scanner like that?

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Miket I already gave you the code above. It has both bearish and bullish scans.

 
Last edited:
M

Miket

New member
rsiwithFRACTALPIVOTS()."UpFractal" is true within 1 bars or rsiwithFRACTALPIVOTS()."DownFractal" is true within 1 bars

This is what I have and it doesn't produce any results.

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Miket That command is looking for either a up or down arrow within the last 1 bar. Maybe change the number of bars and see if anything shows up.

 
Last edited:
markos

markos

Well-known member
VIP
Warehouse
@Miket From the StanL Snippets - Pages 181-182

Rich (BB code):
 S-LINEAR REGRESSION-VAR SCAN  This is a scan that works well in a dynamic watch list with your favorite companies to trade. It works well as a signal when a company is moving up through resistance in a trough or lower area for a long trade. Vary the "width of channel"  and “length” to suit your own preferences. 

Plot scan = low crosses LinearRegChVar ("width of channel" = 69, "full range" = no, "length" = 252)."LowerLR"

S-SCAN FOR TRENDING CONDITIONS 

input length = 20;#hint length:Number of agg-bars to test for ascending conditions 
input bars_up = 5;#hint bars_up:Number of agg-bars being evaluated in <b>sum</b> 
def trend_up = IsAscending(close,length); 
def trend_up2 = sum(close > close[1],Bars_up) >= Bars_up; 
plot scan = trend_up && trend_up2;

Another example 

input length = 20;#hint length:Number of agg-bars to test for ascending conditions 
input bars = 5;#hint bars:Number of agg-bars being evaluated in <b>sum</b> 
def trendup = IsAscending(close,length); 
def trendup2 = sum(close > close[1],bars) >= bars; 
def mcd = MACD(); 
def mcdtrend = sum(mcd > mcd[1],bars) == bars; 
plot scan = trendup && trendup2 && mcdtrend; 
#end
  
 From here please read in the TOS Manual how to set up alerts to your conditions in a dynamic watchlist.
 
Last edited:
markos

markos

Well-known member
VIP
Warehouse
@BenTen . Change the number of bars. Also consider that with only 15 stocks in a scanner, you may have to wait a while before one of them hit.

 
Last edited:

Top