GreatStockMark

Upside Reversals

GreatStockMark Atualizado   
Upside reversal is noticed when a stock first dips below the prior week's low, then rallies in heavy trade to close either with a gain or with a much-reduced loss. Upside reversal can be identified with following condition:

A stock falls in heavy volume but bounces back, ending up for the day or week
OR
A stock falls in heavy volume but at least it finishes in the upper 60% of its trading range for the day or week

Upside reversal can be applied on day or week but if it is on weekly, it is a strong indication that institutions may be pumping money as they think stock is a bargain. This script is the approximate conversion of Richard Moglen's TC2000 scripts in TradingView. Search YouTube for his video on 'Upside Reversal'

This indicator, evaluates following conditions and print the arrow down label with percentage of reversal
Stoc(1,1) should be higher than 60%;
AND today's close is above 60% range;
AND today's low is lesser than yesterday;
AND Stoc(5,2,1) is lesser than 65

You can change inputs from Stoc(5,2,1) to Stoc(10,4,1) based on your need.

NOTE:
1) I still see some false positives so be aware of it.
2) It is absolutely possible to have an Upside reversal on down trend also. Please look for confirmation following day on the trend before act on it.
3) Volume level is not validated in the indicator, so you need to include it in the chart and check it.
4) This is still an experimental script & published for educational purpose only
Notas de Lançamento:
UPDATE: Added new switch to turn off the labels & to select background and text colors for label.

Here is the complete scirpt:

//@version=4
study("Upside Reversals", overlay = true, max_labels_count=100)
//Input parameters. This can be changed from 5,2,1 to 10,4,2
kPeriod = input(5, minval=1, title="Upside Reversal - K Period")
dPeriod = input(2, title="Upside Reversal - D Period")
smoothK = input(1, title="Upside Reversal - smooth K")
showLabels = input(true, title="Show Labels", type = input.bool)
color c_indicator = input(color.purple, "Indicator Color", type = input.color)
color c_labeltext = input(color.white, "Label Text", type = input.color)

// truncate() truncates a given number to a certain number of decimals
truncate(number, decimals) =>
factor = pow(10, decimals)
int(number * factor) / factor

//Get the stoc K value
k = sma(stoch(close, high, low, kPeriod), smoothK)
stoc5_2_1 = sma(k, dPeriod)

// Get the stoc(1,1)
stoc1_1 = sma(stoch(close, high, low, 1), 1)

//Daily range close calculation
val = (close-low)/(high-low)

//today's low is lesser than yesterday's low then lowfactor is -ve
lowfactor = low - low
//Text to print the % of reversal to range
revPercent = truncate((val*100),2)
Textval = tostring(revPercent)+"%"

//Evaluate the conditions and print the label
//stoc1_1 should be higher than 60%;
// AND today's close is above 60% range;
// AND today's low is lesser than yesterday;
// AND stoc5_2_1 is lesser than 65 then display the Upside Reversal Label
if (stoc1_1 > 60 and val > 0.6 and lowfactor < 0 and stoc5_2_1 < 65)
if showLabels
label1 = label.new(bar_index, low-2, text=Textval, style=label.style_labelup, color=c_indicator)
label.set_textcolor(label1,c_labeltext)
else
label1 = label.new(bar_index, low-2, style=label.style_labelup, color=c_indicator)
label.set_textcolor(label1,c_labeltext)

Script protegido
Este script é publicado como de código fechado e você pode usá-lo livremente. Você pode favoritá-lo para utilizá-lo em um gráfico. Você não pode visualizar ou modificar seu código fonte.
Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?