DEEPWATER_THE ONE For ThinkOrSwim

OH LOL. NOW I UNDERSTAND. I took the Image Screen grab into a graphics program, rotated it 90 degrees and wrote those words so folks could Identify the symbol when they saw it. Those are not in the code. I added them to the image afterword for informational use only. Hope that clears it up
LOL, no wonder why I tried everything and still don't get it! Thanks for the great study.
 

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

This indicator gave me a really nice Buy and Sell signal for Ford today, resulting in 2.5% scalp for intra-day. My buy confirmation is original Deepwater strong signal, aligned with BuyTheDip red arrow, and a strong buy from DeepwaterLowerTimeframe (shared by Kid in this thread). Sell confirmation was the three deepwater indicators providing a sell signal. I also utilize WaddahAttarExplosion and TopUltimateBreakout. This Buy signal generated at 11:45 (central time) on the 1 min chart.

 
That looks good green. Are you getting Buy Alerts and Sell Alerts Audio?
I dont believe so. Do you know what the alert will say when there is a strong buy signal on the original version? Will it just audio alert and read "Buy"? or "Strong Buy"? I usually get so many alerts that i try to disable them as I am watching a handful of stocks simultaneously on a daily basis. One tip that I have for day traders who are just getting started (and this has been shared in this forum several times by others as well) is that for scalping/day-trading, just focus on a few stocks. Get very familiar with them from resistance, support standpoint. This includes horizontal support/resistance as well as diagonal. I know these stocks in and out from a 1D, 1H, 4H standpoint, which allows me to trade very comfortably on the 1min and 2min chart. This might not work for others but works really well for me. One of the common themes I notice on this forum is when an indicator is shared by someone, there is constant demand for the scanner version of that indicator. Which typically indicate that traders are casting a wide net and have an extensive watchlist.
 
This indicator gave me a really nice Buy and Sell signal for Ford today, resulting in 2.5% scalp for intra-day. My buy confirmation is original Deepwater strong signal, aligned with BuyTheDip red arrow, and a strong buy from DeepwaterLowerTimeframe (shared by Kid in this thread). Sell confirmation was the three deepwater indicators providing a sell signal. I also utilize WaddahAttarExplosion and TopUltimateBreakout. This Buy signal generated at 11:45 (central time) on the 1 min chart.

is there a difference between lowers studies; deepwater original (13,15,close, wilders, 12,26,9..) vs latest (20,15, close, wilders, 12,26,9..). As I do not see initial spike in your pic deepwater latest besides the configuration that I mentioned above in brackets. TIA
 
is there a difference between lowers studies; deepwater original (13,15,close, wilders, 12,26,9..) vs latest (20,15, close, wilders, 12,26,9..). As I do not see initial spike in your pic deepwater latest besides the configuration that I mentioned above in brackets. TIA
The deepwater original is the code that was shared as the original version at the start of this thread (which has since been updated). I have shared it here below (i hope thats ok with @Deepwater). This original version works really well for me when combined with @ImKidKid 's lowertimeframe version (see post #35). You are correct that the latest version did not produce a buy spike at 11:45, this might be due to the length setting set to 20 or something else. I usually don't use the latest for buy signals I am rarely getting buy spikes on lower timeframes where i trade such as 1 min or 2 mins.



Code:
#DEEPWATER_THE ONE 5/17/2021 revision
#https://usethinkscript.com/threads/deepwater_the-one.6518/
declare lower;
input length = 13;
input length2 = 15;
input price = close;
input averageType = AverageType.WILDERS;

input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageTypeMACD = AverageType.EXPONENTIAL;

def Diff = MACD(fastLength, slowLength, MACDLength, averageTypeMACD).Diff;

def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI = 50 * (ChgRatio + 1);
def RSIAvg3 = MovingAverage(averageType, (RSI), 3);
def RSIAvg5 = MovingAverage(averageType, (RSI), 5);
def RSI3OverSoldpivit = RSIAvg3 > RSIAvg3[1] and RSIAvg3[1] > RSIAvg3[2] and RSIAvg3[2] < RSIAvg3[3] and RSIAvg3[3] < RSIAvg3 [4];
def RSI3OverBoughtpivit = RSIAvg3 < RSIAvg3[1] and RSIAvg3[1] < RSIAvg3[2] and RSIAvg3[2] > RSIAvg3[3] and RSIAvg3[3] > RSIAvg3 [4];
#--------------------5 day MA
input displace = 0;
input showBreakoutSignals = no;
def MAvgExp14 = ExpAverage(price[-displace], 14);
#--------------------oversold
def twoBarPivotMACD = Diff > Diff[1] and Diff[1] > Diff[2] and Diff[2] < Diff[3] and Diff[3] < Diff [4];

