Oliver Velez's Fabulous 4 For ThinkOrSwim

Hey Golo, thanks for the script, can you make a video using this script in your daily trade?
Hi Betozenho, I don't know how to do a video, but I just utilize the same technique as Oliver does in his videos and base entries on candle formations/price action. The only thing I add is bollinger bands at 2.0 and 3.0 standard deviations. If price gaps up/down past the Bollinger Bands I'm not looking to go in the direction of the gap, see post #13. I look for hammers/inverse hammers to play mean reversion. Hope that helps.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Sure. It's been a while since I made these but believe I just took TOS standard scripts and duplicated three times. Clouds and colors are adjustable. I just use the Bollinger Bands but here are both. https://tos.mx/iQjRGPw
@GoLo , Do you mind explaining how you use the Keltner bands in conjunction with the Bollinger bands that you provided. I am having great success just using this on a 1m chart and scalping SPX. I just can't seem to see how the Keltner plays a role. If you have any advice or insight, I would greatly appreciate it. Thanks!
 
@GoLo , Do you mind explaining how you use the Keltner bands in conjunction with the Bollinger bands that you provided. I am having great success just using this on a 1m chart and scalping SPX. I just can't seem to see how the Keltner plays a role. If you have any advice or insight, I would greatly appreciate it. Thanks!
Sorry wasn't real clear above, but mentioned I was only using BB. However, Friday I did set KC's to 2.0 and 3.0 and left BB at 2.0 (Standard) Did the same scalping SPX and worked great. Just using price action and if price is outside of both BB and the 3.0 KC band with a pinbar (evening star/morning star) it was really good on the 1m. Perfect example from Friday 9/29/23. Look at SPX at 15:01 and 15:02. 15:00 is a likely algo reversal time as well. Also for a long see 11:05/ 11:06 One last thing, at the 15:01/15:02 time see Mobius RSI Laguerre, fractal energy had plummeted meaning most likely the move is losing momentum.
 
Last edited:
Sorry wasn't real clear above, but mentioned I was only using BB. However, Friday I did set KC's to 2.0 and 3.0 and left BB at 2.0 (Standard) Did the same scalping SPX and worked great. Just using price action and if price is outside of both BB and the 3.0 KC band with a pinbar (evening star/morning star) it was really good on the 1m. Perfect example from Friday 9/29/23. Look at SPX at 15:01 and 15:02. 15:00 is a likely algo reversal time as well. Also for a long see 11:05/ 11:06 One last thing, at the 15:01/15:02 time see Mobius RSI Laguerre, fractal energy had plummeted meaning most likely the move is losing momentum.
Could you show your chart?
 
Sorry wasn't real clear above, but mentioned I was only using BB. However, Friday I did set KC's to 2.0 and 3.0 and left BB at 2.0 (Standard) Did the same scalping SPX and worked great. Just using price action and if price is outside of both BB and the 3.0 KC band with a pinbar (evening star/morning star) it was really good on the 1m. Perfect example from Friday 9/29/23. Look at SPX at 15:01 and 15:02. 15:00 is a likely algo reversal time as well. Also for a long see 11:05/ 11:06 One last thing, at the 15:01/15:02 time see Mobius RSI Laguerre, fractal energy had plummeted meaning most likely the move is losing momentum.
@GoLo, Thanks. So there is three factors for the KB's. What do you do to the third one? It is currently set to 4.0. The settings on my KB is as follows:
factor: 3.5 -- changed to: 3.0
factor2: 2.5 -- changed to: 2.0
factor3: 4.0 -- ??
Also, are you using the standard Mobius RSI Laguerre or have you made changes to accommodate the lower time frames? Thanks.
 
@GoLo, Thanks. So there is three factors for the KB's. What do you do to the third one? It is currently set to 4.0. The settings on my KB is as follows:
factor: 3.5 -- changed to: 3.0
factor2: 2.5 -- changed to: 2.0
factor3: 4.0 -- ??
Also, are you using the standard Mobius RSI Laguerre or have you made changes to accommodate the lower time frames? Thanks.
I've turned the 4.0 off for now. I use the standard Mobius RSI Laguerre 8/13/8, however, I did make some modifications to it this weekend (mostly cosmetic and adding a squeeze/exhaustion label). Need to watch it for a couple days to see how it performs . Note the Advanced Market Moves_v2 proprietary indicator also gave a sell signal at 15:01 which compliments this setup (Cyan Arrow) https://usethinkscript.com/threads/advanced-market-moves-2-0-released.1797/. I also had a MACD I had modified but this new one coded by @samer800 gives RSI, Stoch and MACD and I prefer to my old one. https://usethinkscript.com/threads/ultimate-macd-for-thinkorswim.16732/.
1696214532675.png
 
