• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

Standalone Williams Percent Arrows

Skulzgar

New member
VIP
Similar to the Savage Oscillator Arrows (Stand Alone Arrows) - https://usethinkscript.com/threads/savage-oscillator-for-thinkorswim.4214/

Was wondering if anyone is able to create a Williams Percent Stand Alone Arrows - Arrow up when it hits a certain number (negative_onehundred or if you can just manually plot it to any number) and an Arrow down when it hits a certain number (zerobase or if you can just manually plot to any number)?

I took a stab at this myself but I had a gazillion arrows and lines flying off my screen and into my living reality to where you could literally touch them -- it was a scene man. Alright, thanks in advance

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2020
#

declare lower;

input length = 10;
input overBought = -10;
input overSold = -90;

def hh = Highest(high, length);
def ll = Lowest(low, length);
def result = if hh == ll then -100 else (hh - close) / (hh - ll) * (-100);

plot WR = if result > 0 then 0 else result;
WR.SetDefaultColor(GetColor(1));

plot Over_Sold = overSold;
Over_Sold.SetDefaultColor(GetColor(8));

plot Over_Bought = overBought;
Over_Bought.SetDefaultColor(GetColor(8));

plot negative_fifty = -50;
plot negative_onehundred = -100;
plot zerobase = 0;

AddCloud(zerobase, Over_bought);
AddCloud(over_sold, negative_onehundred);
 

BenTen

Administrative
Staff
VIP
Add this to the bottom of your script:

Code:
def condition1 = WR crosses below over_bought;
def condition2 = WR crosses above over_sold;

plot bearish = if condition1 then over_bought else double.nan;
plot bullish = if condition2 then over_sold else double.nan;

bullish.SetDefaultColor(Color.UPTICK);
bullish.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
bearish.SetDefaultColor(Color.DOWNTICK);
bearish.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
 

Similar threads

Top