def overSoldRSI = RSI <= 32;
def overSoldRSIHeavy = RSI <= 30 and Diff < 0 and (close < close[7]);
def TrendReversalalert = (twoBarPivotMACD and Highest(overSoldRSI, 6) > 0) / 3;
plot TrendReversal = (twoBarPivotMACD and Highest(overSoldRSI, 6) > 0) / 3;
Alert(TrendReversalalert, "Buy Alert");
plot TrendReversal1 = (twoBarPivotMACD and Highest(overSoldRSIHeavy, 6) > 0) / 1.2;


TrendReversal.SetDefaultColor(GetColor(4));#yellow
TrendReversal1.SetDefaultColor(GetColor(6));#green

AddLabel(yes, if  TrendReversal > 0 then "Buy" else "");
Alert( TrendReversalalert > 0,  "Chart is now Oversold ", Alert.BAR, Sound.Ring);
AddLabel(TrendReversalalert > 0
, "Chart is now Oversold ", Color.LIME);
#-----------------------Overbought
def twoBarPivotMACD1 = Diff < Diff[1] and Diff[1] < Diff[2] and Diff[2] > Diff[3] and Diff[3] > Diff [4];

def overboughtRSI = RSIAvg3 >= 65 and Diff > 0;
def TrendReversalalert20 = (twoBarPivotMACD1 and Highest(overboughtRSI[1], 7) > 0);
plot TrendReversal20 = 1 - (((RSIAvg3 >= 68 and RSI < RSIAvg3[2]) and RSI3OverBoughtpivit)/ 1.5) ;
plot TrendReversal20a = 1 - ((((RSIAvg3 >= 60 and RSIAvg3 < 68 )and RSI < RSIAvg3[2]) and RSI3OverBoughtpivit) / 4) ;

TrendReversal20.SetDefaultColor(GetColor(5)); #Red
TrendReversal20a.SetDefaultColor(GetColor(2)); #lt Red
plot TrendReversal50 = 1 - ((RSIAvg5 >= 70 and close < MAvgExp14) / 2) ;
TrendReversal50.SetDefaultColor(GetColor(0)); #Red
AddLabel(yes, if  TrendReversal20 < 1 then "Sell" else "");
Alert( TrendReversal20 < 1 ,  "Chart is now Overbought ", Alert.BAR, Sound.Ring);
AddLabel(TrendReversal20 < 1, "Chart is now Overbought ", Color.LIME);
input show_label = yes;
input show_bubble = no;
#--------------------------- Large 5X and 10X Volume Alert
input AverageLength = 100;
input VolumeMultiplier = 8;
input VolumeMultiplier2 = 5;
input MinutesAfterOpen = 30;

def AvgVol = Average(volume, AverageLength);
def VolX = (volume > AvgVol * VolumeMultiplier) ;
def Vol10X = (volume > AvgVol * 10) ;

Alert(VolX, Concat(GetSymbolPart(), " has a large volume spike." ), Alert.BAR, Sound.Chimes);
AddLabel(VolX > 0,  " Has 5X Volume Spike ", Color.LIGHT_GREEN);
Alert(Vol10X, Concat(GetSymbolPart(), " has a large volume spike." ), Alert.BAR, Sound.Chimes);
AddLabel(Vol10X > 0,  " Has 10X Volume Spike ", Color.LIGHT_GREEN);
#-------------------------------------GAP UP Price
def IsUp = close > open;
def IsDown = close < open;
def IsDoji = IsDoji();
def avgRange = 0.05 * Average(high - low, 20);
def GapUp =
    IsUp[1] and
    IsUp[0] and
    high[1] < low[0] and
    high[1] < open[0] and
(volume > AvgVol * 5) ;
Alert(GapUp, Concat(GetSymbolPart(), " GAPUP" ), Alert.BAR, Sound.Ring);
AddLabel(GapUp > 0,  " GAP Up  ", Color.LIGHT_GREEN);

#---------------------------------Large Price change 3%
def Priceup =
    IsUp[1] and
    IsUp[0] and
    high[1] < high[0] and
    high[2] * 1.02 < high[0] and
    high[3] * 1.03 < high[0] and
(volume > AvgVol * 3) ;
Alert(Priceup, Concat(GetSymbolPart(), " Price JUMP" ), Alert.BAR, Sound.Bell);
AddLabel(Priceup > 0,  " Price JUMP  ", Color.CYAN);

#---------------------------------HugePrice change 6%
def Priceup2 =
    IsUp[1] and
    IsUp[0] and
    high[1] < high[0] and
    high[3] * 1.04 < high[0] and
    high[4] * 1.06 < high[0] and
(volume > AvgVol * 3) ;
Alert(Priceup2, Concat(GetSymbolPart(), " JUMP! JUMP! JUMP" ), Alert.BAR, Sound.Chimes);
AddLabel(Priceup2 > 0,  " JUMP! JUMP! JUMP  ", Color.LIGHT_RED);

