GreatStockMark

Upside Reversals

GreatStockMark 已更新   
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
版本注释:
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)

受保护脚本
该脚本是闭源发布的,您可以自由使用它。您可以收藏它以在图表上使用。您无法查看或修改其源代码。
免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?