Any chance that one of you gurus could rewrite the "FAB4" without the FIBS. I personally would like for it to provide the upper and lower lines with a cloud between them and extend only 30 minutes beyond market open. Is this at all possible?
 
Last edited:
Any chance that one of you gurus could rewrite the "FAB4" without the FIBS. I personally would like for it to provide the upper and lower lines with a cloud between them and extend only 30 minutes beyond market open. Is this at all possible?
Hi @METAL , you can just set show targets to no and removes fibs vs rewriting the code. I tried but was unable to get the cloud for a specified time the following day. I know it's possible, just beyond my abilities. Cheers.
 
Hi @METAL , you can just set show targets to no and removes fibs vs rewriting the code. I tried but was unable to get the cloud for a specified time the following day. I know it's possible, just beyond my abilities. Cheers.
Yeah thanks. I know I can do that. I just wanted to remove what I wasn't using to help reduce any lag. I have tried several times to get a cloud to plot and have not been successful either. It would be awesome if we could just have the cloud plot a desired amount beyond market open. I do not use this after 30 to 45 minutes.
I will try again but I am not too good at coding.
 
Gentlemen this strategy that Oliver Velez has worked with seems to be less effective unless you consider the 'Relative Volume' .
Please see my post here https://usethinkscript.com/threads/time-based-volume-indicator-for-thinkorswim.124/post-136001

I would love a group to work on a more detailed volume analysis sometime next year.
I hope everyone is having a great new year
By way of background, essentially trying to plot the highest of the last 45 minutues of RTH, the 20SMA, 200SMA, and close. Then plotting the lowest of last 45 minutues of RTH, the 20SMA, 200SMA, and close. That box is a no trade zone and gives you a bias for next day based on where price opens
This is just like the typical Panda & Python statistical analysis and works well over a large number of trades.
Wondering if you could actually create a 'box' for the 'no trade zone'
I think Volume should define the significance of the 'no trade zone' ever instance where this Fab4 strategy was significant seemed to occur with unusual volumes.
Any chance that one of you gurus could rewrite the "FAB4" without the FIBS
Yes
 
This is an attempt to autoplot Oliver Velez's Fabulous 4 trading zone. By way of background, essentially trying to plot the highest of the last 45 minutues of RTH, the 20SMA, 200SMA, and close. Then plotting the lowest of last 45 minutues of RTH, the 20SMA, 200SMA, and close. That box is a no trade zone and gives you a bias for next day based on where price opens (Please see his videos for detailed explanation, link provided in code).
This appears to plot the box properly, I'm not an experienced coder so I'm sure there's better coding available, feel free to improve. One thing I wanted to do is extend the horizontal lines/cloud. Below is the code, thanks to investtheory.com for orignal ORB coding and mashume for a thread on how to pull ema/sma at a specific point in time. Although it appears the cloud is printing correctly, the label does not seem to be properly reflecting the SMA's at close (I was just using labels for reference so will likely hide that part of code anyway). Note that the calculations of the FAB 4 are primarily found in lines 90-163.
Below is the code, feel free to enhance/improve.


#hint period: If you don't want the developing range to look jagged, choose a larger timeframe than the chart (but shorter than or equal to the opening range time window) at which the opening range becomes fixed. For instance, if you have a 30' opening range on a 1' chart and you don't want the OR high/low lines moving every single minute, set the timeframe to 15' or 30' so it will only update twice or once during the OR formation.
#hint orStartTime: Choose the time at which the OR begins forming, in HHMM 24 hour format and in the Eastern time zone. 0930 means 9:30 A.M.
#hint orEndTime: Choose the time at which the OR ends forming, in HHMM 24 hour format and in the Eastern time zone. 1600 means 4:00 P.M. Default setting is 1000.
#hint showOnlyToday: Hide lines on prior days.
#hint showCloud: Paint a cloud in the background during the opening range formation.
#hint showMidpoint: Show a line in the middle of the opening range.
#hint showQuarters: Show lines for 75% and 25% of the opening range, on either side of the midpoint.
#hint showTargets: Plot targets at defined multiples of the opening range width.
#hint useTradeSignals: Turn up/down arrows on or off.
#hint useAlerts: Turn all the alerts on or off with one setting.
#hint multiplier1: Choose the multiple of the OR width that you will use for first target. 1.5 = 150% of the opening range.
#hint multiplier2: Choose the multiple of the OR width that you will use for second target. 1.5 = 150% of the opening range.
#hint multiplier3: Choose the multiple of the OR width that you will use for third target. 1.5 = 150% of the opening range.

