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

TradingView to ThinkScript scan request - DIRECTOR Tops/Bottoms by LARP_Capital

xcmsx

New member
2019 Donor
Can anyone convert this code to thinkscript?

It will show potential zones to buy in anytimeframe


length=input(89)
ValC=rma(close, length)

bull=input(-1.0, title="Bullish")
bear=input(.8, title="Bearish")
vol=sma(atr(length), length)
cvi = (close-ValC) / (vol*sqrt(length))
cb= cvi <= bull ? green : cvi >=bear ? red : cvi > bull ? blue : cvi < bear ? blue : na
bull1 = cvi <= bull
bear1 = cvi >= bear
bull2 = bull1[1] and not bull1
bear2 = bear1[1] and not bear1
plotchar(bull2, char="*", location=location.belowbar, color=lime, size=size.normal)
plotchar(bear2, char="*", location=location.abovebar, color=red, size=size.normal)


global_alert = bull2 or bear2

//alertcondition(bull2, "Directors BOTTOM", "BOTTOM")
//alertcondition(bear2, "Directors TOP", "TOP")


alertcondition(bull2, "Director's TOP/Bottom", "{{length}} Director's TOP/Bottom")
 

rad14733

Well-known member
VIP
@xcmsx Do you have an image of the indicator and a link back to the original source...??? We don't generally convert indicators from other platforms simply based on a members request... Very few requests ever get fulfilled... Usually a member here has already done the conversion or there is ample interest in an indicator not already present here... Just posting code won't garner any interest...
 

xcmsx

New member
2019 Donor
@xcmsx Do you have an image of the indicator and a link back to the original source...??? We don't generally convert indicators from other platforms simply based on a members request... Very few requests ever get fulfilled... Usually a member here has already done the conversion or there is ample interest in an indicator not already present here... Just posting code won't garner any interest...
Yes here is the link to original indicator:

https://www.tradingview.com/script/9W51KkxT-Tops-Bottoms/

And here is a link to an image

https://ibb.co/2cRzbvY

Hopefully people will be interested

Thanks!
 

cos251

Well-known member
Hopefully this is what you are looking for. A lot of arrows!
oC4mx9B.png


Code:
# --- FVO_LARP_Port_Shared
#
#
#    2021.06.15    v1.0    @cos251    Version 1.0 initial draft based on request - TOS Version
#
#
#CREDITS
# - Request - https://usethinkscript.com/threads/tradingview-to-thinkscript-scan-request-director-tops-bottoms-by-larp_capital.6889/
# - From @xcmsx
# - https://www.tradingview.com/script/9W51KkxT-Tops-Bottoms/
###############################################################################################
declare upper;


input length = 3;
def valc = MovingAverage(AverageType.SIMPLE, hl2, length);

input bullish = -.51;
input bearish = .43;

def vol = MovingAverage(AverageType.SIMPLE, ATR(length), length);
def cvi = (close - valc) / (vol * Sqrt(length));


plot u = if cvi > bullish and cvi[1] < bullish then low else Double.NaN;
u.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
plot d =  if cvi < bearish and cvi[1] > bearish then high else Double.naN;
d.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

Thankfully this is an easy one, just two calculations and all the work is already done in the original. Use and modify as you see fit.
 

xcmsx

New member
2019 Donor
Hopefully this is what you are looking for. A lot of arrows!
oC4mx9B.png


Code:
# --- FVO_LARP_Port_Shared
#
#
#    2021.06.15    v1.0    @cos251    Version 1.0 initial draft based on request - TOS Version
#
#
#CREDITS
# - Request - https://usethinkscript.com/threads/tradingview-to-thinkscript-scan-request-director-tops-bottoms-by-larp_capital.6889/
# - From @xcmsx
# - https://www.tradingview.com/script/9W51KkxT-Tops-Bottoms/
###############################################################################################
declare upper;


input length = 3;
def valc = MovingAverage(AverageType.SIMPLE, hl2, length);

input bullish = -.51;
input bearish = .43;

def vol = MovingAverage(AverageType.SIMPLE, ATR(length), length);
def cvi = (close - valc) / (vol * Sqrt(length));


plot u = if cvi > bullish and cvi[1] < bullish then low else Double.NaN;
u.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
plot d =  if cvi < bearish and cvi[1] > bearish then high else Double.naN;
d.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

Thankfully this is an easy one, just two calculations and all the work is already done in the original. Use and modify as you see fit.

Thank you so much!! Yeah a lot of arrows on lower time frames, for me this will be 2 hr minimum
 

Similar threads

Top