schaballa 8 posts msg #161509 - Ignore schaballa |
12/22/2024 5:36:39 PM
I have had good entry success with call options using this Leading Indicator on Tradingview. Wondering if anyone can possibly code this indicator.
/@version=5
indicator("Leading Indicator Example", overlay=false)
// Input parameters for indicator sensitivity
length = input(14, title="Regression Period Length")
rocLength = input(9, title="ROC Period Length")
rocThreshold = input(5, title="ROC Threshold")
// Linear Regression for Trend Prediction
lrc = ta.linreg(close, length, 0)
// Rate of Change (ROC) for momentum prediction
roc = ta.roc(close, rocLength)
// Leading Indicator Logic
leadingIndicator = (close - lrc) / ta.stdev(close, length) // Standardized difference from regression line
// Define possible buy and sell signals based on ROC and Leading Indicator
buySignal = roc > rocThreshold and leadingIndicator > 0 // Predicting upward momentum
sellSignal = roc < -rocThreshold and leadingIndicator < 0 // Predicting downward momentum
// Plot the leading indicator as an oscillator
plot(leadingIndicator, color=color.blue, title="Leading Indicator", linewidth=2)
// Highlight buy and sell signals on the chart
bgcolor(buySignal ? color.new(color.green, 90) : na)
bgcolor(sellSignal ? color.new(color.red, 90) : na)
// Plotting ROC to visualize momentum as well
hline(rocThreshold, "ROC Threshold", color=color.gray)
plot(roc, color=color.purple, title="ROC Momentum", linewidth=2)
Thanks in Advance
|
nibor100 1,052 posts msg #161510 - Ignore nibor100 modified |
12/23/2024 3:45:33 PM
what is the TradingView name for this indicator, do you have a chart image to share? or the author's name?
thanks,
Ed S.
|
schaballa 8 posts msg #161512 - Ignore schaballa |
12/23/2024 6:57:06 PM
Hey Ed, The indicator is called Leading Indicator by Parag Raut on Tradingview.
This is the only way I can get an image of his indicator working on my Tradingview account on this forum - https://ibb.co/chW1bgp
|
schaballa 8 posts msg #161513 - Ignore schaballa |
12/23/2024 7:05:00 PM
The indicator is at the bottom of my chart. I was entering just after the solid red bar off a higher low or lower low starting an uptrend and exiting into the first green bar.
|
nibor100 1,052 posts msg #161514 - Ignore nibor100 |
12/24/2024 1:28:44 PM
That helps a lot, might take me a couple of days to work out a solution but I think its doable.
Ed S.
|
nibor100 1,052 posts msg #161515 - Ignore nibor100 |
12/27/2024 9:41:08 AM
This is as close as I can get it.
Note that during the current day, when the market is open, because TradingView and SF refresh market data at different rates the numbers won't exactly match between them.
Ed S.
|
schaballa 8 posts msg #161516 - Ignore schaballa |
12/27/2024 10:10:20 AM
Ed, Thank you for all of your time and effort! I appreciate it. Lets take a look and hope we can make some money off of this.
Steve
|