#-----------------------------------------------------------------------------------------
#--------------------------RSI cumulative running total
def MAvgExp7 = ExpAverage(price[-displace], 7);
def RSICalc = 50 * (ChgRatio + 1);
def RSICalc1 = if RSI > 70 then  3 else if RSI < 30 then  -3 else 0;
def RSICalc2 = if RSI[1] > 70 then  2 else if RSI[1] < 30 then  -2 else 0;
def RSICalc3 = if RSI[2] > 70 then  1 else if RSI[2] < 30 then  -1 else 0;
def RSICalc4 = if RSI[3] > 70 then  1 else if RSI[3] < 30 then  -1 else 0;
def RSICalc5 = if RSI[4] > 70 then  1 else if RSI[4] < 30 then  -1 else 0;
def RSICalc6 = if RSI[5] > 70 then  1 else if RSI[5] < 30 then  -1 else 0;
def RSICalc7 = if RSI[6] > 70 then  1 else if RSI[6] < 30 then  -1 else 0;
def RSICalc8 = if RSI[7] > 70 then  1 else if RSI[7] < 30 then  -1 else 0;
def RSICalc9 = if RSI[8] > 70 then  1 else if RSI[8] < 30 then  -1 else 0;
def RSICalc10 = if RSI[9] > 70 then  1 else if RSI[9] < 30 then  -1 else 0;
def RSICalc11 = if RSI[10] > 70 then  1 else if RSI[10] < 30 then  -1 else 0;
def RSICalc12 = if RSI[11] > 70 then  1 else if RSI[11] < 30 then  -1 else 0;
def RSICalc13 = if RSI[12] > 70 then  1 else if RSI[12] < 30 then  -1 else 0;
def RSICalc14 = if RSI[13] > 70 then  1 else if RSI[13] < 30 then  -1 else 0;
def RSICalc15 = if RSI[14] > 70 then  1 else if RSI[14] < 30 then  -1 else 0;
def RSICalc16 = if RSI[15] > 70 then  1 else if RSI[15] < 30 then  -1 else 0;
def RSICalc17 = if RSI[16] > 70 then  1 else if RSI[16] < 30 then  -1 else 0;
def RSICalc18 = if RSI[17] > 70 then  1 else if RSI[17] < 30 then  -1 else 0;
def RSICalc19 = if RSI[18] > 70 then  1 else if RSI[18] < 30 then  -1 else 0;
def RSICalc20 = if RSI[19] > 70 then  1 else if RSI[19] < 30 then  -1 else 0;
def RSICalc21 = if RSI[20] > 70 then  1 else if RSI[20] < 30 then  -1 else 0;
def RSICalc22 = if RSI[21] > 70 then  1 else if RSI[21] < 30 then  -1 else 0;
def RSICalc23 = if RSI[22] > 70 then  1 else if RSI[22] < 30 then  -1 else 0;
def RSICalc24 = if RSI[23] > 70 then  1 else if RSI[23] < 30 then  -1 else 0;
def RSICalc25 = if RSI[24] > 70 then  1 else if RSI[24] < 30 then  -1 else 0;
def RSICalc26 = if RSI[25] > 70 then  1 else if RSI[25] < 30 then  -1 else 0;
def RSICalc27 = if RSI[26] > 70 then  1 else if RSI[26] < 30 then  -1 else 0;
def RSICalc28 = if RSI[27] > 70 then  1 else if RSI[27] < 30 then  -1 else 0;
def RSICalc29 = if RSI[28] > 70 then  1 else if RSI[28] < 30 then  -1 else 0;
def RSICalc30 = if RSI[29] > 70 then  1 else if RSI[29] < 30 then  -1 else 0;

