TradingView
StockSignaler
24 Th01 2021 19:48

Precise_Signal 

S&P 500 IndexTVC

Mô tả

This signal combines a portion of Chris Moody's 2014 SlingShot and my 2017 MTF Indicators. Both of our prior scripts over indicated Buy and Sell Points. This signal indicates a buy or sell point much less than our prior scripts did but with absolute precision.

I would say it is 100% accurate, but that is because I am yet to find a timeframe and symbol where the Buy signal failed to see the equity move up or the Sell signal failed to see the equity move down over the next 5 bars. I have tested 2000 charts so far. To be safe, I would rather state this indicator is accurate nearly 100% of the time.

The indicator is made up of 2 main portions and both of them have to agree on a buy or sell in order to indicate such with a vertical green or maroon bar beneath the chart. If there is a failure to agree, nothing is signaled.

Indicator 1 combines a stochastic of a 3 hour chart and a daily chart to determine when the stochastics are in agreement on direction. When there is agreement, both of them MUST cross from a buy state to a sell state and vice versa at exactly the same time. This is difficult to achieve and it is already rare for this occurrence to produce a signal. When a signal is produce it is combine with Chris Moody's 2014 SlingShot Indicator which conservatively determines Buy and Sell signals based on EMAs and market direction. Signals from his SlingShot are infrequent.

BUY Signal
When my MTF signals Buy at the same time that the SlingShot signals a Buy, a vertical green bar will appear in the window containing this script. The vertical bar is based on the close price of the equity and is only final when the close price is final. A BUY signal means the equity will move up potentially as early as the next bar and achieve a higher value from the close price on the signal bar.

SELL Signal
Likewise, a sell signal from the MTF at the same time as a sell signal from the SlingShot will create a maroon bar in the window containing this script. The vertical bar is based on the close price of the equity and is only final when the close price is final. A SELL signal means the equity will move down potentially as early as the next bar and achieve a lower value from the close price on the signal bar.

The default values for this script are hard-coded into this script. You can edit any of the value you would like to play with other timeframes, stochastic, and moving average lengths.

I have played with these values and have hard-coded the ones that are most accurate. Please let me know if you find others that work.

Hopefully this becomes an extra tool in your technical trading toolkit.
Bình luận
SuSaSiSA
not sure how to add this to my charts - cant get this to working.
justaanuj
It is not showing any data, when applied to pine editor, copied the script from point 6
StockSignaler
@justaanuj @SuSaSiSA, once copied into Pine Editor, did you Save and/or Apply to Chart. It should work. If something is missing you should see an error message at the bottom in the console. It is easier to Add the Script to your Favorite Indicators above the code on this web page and then load a chart, click on the downward pointing carrot/arrow to the right of the Fx bottom at the top of your chart and select Precise_Signal
bfalls
@StonkSignaler, You have an undeclared variable you should fix. tickerid is not declared.
StockSignaler
@bfalls, tickerid should pull from the ticker the chart is viewing
bfalls
@StonkSignaler, unfortunately it does not, it is an undeclared variable. Copy - paste code has this error.
bfalls
@StonkSignaler, maybe what you need is a pine script version number at the top of the script.
StockSignaler
HERE IS AN UPDATE TO INCLUDE THE PROPER VERSION NUMBER:

// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/
// © cguthrie922
//@version=2
// Created by Chris Guthrie © January 24, 2021
// Script indicates buy (Green) and sell(Maroon) points based on Chris Moody's 2014 SlingShot indicator and my 2017 MTF Indicator
study(title="Precise_Signal", shorttitle="Buy-Sell-Precise")
len = input(7, minval=1, title="Main Stochastic Length")
lenSMA = input(100, minval=8, title="Simple Moving Average of Symbol")
smoothK = input(3, minval=1, title="SmoothK for Main Stochastic")
smoothD = input(3, minval=1, title="SmoothD for Main Stochastic")
upLine = input(75, minval=50, maxval=95, title="Upper Line Value?")
lowLine = input(25, minval=5, maxval=50, title="Lower Line Value?")
mySMA = sma(close, lenSMA)
len2 = input(7, minval=1, title="2nd Stoch Length")
smoothK2 = input(3, minval=1, title="SmoothK for 2nd Stoch")
smoothD2 = input(3, minval=1, title="SmoothD for 2nd Stoch")
SlowEMA = input(62, minval=1, title="Slow EMA for SlingShot")
FastEMA = input(38, minval=1, title="Fast EMA for SlingShot")
//Resolutioon for MTF
res = '180'
res2 = 'D'
//Stoch formula
k = sma(stoch(close, high, low, len), smoothK)
d = sma(k, smoothD)
outK = security(tickerid, res, k)
outD = security(tickerid, res, d)
//Optional 2nd Stoch for additional plot
k2 = sma(stoch(close, high, low, len2), smoothK2)
d2 = sma(k2, smoothD2)
outK2 = security(tickerid, res2, k2)
outD2 = security(tickerid, res2, d2)
//Double Cross
allUp = (outK[1] < outD[1] and outK > outD and outK2[1] < outD2[1] and outK2 > outD2) ? 1 : 0
allDown = (outK[1] > outD[1] and outK < outD and outK2[1] > outD2[1] and outK2 < outD2) ? 1 : 0
//BUY side SMA
buySMA = (close > mySMA) ? 1 : 0
//SELL side SMA
sellSMA = (close < mySMA) ? 1 : 0

//Indicator 2 comes from Chris Moody's 2014 SlingShot. Only signals when conservative entry arrow is triggered.
//------------------------BEGIN Portion of Chris Moody's SlingShot
emaSlow = ema(close, SlowEMA)
emaFast = ema(close, FastEMA)
//Conservative Entry True/False Condition
entryUpTrend = emaFast > emaSlow and close[1] < emaFast and close > emaFast ? 1 : 0
entryDnTrend = emaFast < emaSlow and close[1] > emaFast and close < emaFast ? 1 : 0
//Definition for Conservative Entry Up and Down PlotArrows
codiff = entryUpTrend == 1 ? entryUpTrend : 0
codiff2 = entryDnTrend == 1 ? entryDnTrend : 0
//------------------------END Portion of Chris Moody's SlingShot

// //Vertical bars
bgcolor(codiff and allUp and buySMA ? lime : na, transp=0)
bgcolor(codiff2*-1 and allDown and sellSMA ? red : na, transp=0)
plotchar(codiff and allUp and buySMA ? 1 : na, title="Buy Entry", offset=0, char='B', location=location.absolute, color=lime, transp=0)
plotchar(codiff2*-1 and allDown and sellSMA ? 1 : na, title="Short Entry", offset=0, char='S', location=location.absolute, color=red, transp=0)
Sh3nZeR
@StonkSignaler, Tried this one but nothing shows up on charts. Its all blank. Can u look up the problem ?
StockSignaler
@Sh3nZeR, try to take the original script and add the next line to the top portion beneath my copyright:

//@version=2
Thêm nữa