# Update 09/5/23, Script was modified from original to attempt to draw Fab 4 box as described by Oliver Velez in this video
(Used last 45 minutes of market activity 1515-1600) can change to personal preference


# inputs
input orStartTime = 1515;
input orEndTime = 1600;
input period = aggregationPeriod.FIFTEEN_MIN;
input showOnlyToday = no;
input showCloud = no; # This cloud is only printing high and low of last 45 minutes of RTH if enabled
input showMidpoint = no;
input showGoldenZone = no;
input useTradeSignals = no;

input showTargets = no;
input multiplier1 = 0.236;
input multiplier2 = 0.618;
input multiplier3 = 1.0;
input multiplier4 = 1.382;
input multiplier5 = 1.618;
input multiplier6 = 2.0;
input multiplier7 = 2.618;




# constants
def na = double.nan;
def hi = high(period = period);
def lo = low(period = period);
defineGlobalColor("Cloud", color.gray);

# opening range time logic
def isOr = secondstilltime(orEndTime) > 0
and secondsfromtime(orStartTime) >= 0;
def today = (!showOnlyToday or getday() == getlastday())
and secondsfromtime(orStartTime) >= 0 and !isNAN(close);

# opening range levels logic
rec orhi =
if orhi[1] == 0
or !isOr[1]
and isOr
then hi
else if isOr
and hi > orhi[1]
then hi
else orhi[1];

rec orlo =
if orlo[1] == 0
or !isOr[1]
and isOr
then lo
else if isOr
and lo < orlo[1]
then lo
else orlo[1];

# plots
plot orh = if today < 1 then na else orhi;
plot orl = if today < 1 then na else orlo;
plot orm = if !isOr then (orh + orl) / 2.000 else na;

#Method1 - Previous Day Closing Price (PCL)
input display_method1 = yes;
input showtodayonly = yes;
input aggregationPeriod = AggregationPeriod.DAY;
def pc = close(period = aggregationPeriod)[1];
plot previous_close = if showtodayonly and GetDay() != GetLastDay() then Double.NaN else pc;
previous_close.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
previous_close.SetLineWeight(2);
previous_close.SetHiding(!display_method1);


#=========================================== Add 20/200 SMA ===============================================

# -------------------------------------------- EMA/SMA 1 -----------------------------------------


input EMA1 = 20;

input averageType = AverageType.SIMPLE;
def price = close;

plot EMA_1 = MovingAverage(averageType, price, EMA1);
;

EMA_1.SetDefaultColor(GetColor(8));


# -------------------------------------------- EMA/SMA 2 -----------------------------------------


input EMA2 = 200;

input averageType2 = AverageType.SIMPLE;
def price2 = close;

plot EMA_2 = MovingAverage(averageType2, price2, EMA2);
;

EMA_2.SetDefaultColor(GetColor(2));


# ===================================== Derive EMA's at 1600 hours (Thanks to mashume!) for orignal coding idea=================

def SMA20 = SimpleMovingAvg ( close, length = 20);
def expAtSixteenHundo = if
( secondsFromTime(1600) crosses above 0 )
then expAtSixteenHundo[1]
else SMA20;
AddLabel(yes, "20SMA @ 16:00:" + expAtSixteenHundo, color.yellow); # This does not seem to be SMA at close
plot line20 = expAtSixteenHundo;


# 200 SMA

def SMA200 = SimpleMovingAvg ( close, length = 200);
def expAtSixteenHundred = if
( secondsFromTime(1600) crosses above 0 )
then expAtSixteenHundred[1]
else SMA200;
AddLabel(yes, "200SMA @ 16:00:" + expAtSixteenHundred, color.red); # This does not seem to be SMA at close
plot line200 = expAtSixteenHundred;



# ===================================== End coding for Derive EMA's at 1600 hours ===============================


# ===================================== Closing Range Cloud Only ================================

addcloud(if showcloud and isOR then orh else na, if showcloud and isOR then orl else na, color1 = globalColor("Cloud"));


# ===================================== FAB 4 Calculations and Cloud ===============================

input showFAB4Cloud = yes; # This cloud attempts to plot the Fab4 Highest and lowest of last 45mins of trading, 20SMA, 200SMA and DailyClose
defineGlobalColor("FAB4Cloud", color.gray);