def RSI30DayAvg = RSICalc1 + RSICalc2 + RSICalc3 + RSICalc4 + RSICalc5 + RSICalc6 + RSICalc7 + RSICalc8 + RSICalc9 + RSICalc10 + RSICalc11 + RSICalc12 + RSICalc13 + RSICalc14 + RSICalc15 + RSICalc16 + RSICalc17 + RSICalc18 + RSICalc19 + RSICalc20 + RSICalc21 + RSICalc22 + RSICalc23 + RSICalc24 + RSICalc25 + RSICalc26 + RSICalc27 + RSICalc28 + RSICalc29 + RSICalc30;
AddLabel(RSI30DayAvg >= 10 and RSI30DayAvg < 20, " RSI SELL: " + RSI30DayAvg + "   ",  Color.ORANGE);
AddLabel(RSI30DayAvg >= 20, " RSI SELL: " + RSI30DayAvg + "   ",  Color.RED);
AddLabel(RSI30DayAvg <= -10 and RSI30DayAvg > -20, " RSI BUY: " + RSI30DayAvg + "   ",  Color.LIME);
AddLabel(RSI30DayAvg <= -20, " RSI BUY: " + RSI30DayAvg + "   ",  Color.DARK_GREEN);
plot TrendReversal5 = 1 - (((RSI30DayAvg >= 10 and RSI30DayAvg < 15) and close < MAvgExp7) / 2) ;
TrendReversal5.SetDefaultColor(GetColor(0)); #magenta
plot TrendReversal5a = 1 - (((RSI30DayAvg >= 16  and RSI30DayAvg < 25) and close < MAvgExp7) / 1.3) ;
TrendReversal5a.SetDefaultColor(GetColor(0)); #magenta
plot TrendReversal5b = 1 - ((RSI30DayAvg >= 25 and close < MAvgExp7) / 1.05) ;
TrendReversal5b.SetDefaultColor(GetColor(0)); #magenta
plot TrendReversal6 = ((RSI30DayAvg <= -15 and close > MAvgExp7 ) * .3) ;
TrendReversal6.SetDefaultColor(GetColor(6)); #green
plot TrendReversal6a = (((RSI30DayAvg <= -20 and RSI30DayAvg > -30) and close > MAvgExp7) * .85) ;
TrendReversal6a.SetDefaultColor(GetColor(6)); #green
#End Code
 
No problem with putting the original back up. Green You have 3 lines that look like averages within the Deepwater lower levels. How did you turn them on? Like 3 extra plots
 
I was looking at the 5min time frame on LRCX Show a Green spike but the chart is trending down at 13:00 is that a false signal? Then at 10:15 the previous day there is not signal but a big move up. just trying to understand how it works all together. TY sir!!
 
I was looking at the 5min time frame on LRCX Show a Green spike but the chart is trending down at 13:00 is that a false signal? Then at 10:15 the previous day there is not signal but a big move up. just trying to understand how it works all together. TY sir!!
I get NO Green Candles on LRCX on any 1Min, 2Min or 5Min chart settings. I get a small yellow spike around 11:30AM EST today. Now I am using the Newest Code off page 1. If you load the 5/17 code you get a green spike. This is why I tightened the code controlling a strong buy.
 
Last edited:
No problem with putting the original back up. Green You have 3 lines that look like averages within the Deepwater lower levels. How did you turn them on? Like 3 extra plots
Thats actually the BuyTheDip indicator which is a premium indicator on usethinkscript. I just put your indicator and BuyTheDip in the same area to save space but also to line up buy signals from both indicators.
 
Hi Deepwater,
Were you ever able to solve the issue with the exit signals when price is in a downtrend?
I can't really think of any parameters to use to discriminate. The only thing I can think of is if I give a strong buy signal in the code and within so many bars price falls (lets say 1%) then give a Sell signal as a stop loss as the price moves against the buy point. Now that i tightened by Buy signal criteria up I don't get as many false buys of course you can miss some buy opportunities which is why some of the gang like the original code that gives more buys and sells. It is why you use several different Studies for signals. The problem I see is we all use the same variations of signals to trigger buys and sells whether it be Price or RSI or Macd and formulas are as good as the input. As far as Buying when price is falling that for me is the time to buy, at lower prices. So if prices go even lower seems like the stock is at an even bigger bargin. Now folks have to pick no more than 20 or 30 stocks and get very familiar with them, know how they act, what trading ranges they operate in, is any news coming that can effect stock price. No way to code for that.
 
Last edited:
Small Update to the Page 1 code to loosen Strong Sell Signal generation. Calling it Rev 4. You should get more Strong Sells (large Red Spike Down) vice a little red spike indicating overbought
 
I can't really think of any parameters to use to discriminate. The only thing I can think of is if I give a strong buy signal in the code and within so many bars price falls (lets say 1%) then give a Sell signal as a stop loss as the price moves against the buy point. Now that i tightened by Buy signal criteria up I don't get as many false buys of course you can miss some buy opportunities which is why some of the gang like the original code that gives more buys and sells. It is why you use several different Studies for signals. The problem I see is we all use the same variations of signals to trigger buys and sells whether it be Price or RSI or Macd and formulas are as good as the input. As far as Buying when price is falling that for me is the time to buy, at lower prices. So if prices go even lower seems like the stock is at an even bigger bargin. Now folks have to pick no more than 20 or 30 stocks and get very familiar with them, know how they act, what trading ranges they operate in, is any news coming that can effect stock price. No way to code for that.
Hi Deepwater!
I understand the dilemma. Its a difficult one to code for. You may consider trying to define the overall trend environment and apply different thresholds for the signals to fire based on the environment (just a thought). Anyhow, just wanted to check back with you and see how things were progressing. Hope you are doing well.
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
418 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