Join useThinkScript to post your question to a community of 21,000+ developers and traders.
thanks for the input, i have to admit that while I understand the concepts, this level of code is too advanced for my skills
Thank you for all the work and sharing this with us! It's truly cool and amazing!@darkelvis
ya, its definitely a cool idea. Im gonna mess around with it and see if its possible
def Indicator = f();
plot f_prime = ATan((f - f[1])/1) * 180 / Double.Pi;
plot zero = 0;
#
# TD Ameritrade IP Company, Inc. (c) 2012-2021
#
declare lower;
input price = close;
input length = 30;
input slowingLength = 5;
input over_bought = 60;
input over_sold = 30;
def rainbow = reference RainbowAverage(price = price, averageType = AverageType.WEIGHTED);
plot Stochastic = sum(rainbow - Lowest(rainbow, length), slowingLength) / (sum(Highest(rainbow, length) - Lowest(rainbow, length), slowingLength) + 0.0001) * 100;
def normStochRainbow = 0.1 * (Stochastic - 50);
plot IFT = 100 / (1 + exp(-2 * normStochRainbow));
plot OverBought = over_bought;
plot OverSold = over_sold;
Stochastic.SetDefaultColor(GetColor(1));
IFT.SetDefaultColor(GetColor(2));
OverBought.setDefaultColor(GetColor(5));
OverSold.setDefaultColor(GetColor(5));
#Assembled by FateOwnzYou on UseThinkscript.com
declare lower;
Input Price_Color = yes;
Input Sensitivity = 1;
Input Reversal_Warning_Candle = yes;
Input Reversal_Warning = 8;
Input AverageLine = yes;
Input HighVolume = yes;
Input VolumeAveragingLength = 20;
Input VolumePercentThreshold = 60;
Plot _High = 9;
Plot CautionHigh = Reversal_Warning;
Plot _Low = -9;
Plot CautionLow = (Reversal_Warning)*-1;
Plot Zero = 0;
##Stochastics
Def S1 = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01;
Def S2 = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01;
Def S3 = Max(-100, Min(100, reference RSI(2)) - 50) / 50.01;
Plot Bull =(expAverage((S1 + S2 + S3)/3,Sensitivity))*10;
Def SpdChng = if Bull < 1.5 then ((movingAverage(averageType.Weighted, Bull, 20))-1.5) else ((movingAverage(averageType.Weighted, Bull, 10))-1.5) ;
plot Bear = (SpdChng - Bull);
plot middle = if AverageLine then((bull - bear)/2)+bear else double.nan;
##Reversals
Plot Top = if Bull > Reversal_Warning then Bull else double.nan;
Plot Bottom = if Bull < (Reversal_Warning)*-1 then Bull else double.nan;
##High Volume
def aVol = Average(volume, volumeAveragingLength);
def pVol = 100 * ((volume - aVol[1]) /aVol[1]);
def pDot = pVol >= volumePercentThreshold;
#Paint
zero.assignValueColor(if pDot and HighVolume then color.CYAN else color.current);
zero.setlineWeight(2);
middle.setdefaultColor(color.white);
Bottom.setdefaultColor(Color.yellow);
Bottom.setPaintingStrategy(paintingStrategy.POINTS);
Bottom.setlineWeight(3);
Top.setdefaultColor(Color.yellow);
Top.setPaintingStrategy(paintingStrategy.POINTS);
Top.setlineWeight(3);
_High.setdefaultColor(color.gray);
_Low.setdefaultColor(color.gray);
Zero.setdefaultColor(color.gray);
Cautionhigh.setdefaultColor(color.gray);
Cautionlow.setdefaultColor(color.gray);
Bear.assignValueColor(color.red);
Bull.assignvalueColor(color.green);
Bear.assignValueColor(color.red);
Bull.assignvalueColor(color.green);
addLabel(yes, if Bull > Bear then "LONG BABY" else "SHORT IT", if Bull > Bear then Color.Green else color.red);
assignpriceColor(if Price_Color AND Bull > Bear then color.green else color.current);
assignpriceColor(if Price_Color AND Bull < Bear then color.red else color.current);
assignpriceColor(if Reversal_Warning_Candle AND Bull > Reversal_Warning then color.blue else color.current);
assignpriceColor(if Reversal_Warning_Candle AND Bull < (Reversal_Warning)*-1 then color.blue else color.current);
addcloud(cautionhigh,_high,color.yellow, color.yellow);
addcloud(cautionlow,_low,color.yellow, color.yellow);
Very compelling set. Is there any way to add a P & L report?
Caveats:
Backtesting results can be unreliable and do not guarantee similar future live trading performances.
No one indicator should be traded upon in isolation. Read more about creating best strategies --> https://usethinkscript.com/threads/answers-to-commonly-asked-questions.6006/#post-58708
#https://usethinkscript.com/threads/savage-oscillator.4214/
#Assembled by FateOwnzYou on UseThinkscript.com
# This is a STRATEGY version CAN ONLY BE USED WHEN LOADED IN THE STRATEGY TAB
Input Sensitivity = 1;
Input Reversal_Warning = 8;
Input AverageLine = yes;
##Stochastics
Def S1 = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01;
Def S2 = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01;
Def S3 = Max(-100, Min(100, reference RSI(2)) - 50) / 50.01;
def Bull =(expAverage((S1 + S2 + S3)/3,Sensitivity))*10;
Def SpdChng = if Bull < 1.5 then ((movingAverage(averageType.Weighted, Bull, 20))-1.5) else ((movingAverage(averageType.Weighted, Bull, 10))-1.5) ;
def Bear = (SpdChng - Bull);
def middle = if AverageLine then((bull - bear)/2)+bear else double.nan;
##Reversals
Plot Top = if Bull > Reversal_Warning then high else double.nan;
Plot Bottom = if Bull < (Reversal_Warning)*-1 then low else double.nan;
Bottom.setdefaultColor(Color.blue);
Bottom.setPaintingStrategy(paintingStrategy.ARROW_UP);
Bottom.setlineWeight(1);
Top.setdefaultColor(Color.magenta);
Top.setPaintingStrategy(paintingStrategy.ARROW_DOWN);
Top.setlineWeight(1);
# ########################################################
#Order Management
AddOrder(OrderType.BUY_AUTO, Bottom, tickcolor = Color.YELLOW, arrowcolor = Color.BLACK, name = "Buy", tradeSize = 100);
AddOrder(OrderType.SELL_TO_CLOSE, Top, tickcolor = Color.PINK, arrowcolor = Color.RED, name = "sell", tradeSize = 100);
# ########################################################
# ########################################################
# FPL Extended
# Author: Eddielee394
#Globals
DefineGlobalColor("LabelGreen", CreateColor(0, 190, 0)) ;
DefineGlobalColor("LabelRed", CreateColor(225, 0, 0)) ;
############################
#Globals
def nan = Double.NaN ;
def bn = if !IsNaN(close) and !IsNaN(close[1]) and !IsNaN(close[-1]) then BarNumber() else bn[1];
#Inputs
input fplBegin = 0000;
#hint fplBegin: start time: the time in which then dailyHighLow profit should consider the day start. Recommended value is 0000.
input fplTargetWinLoss = .50;
#hint fplTargetWinLoss: sets the target winlossRatio (in percent) which determines display colors of the W/L label.
input fplTargetWinRate = 1;
#hint fplTargetWinRate: sets the target winRate (float) which determines display colors of the WinRate label;
input fplHidePrice = no;
#hint fplHidePrice: hide's the underlying price graph. \nDefault is no.
input fplHideFPL = yes;
#hint fplHideFPL: hide's the underlying P&L graph.\nDefault is yes.
input fplShowEntryBubbles = no;
#hint fplShowEntryBubbles: display bubbles on the FPL showing the entry and exit P&L values
input fplEnableDebugging = no;
#hint fplEnableDebugging: displays various debugging labels and chart bubbles. \nIt's recommended to hide the price chart & set the fpl hide fpl setting to yes, when enabling.
#temp input var references
def begin = fplBegin;
def targetWinLoss = fplTargetWinLoss;
def targetWinRate = fplTargetWinRate;
def hidePrice = fplHidePrice;
def hideFPL = fplHideFPL;
def showEntryBubbles = fplShowEntryBubbles;
def enableDebugging = fplEnableDebugging;
#hide chart candles
HidePricePlot(hidePrice);
#Plot default Floating P&L
plot FPL = FPL();
FPL.SetPaintingStrategy(PaintingStrategy.SQUARED_HISTOGRAM);
FPL.DefineColor("Positive and Up", Color.GREEN);
FPL.DefineColor("Positive and Down", Color.DARK_GREEN);
FPL.DefineColor("Negative and Down", Color.PINK);
FPL.DefineColor("Negative and Up", Color.DARK_RED);
FPL.AssignValueColor(if FPL >= 0
then if FPL > FPL[1]
then FPL.Color("Positive and Up")
else FPL.Color("Positive and Down")
else if FPL < FPL[1]
then FPL.Color("Negative and Down")
else FPL.Color("Negative and Up"));
FPL.SetHiding(hideFPL);
Based on this it shows multiple buy indicators and sell indicators but wincount shows 3 and loss shows 1. I've read through post 1 a couple times and as far as I can tell the buy indicator is right after the blue candle, or arrow in your screen shot. What am I missing?Savage Oscillator Reversals STRATEGY VERSION
This is a STRATEGY version of the upper indicator as found in post#1. IT MUST BE SAVED UNDER THE STRATEGY TAB.
It has been designed for backtesting purposes.
Based on this it shows multiple buy indicators and sell indicators but wincount shows 3 and loss shows 1. I've read through post 1 a couple times and as far as I can tell the buy indicator is right after the blue candle, or arrow in your screen shot. What am I missing?
Thanks
Spot On! Thank You
I'm loving the indicator, but the light green price color in the sample photos looks really helpful for a panicky trader like myself. What can I edit into the scanner in order to get that price color set up? I take it that green stands for price increase, light green stands for a pullback in price, and red stands for a more serious price decrease.I have made a Momentum Oscillator that I have tried to make it to where it gets you in an out as quickly as possible. It is basically a Bearish Line and Bullish line that will cross depending on price action.
Sensitivity: You can change Sensitivity to whatever suits your trading method. At default I have it set to 1, but ive come to realize that some prefer 3 or 4 to get a smoother line and less consolidation signals. The Higher the number, the smoother it will get, but also the more delayed it will be
Price Color: Yes or No, this will change the color of the price action to show trends. Green up, Red down
Reversal Warning Candle: This will change the color of price action of JUST the candles that are overbought or oversold on the oscillator. These indicate potential reversals. Once the blue goes away is about the time to enter
Reversal Warning: This is the setting that will change the sensitivity of the reversal signals. You will set this setting from 1 to 10. 1 being the weakest and most signals, 10 being the strongest and minimal signals. I have defaulted this to 8. I would recommend 7 to 9 depending on what you want.
Below The pictures I have the Main Script that will give you the lower oscillator, along with option of changing candle color for trends and reversals.
Then a standalone Arrow indicator that will show just the arrows for the reversals
Then I will also have a Script JUST for Candle color change.
EDIT: I have also just added a full upper version for the reversals on price action. When approaching the outer walls could be nearing a reversal.
It has the option for the high volume (as requested) and will be displayed by changing the color of the midline.
Also has multi-Timeframe capabilities with option to turn off or on if desired
(This script will be posted in the end of this Post)
Savage_Oscillator
Code:#https://usethinkscript.com/threads/savage-oscillator.4214/ #Assembled by FateOwnzYou on UseThinkscript.com declare lower; Input Price_Color = yes; Input Sensitivity = 1; Input Reversal_Warning_Candle = yes; Input Reversal_Warning = 8; Input AverageLine = yes; Input HighVolume = yes; Input VolumeAveragingLength = 20; Input VolumePercentThreshold = 60; Plot _High = 9; Plot CautionHigh = Reversal_Warning; Plot _Low = -9; Plot CautionLow = (Reversal_Warning)*-1; Plot Zero = 0; ##Stochastics Def S1 = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01; Def S2 = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01; Def S3 = Max(-100, Min(100, reference RSI(2)) - 50) / 50.01; Plot Bull =(expAverage((S1 + S2 + S3)/3,Sensitivity))*10; Def SpdChng = if Bull < 1.5 then ((movingAverage(averageType.Weighted, Bull, 20))-1.5) else ((movingAverage(averageType.Weighted, Bull, 10))-1.5) ; plot Bear = (SpdChng - Bull); plot middle = if AverageLine then((bull - bear)/2)+bear else double.nan; ##Reversals Plot Top = if Bull > Reversal_Warning then Bull else double.nan; Plot Bottom = if Bull < (Reversal_Warning)*-1 then Bull else double.nan; ##High Volume def aVol = Average(volume, volumeAveragingLength); def pVol = 100 * ((volume - aVol[1]) /aVol[1]); def pDot = pVol >= volumePercentThreshold; #Paint zero.assignValueColor(if pDot and HighVolume then color.CYAN else color.current); zero.setlineWeight(2); middle.setdefaultColor(color.white); Bottom.setdefaultColor(Color.yellow); Bottom.setPaintingStrategy(paintingStrategy.POINTS); Bottom.setlineWeight(3); Top.setdefaultColor(Color.yellow); Top.setPaintingStrategy(paintingStrategy.POINTS); Top.setlineWeight(3); _High.setdefaultColor(color.gray); _Low.setdefaultColor(color.gray); Zero.setdefaultColor(color.gray); Cautionhigh.setdefaultColor(color.gray); Cautionlow.setdefaultColor(color.gray); Bear.assignValueColor(color.red); Bull.assignvalueColor(color.green); Bear.assignValueColor(color.red); Bull.assignvalueColor(color.green); addLabel(yes, if Bull > Bear then "Bullish" else "Bearish", if Bull > Bear then Color.Green else color.red); assignpriceColor(if Price_Color AND Bull > Bear then color.green else color.current); assignpriceColor(if Price_Color AND Bull < Bear then color.red else color.current); assignpriceColor(if Reversal_Warning_Candle AND Bull > Reversal_Warning then color.blue else color.current); assignpriceColor(if Reversal_Warning_Candle AND Bull < (Reversal_Warning)*-1 then color.blue else color.current); addcloud(cautionhigh,_high,color.yellow, color.yellow); addcloud(cautionlow,_low,color.yellow, color.yellow);
Savage_Oscillator_Arrows (Stand Alone Arrows)
Code:#https://usethinkscript.com/threads/savage-oscillator.4214/ #Assembled by FateOwnzYou on UseThinkscript.com Input Sensitivity = 1; Input Reversal_Warning = 8; Input Label = yes; #Stochastics Def S1 = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01; Def S2 = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01; Def S3 = Max(-100, Min(100, reference RSI(2)) - 50) / 50.01; def Bull =(expAverage((S1 + S2 + S3)/3,Sensitivity))*10; Def SpdChng = if Bull < 1.5 then ((movingAverage(averageType.Weighted, Bull, 20))-1.5) else ((movingAverage(averageType.Weighted, Bull, 10))-1.5) ; def Bear = (SpdChng - Bull); Plot Top = Bull > Reversal_Warning; Plot Bottom = if Bull < (Reversal_Warning)*-1 then Bull else double.nan; #Paint Bottom.setdefaultColor(Color.Blue); Bottom.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP); Bottom.setlineWeight(3); Top.setdefaultColor(Color.Blue); Top.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN); Top.setlineWeight(3); addLabel(Label, if Bull > Bear then "Bullish" else "Bearish", if Bull > Bear then Color.Green else color.red);
Savage_Oscillator_Upper (Stand Alone Candle Color Change)
Code:#https://usethinkscript.com/threads/savage-oscillator.4214/ #Assembled by FateOwnzYou on UseThinkscript.com input Sensitivity = 1; Input Reversal_Warning = 8; input Label = yes; Input HighVolume = yes; input volumeAveragingLength = 20; input volumePercentThreshold = 50; def s1 = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01; def s2 = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01; def s3 = Max(-100, Min(100, reference RSI(2)) - 50) / 50.01; def Bull =expAverage((s1 + s2 + s3)/3,sensitivity)*10; def avg = if bull < 1.5 then ((movingAverage(averageType.Weighted, bull, 20))-1.5) else ((movingAverage(averageType.Weighted, bull, 10)))-1.5 ; def Bear = (avg - bull); def aVol = Average(volume, volumeAveragingLength); def pVol = 100 * ((volume - aVol[1]) /aVol[1]); def pDot = pVol >= volumePercentThreshold; plot volumeStrength = if pDot and (Bull or Bear) and HighVolume then hl2 else Double.NaN; addLabel(Label, if Bull > Bear then "Bullish" else "Bearish", if Bull > Bear then Color.Green else color.red); volumeStrength.SetPaintingStrategy(PaintingStrategy.POINTS); volumeStrength.SetLineWeight(3); volumeStrength.SetDefaultColor(color.cyan); volumeStrength.hideBubble(); assignpriceColor(if Bull > Bear then color.GREEN else color.current); assignpriceColor(if Bull < Bear then color.RED else color.current); assignpricecolor(if Bull > Reversal_Warning then color.BLUE else color.current); assignpricecolor(if Bull < (Reversal_Warning *-1) then color.BLUE else color.current);
Savage_Watchlist
Code:Input Sensitivity = 1; Input Reversal_Warning = 8; ##Stochastics Def S1 = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01; Def S2 = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL))) - 50) / 50.01; Def S3 = Max(-100, Min(100, reference RSI(2)) - 50) / 50.01; def Bull =(expAverage((S1 + S2 + S3)/3,Sensitivity))*10; Def SpdChng = if Bull < 1.5 then ((movingAverage(averageType.Weighted, Bull, 20))-1.5) else ((movingAverage(averageType.Weighted, Bull, 10))-1.5) ; def Bear = (SpdChng - Bull); def middle = ((bull - bear)/2)+bear; def condition1 = Bull > Reversal_Warning; def condition2 = Bull < (Reversal_Warning * -1); def crossing = middle + 1; def crossing2 = middle - 1; def between1 = middle > crossing2 and middle < crossing; addLabel(yes, if condition1 or condition2 then "Reversal" else concat("",Bull), if condition1 or condition2 then color.black else if bull > 1.5 then color.Light_Green else if bull < -1.5 then color.Light_Red else if between1 then color.orange else color.current); assignbackgroundcolor(if condition1 then color.light_red else if condition2 then color.light_green else color.current);
EDIT: I have also added this MultiTimeframe Price action Savage Bands
Picture and script below
Code:#The Official Savage Bands #https://usethinkscript.com/threads/savage-oscillator.4214/ #Assembled by FateOwnzYou on UseThinkscript.com ###MTF### input Sensitivity = 1; input Distance = 5; input Smoothness = 7; input MTF = yes; input currentTF = no; input TimeFrame = aggregationPeriod.DAY; input HighVolume = no; input volumeAveragingLength = 20; input volumePercentThreshold = 50; def S1_MTF = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL, priceh = high(period=TimeFrame), pricel = low(period=TimeFrame), pricec = close(period=TimeFrame)))) - 50) / 50.01; def S2_MTF = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL, priceh = high(period=TimeFrame), pricel = low(period=TimeFrame), pricec = close(period=TimeFrame)))) - 50) / 50.01; def S3_MTF = Max(-100, Min(100, reference RSI(2, price = close(period=timeframe)))- 50) / 50.01; def savage_MTF = (ExpAverage((S1_MTF + S2_MTF + S3_MTF) / 3, Sensitivity)) * 10; def bottom_MTF = Min(close(period=TimeFrame)[1], low(period=TimeFrame)); def tr_MTF = TrueRange(high(period=TimeFrame), close(period=TimeFrame), low(period=TimeFrame)); def ptr_MTF = tr_MTF / (bottom_MTF + tr_MTF / 2) * 100; def APTR_MTF = (MovingAverage(AverageType.WILDERS, ptr_MTF, 14))*Distance; def LowLine_MTF = ((0.0625*(((APTR_MTF*close(period=TimeFrame))/100)*-1))*(savage_MTF+7.75))+close(period=TimeFrame); def HighLine_MTF = ((0.01*((APTR_MTF*close(period=TimeFrame))/100))*((-6.25*savage_MTF)+51.5625))+close(period=TimeFrame); plot SmoothedLow_MTF = if MTF then (movingaverage(data = LowLine_MTF, averageType = AverageType.WEIGHTED, length = Smoothness)) else double.nan; smoothedlow_MTF.setdefaultColor(color.red); plot SmoothedHigh_MTF = if MTF then (movingaverage(data = HighLine_MTF, averageType = AverageType.WEIGHTED, length = Smoothness)) else double.nan; smoothedhigh_MTF.setdefaultColor(color.red); def aVol_MTF = Average(volume(period = TimeFrame), volumeAveragingLength); def pVol_MTF = 100 * ((volume(period = TimeFrame) - aVol_MTF[1]) /aVol_MTF[1]); def pDot_MTF = pVol_MTF >= volumePercentThreshold; #plot volumeStrength = if pDot and HighVolume then hl2 else Double.NaN; plot MidLine_MTF = ((SmoothedHigh_MTF - SmoothedLow_MTF)/2)+SmoothedLow_MTF; MidLine_MTF.assignvalueColor(if pdot_MTF and HighVolume and MTF then color.yellow else color.red); ### End MTF #Stochastics def S1 = Max(-100, Min(100, (StochasticFull(KPeriod = 8, slowing_period = 5, averageType = AverageType.EXPONENTIAL, priceh = high, pricel = low, pricec = close))) - 50) / 50.01; def S2 = Max(-100, Min(100, (StochasticFull(KPeriod = 17, slowing_period = 5, averageType = AverageType.EXPONENTIAL, priceh = high, pricel = low, pricec = close))) - 50) / 50.01; def S3 = Max(-100, Min(100, reference RSI(2, price = close))- 50) / 50.01; def savage = (ExpAverage((S1 + S2 + S3) / 3, Sensitivity)) * 10; def bottom = Min(close[1], low); def tr = TrueRange(high, close, low); def ptr = tr / (bottom + tr / 2) * 100; def APTR = (MovingAverage(AverageType.WILDERS, ptr, 14))*Distance; def LowLine = ((0.0625*(((APTR*close)/100)*-1))*(savage+7.75))+close; def HighLine = ((0.01*((APTR*close)/100))*((-6.25*savage)+51.5625))+close; plot SmoothedLow = if CurrentTF then (movingaverage(data = LowLine, averageType = AverageType.WEIGHTED, length = Smoothness)) else double.nan; smoothedlow.setdefaultColor(color.cyan); plot SmoothedHigh = if CurrentTF then (movingaverage(data = HighLine, averageType = AverageType.WEIGHTED, length = Smoothness)) else double.nan; smoothedhigh.setdefaultColor(color.cyan); def aVol = Average(volume, volumeAveragingLength); def pVol = 100 * ((volume - aVol[1]) /aVol[1]); def pDot = pVol >= volumePercentThreshold; plot MidLine = ((SmoothedHigh - SmoothedLow)/2)+SmoothedLow; MidLine.assignvaluecolor(if pdot and HighVolume then color.yellow else color.cyan);
# clouds
input enable_cloud = yes;
AddCloud(if enable_cloud then bull else double.nan, if enable_cloud then bear else double.nan, Color.GREEN, Color.RED);
Start a new thread and receive assistance from our community.
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.
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.