plot FAB4maximum = max(orhi,max(SMA20,SMA200));
#plot FaB4maximum = max(orh,max(orl,max(ema1,ema2)));

plot FAB4minimum = min(orlo,min(SMA20,SMA200));

addcloud(if showFAB4Cloud and isOR then FAB4maximum else na, if showFAB4Cloud and isOR then FAB4minimum else na, color1 = globalColor("FAB4Cloud"));


#------------------------------------------------------- Plot Long/Short GZ .618 - .786 ---------------------------------------

plot short_786 = if !isOr then (orh + orm) * 0.786 else na;
plot short_618 = if !isOr then (orh + orm) * 0.618 else na;
plot long_786 = if !isOr then (orl + orm) * 0.214 else na;
plot long_618 = if !isOr then (orl + orm) * 0.382 else na;

orm.setHiding(!showMidpoint);
short_786.setHiding(!showGoldenZone);
short_618.setHiding(!showGoldenZone);
long_786.setHiding(!showGoldenZone);
long_618.setHiding(!showGoldenZone);

def range = orhi - orlo;

plot u1 = if showTargets and !isOr then orh + range * multiplier1 else na;
plot u2 = if showTargets and !isOr then orh + range * multiplier2 else na;
plot u3 = if showTargets and !isOr then orh + range * multiplier3 else na;
plot u4 = if showTargets and !isOr then orh + range * multiplier4 else na;
plot u5 = if showTargets and !isOr then orh + range * multiplier5 else na;
plot u6 = if showTargets and !isOr then orh + range * multiplier6 else na;
plot u7 = if showTargets and !isOr then orh + range * multiplier7 else na;

plot l1 = if showTargets and !isOr then orl - range * multiplier1 else na;
plot l2 = if showTargets and !isOr then orl - range * multiplier2 else na;
plot l3 = if showTargets and !isOr then orl - range * multiplier3 else na;
plot l4 = if showTargets and !isOr then orl - range * multiplier4 else na;
plot l5 = if showTargets and !isOr then orl - range * multiplier5 else na;
plot l6 = if showTargets and !isOr then orl - range * multiplier6 else na;
plot l7 = if showTargets and !isOr then orl - range * multiplier7 else na;

plot highBreak = useTradeSignals and !isOr and close crosses above orh;
plot lowBreak = useTradeSignals and !isOr and close crosses below orl;

plot midhighbreak = useTradeSignals and !isOr and close crosses above orm;
plot midlowbreak = useTradeSignals and !isOr and close crosses below orm;

plot highQBreak = useTradeSignals and !isOr and close crosses above short_786;
plot lowQBreak = useTradeSignals and !isOr and close crosses below long_786;

plot longTarget1 = useTradeSignals and !isOr and close crosses above u1;
plot longTarget2 = useTradeSignals and !isOr and close crosses above u2;
plot longTarget3 = useTradeSignals and !isOr and close crosses above u3;
plot longTarget4 = useTradeSignals and !isOr and close crosses above u4;
plot longTarget5 = useTradeSignals and !isOr and close crosses above u5;
plot longTarget6 = useTradeSignals and !isOr and close crosses above u6;
plot longTarget7 = useTradeSignals and !isOr and close crosses above u7;



plot shortTarget1 = useTradeSignals and !isOr and close crosses below l1;
plot shortTarget2 = useTradeSignals and !isOr and close crosses below l2;
plot shortTarget3 = useTradeSignals and !isOr and close crosses below l3;
plot shortTarget4 = useTradeSignals and !isOr and close crosses below l4;
plot shortTarget5 = useTradeSignals and !isOr and close crosses below l5;
plot shortTarget6 = useTradeSignals and !isOr and close crosses below l6;
plot shortTarget7 = useTradeSignals and !isOr and close crosses below l7;



# look and feel
orh.setPaintingStrategy(paintingStrategy.HORIZONTAL);
orl.setPaintingStrategy(paintingStrategy.HORIZONTAL);
orm.setPaintingStrategy(paintingStrategy.HORIZONTAL);
short_786.setPaintingStrategy(paintingStrategy.HORIZONTAL);
short_618.setPaintingStrategy(paintingStrategy.HORIZONTAL);
long_786.setPaintingStrategy(paintingStrategy.HORIZONTAL);
long_618.setPaintingStrategy(paintingStrategy.HORIZONTAL);
orh.setdefaultcolor(color.gray);
orl.setdefaultcolor(color.gray);
orm.setdefaultcolor(color.dark_gray);
short_786.setdefaultcolor(color.yellow);
short_618.setdefaultcolor(color.yellow);
long_786.setdefaultcolor(color.yellow);
long_618.setdefaultcolor(color.yellow);

u1.setPaintingStrategy(paintingStrategy.HORIZONTAL);
u2.setPaintingStrategy(paintingStrategy.HORIZONTAL);
u3.setPaintingStrategy(paintingStrategy.HORIZONTAL);
u4.setPaintingStrategy(paintingStrategy.HORIZONTAL);
u5.setPaintingStrategy(paintingStrategy.HORIZONTAL);
u6.setPaintingStrategy(paintingStrategy.HORIZONTAL);
u7.setPaintingStrategy(paintingStrategy.HORIZONTAL);


l1.setPaintingStrategy(paintingStrategy.HORIZONTAL);
l2.setPaintingStrategy(paintingStrategy.HORIZONTAL);
l3.setPaintingStrategy(paintingStrategy.HORIZONTAL);
l4.setPaintingStrategy(paintingStrategy.HORIZONTAL);
l5.setPaintingStrategy(paintingStrategy.HORIZONTAL);
l6.setPaintingStrategy(paintingStrategy.HORIZONTAL);
l7.setPaintingStrategy(paintingStrategy.HORIZONTAL);

u1.setdefaultcolor(color.cyan);
u2.setdefaultcolor(color.yellow);
u3.setdefaultcolor(color.red);
u4.setdefaultcolor(color.magenta);
u5.setdefaultcolor(color.magenta);
u6.setdefaultcolor(color.orange);
u7.setdefaultcolor(color.orange);


l1.setdefaultcolor(color.cyan);
l2.setdefaultcolor(color.yellow);
l3.setdefaultcolor(color.red);
l4.setdefaultcolor(color.magenta);
l5.setdefaultcolor(color.magenta);
l6.setdefaultcolor(color.orange);
l7.setdefaultcolor(color.orange);

highBreak.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
lowbreak.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);
midHighBreak.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
midLowBreak.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);
highQBreak.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
lowQBreak.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);

highBreak.setdefaultcolor(color.dark_green);
lowbreak.setdefaultcolor(color.dark_red);
midHighBreak.setdefaultcolor(color.dark_green);
midLowBreak.setdefaultcolor(color.dark_red);
highQBreak.setdefaultcolor(color.dark_green);
lowQBreak.setdefaultcolor(color.dark_red);

longTarget1.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);
longTarget2.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);
longTarget3.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);
longTarget4.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);
longTarget5.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);

shortTarget1.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
shortTarget2.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
shortTarget3.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
shortTarget4.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
shortTarget5.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);

longTarget1.setdefaultcolor(color.dark_red);
longTarget2.setdefaultcolor(color.dark_red);
longTarget3.setdefaultcolor(color.dark_red);
longTarget4.setdefaultcolor(color.dark_red);
longTarget5.setdefaultcolor(color.dark_red);

shortTarget1.setdefaultcolor(color.dark_green);
shortTarget2.setdefaultcolor(color.dark_green);
shortTarget3.setdefaultcolor(color.dark_green);
shortTarget4.setdefaultcolor(color.dark_green);
shortTarget5.setdefaultcolor(color.dark_green);
Hey GoLo, I think it's all about the resistance and support, if the market opens higher high it will be a bullish, if the market opens lower low then it will be Beresh. it doesn't matter the time just look to the last higher high or lower low before market close. In between just stay a side and monitor.
 
Hey GoLo, I think it's all about the resistance and support, if the market opens higher high it will be a bullish, if the market opens lower low then it will be Beresh. it doesn't matter the time just look to the last higher high or lower low before market close. In between just stay a side and monitor.
Absolutely the market once followed this Fab4 behavior with considerable accuracy.
The accuracy from following yesterdays prices comes from the old simulations of using Panda & Python to publish simple simulations such as " BUY at OPEN then SELL at CLOSE" that institutions would follow each other into during different market cycles. . .

These days there is a bit more unpredictability as the price may cross over yesterdays prices more often than it once did. Now we must also consider Volatility and the significance of those Volumes at the last 45 minutes of the RTH or how deliberate the Volumes in the aftermarket move.

Once you observe relative Volume it becomes much clearer if the Close of the previous day is significant or if it is simply normal profit taking and normal closing of positions.


Despite these changes in recent years, I agree it is certainly wonderful of Oliver Velez to share how simple and straightforward the market behaviors truly are.
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
501 Online
Create Post

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top