New Indicators: Codes for scripts, etc

Post Reply
User avatar
SOL
Power VS Force
Power VS Force
Posts: 3267
Joined: Sat Sep 26, 2020 7:32 am

New Indicators: Codes for scripts, etc

Post by SOL »

This is the monthly chart of the NDX, and the yellow indicator is a new indicator I am messing around with. It was created by blending 7 oscillators into one. If anyone finds it interesting, I can keep posting updated charts.

Image


This section can also be used to discuss code and scripts from tradingview.com Once you understand how to use the pine editor, you can create some interesting tools. I will post the code if I successfully combine four specific indicators into one. Success comes down to producing something decent; sometimes, when you combine the indicators, you get spaghetti designs lol.

I am also working on trying to combine several dozen indicators into one, which will take time
When the words short term appear under any post; the same conditions listed in the Market update under the short term category apply

The end is always near; its the beginning and how you live each moment that counts the most
User avatar
jlhooter
Intermediate
Intermediate
Posts: 353
Joined: Fri Jan 29, 2021 2:23 am

Re: New Indicators: Codes for scripts, etc

Post by jlhooter »

SOL wrote: Fri Feb 24, 2023 1:21 pm This is the monthly chart of the NDX, and the yellow indicator is a new indicator I am messing around with. It was created by blending 7 oscillators into one. If anyone finds it interesting, I can keep posting updated charts.

Image


This section can also be used to discuss code and scripts from tradingview.com Once you understand how to use the pine editor, you can create some interesting tools. I will post the code if I successfully combine four specific indicators into one. Success comes down to producing something decent; sometimes, when you combine the indicators, you get spaghetti designs lol.

I am also working on trying to combine several dozen indicators into one, which will take time
I use Pine Editor all the time and would live to see some of what you have been doing. Sharing some code you have would be awesome to modify myself if you are up to it.
Just because 95% is doing it doesn't make it right
User avatar
SOL
Power VS Force
Power VS Force
Posts: 3267
Joined: Sat Sep 26, 2020 7:32 am

Re: New Indicators: Codes for scripts, etc

Post by SOL »

jlhooter wrote: Fri Feb 24, 2023 3:47 pm
I use Pine Editor all the time and would live to see some of what you have been doing. Sharing some code you have would be awesome to modify myself if you are up to it.
I will post stuff as soon as I find something interesting. Will probably start off with a 4 TA combo indicator.
:mrgreen:
When the words short term appear under any post; the same conditions listed in the Market update under the short term category apply

The end is always near; its the beginning and how you live each moment that counts the most
User avatar
SOL
Power VS Force
Power VS Force
Posts: 3267
Joined: Sat Sep 26, 2020 7:32 am

Re: New Indicators: Codes for scripts, etc

Post by SOL »

Here is the code for four indicators combined into one. and you can customize the settings :arrow: :mrgreen:



//@version=4
study("Combined Indicators", overlay=true)


//CALCULATION SECTION

//Stochastics Calculation
smoothK = input(3, "K")
smoothD = input(3, "D")
slength = input(14, minval=1, title="Length")
src = input(close, title="Source")
StochK = sma(stoch(src, high, low, slength), smoothK)
StochD = sma(StochK, smoothD)

//Williams %R Calculation
length = input(title="Length", type=input.integer, defval=14)
overbought = input(title="Overbought Level", type=input.float, defval=-20)
oversold = input(title="Oversold Level", type=input.float, defval=-80)
highestHigh = highest(high, length)
lowestLow = lowest(low, length)
williamsR = (highestHigh - close) / (highestHigh - lowestLow) * -100

//RSI Calculation
rsiLength = input(14, "RSI Length")
rsiOverBought = input(70, "RSI Overbought")
rsiOverSold = input(30, "RSI Oversold")
rsi = rsi(close, rsiLength)

//MACD Calculation
fastLength = input(12, title="Fast Length")
slowLength = input(26, title="Slow Length")
signalLength = input(9, title="Signal Smoothing")
fastMA = ema(close, fastLength)
slowMA = ema(close, slowLength)
macd = fastMA - slowMA
signal = ema(macd, signalLength)
hist = macd - signal



//Stochastics Plot
//plot(StochK, "Stoch K", color=#5B8DE7)
//plot(StochD, "Stoch D", color=#FDE803)

//Williams %R Plot
//plot(williamsR, color=color.blue, title="Williams %R")
//hline(overbought, color=color.red, linestyle=hline.style_dashed, title="Overbought")
//hline(oversold, color=color.green, linestyle=hline.style_dashed, title="Oversold")

//RSI Plot
//plot(rsi, "RSI", color=#3ADF00)
//hline(rsiOverBought, title="Overbought", color=#FF0000)
//hline(rsiOverSold, title="Oversold", color=#00FF00)

//MACD Plot
//plot(macd, "MACD", color=#FF6B6B)
//plot(signal, "Signal", color=#9BFFAF)
//plot(hist, "Histogram", color=#B0B0B0)

CombOsc = ((StochD+StochK)/2 + macd + rsi + williamsR)/4
plot(CombOsc, "Combined", color=color.yellow)
When the words short term appear under any post; the same conditions listed in the Market update under the short term category apply

The end is always near; its the beginning and how you live each moment that counts the most
User avatar
MarkD
Black Belt
Black Belt
Posts: 773
Joined: Sat Oct 17, 2020 6:15 pm

Re: New Indicators: Codes for scripts, etc

Post by MarkD »

My experience would indicate too many combinations of similar indicators would make little improvement. I have settled on momentum (take your pick), ADX (hi-lo), and volume (VBP and AVWAP). Along with price action. Seems to work decently for me.

If you could prepare a code for MACD/ADX/AVWAP (which could be used on TOS) that would be interesting to moi.
"You can observe a lot just by watching"
Yogi Berra

“The best lies always contain a grain of truth”
Joakim Palmkvist
User avatar
SOL
Power VS Force
Power VS Force
Posts: 3267
Joined: Sat Sep 26, 2020 7:32 am

Re: New Indicators: Codes for scripts, etc

Post by SOL »

MarkD wrote: Fri Mar 10, 2023 2:38 pm My experience would indicate too many combinations of similar indicators would make little improvement. I have settled on momentum (take your pick), ADX (hi-lo), and volume (VBP and AVWAP). Along with price action. Seems to work decently for me.

If you could prepare a code for MACD/ADX/AVWAP (which could be used on TOS) that would be interesting to moi.
Will give it a shot; let's see what comes from it, if its spaghetti maybe the other coders here could help :mrgreen:
When the words short term appear under any post; the same conditions listed in the Market update under the short term category apply

The end is always near; its the beginning and how you live each moment that counts the most
User avatar
jlhooter
Intermediate
Intermediate
Posts: 353
Joined: Fri Jan 29, 2021 2:23 am

Re: New Indicators: Codes for scripts, etc

Post by jlhooter »

Thanks for sharing
Just because 95% is doing it doesn't make it right
User avatar
Yodean
Jeidi
Jeidi
Posts: 2685
Joined: Wed Sep 30, 2020 9:02 pm

Re: New Indicators: Codes for scripts, etc

Post by Yodean »

https://www.linkedin.com/embed/feed/upd ... 7548383232

*****

Indeed, technical analysis is 99.9% accurate, 50% of the time.
Buy Fear, Sell Euphoria. The Neonatal Calf undergoes an agonizing birthing, while the Bear falls into hibernation.
User avatar
harryg
Advanced
Advanced
Posts: 654
Joined: Fri Nov 05, 2021 8:54 am
Contact:

Re: New Indicators: Codes for scripts, etc

Post by harryg »

That is interesting, but at the same time, the conclusion is false.

I feel that we can see patterns everywhere, and many are as meaningless as froth on an ocean. But, to take one example, if a share has been trading in a range for a long time and then breaks out of that range, the price action could be telling you something. You can't disprove that by showing me a graph that you have made up and then making fun of me because I conclude that it is trading in a range. It is no different from asking me to draw conclusions from a series of fundamental data or interest rate changes or oil inventories and supply and demand, and then making fun of my process because all your data was made up.

The author is somewhat childish.
---------------------------------------
https://www.harryginsights.com
User avatar
Yodean
Jeidi
Jeidi
Posts: 2685
Joined: Wed Sep 30, 2020 9:02 pm

Re: New Indicators: Codes for scripts, etc

Post by Yodean »

harryg wrote: Tue Mar 14, 2023 6:56 am That is interesting, but at the same time, the conclusion is false.

I feel that we can see patterns everywhere, and many are as meaningless as froth on an ocean. But, to take one example, if a share has been trading in a range for a long time and then breaks out of that range, the price action could be telling you something. You can't disprove that by showing me a graph that you have made up and then making fun of me because I conclude that it is trading in a range. It is no different from asking me to draw conclusions from a series of fundamental data or interest rate changes or oil inventories and supply and demand, and then making fun of my process because all your data was made up.

The author is somewhat childish.
Comes down to longterm CAGR. To me, this is the true litmus test of an investor.

20-year+ CAGR ... no other excuses/words/etc. are necessary. One can always make up excuses about why the markets "should" have done this or "should not" have done that.

Most retail don't make it to 20 years of investing ... so, one must survive the markets to get there first.

You need at least 20 years of data since the investor will be tested through several bull/bear cycles.

Most are geniuses in bull markets, idiots in bear markets.

Technical analysis has its place, but in general, it's overrated.

Sentiment analysis, trend analysis, positioning analysis (e.g. stuff like COT), discipline, patience, and appropriate risk management will generally prove superior.

Know a few investors who have long-term positive CAGRs who don't use any technical analysis. Know quite a few technical traders who have long-term negative CAGRs or who went bust.

It is what it is.
Buy Fear, Sell Euphoria. The Neonatal Calf undergoes an agonizing birthing, while the Bear falls into hibernation.
User avatar
SOL
Power VS Force
Power VS Force
Posts: 3267
Joined: Sat Sep 26, 2020 7:32 am

Re: New Indicators: Codes for scripts, etc

Post by SOL »

harryg wrote: Tue Mar 14, 2023 6:56 am That is interesting, but at the same time, the conclusion is false.

I feel that we can see patterns everywhere, and many are as meaningless as froth on an ocean. But, to take one example, if a share has been trading in a range for a long time and then breaks out of that range, the price action could be telling you something. You can't disprove that by showing me a graph that you have made up and then making fun of me because I conclude that it is trading in a range. It is no different from asking me to draw conclusions from a series of fundamental data or interest rate changes or oil inventories and supply and demand, and then making fun of my process because all your data was made up.

The author is somewhat childish.
You might have a point, Harry:


Despite the availability of metrics to measure performance, an individual's desire to disregard common sense rules and make irrational investment decisions can lead to losses. This phenomenon referred to as the 'secret desire to lose syndrome', can be exemplified by the experiences of legendary investor Peter Lynch.

Peter Lynch, managed the Fidelity Magellan Fund from 1977 to 1990, during which the fund achieved an impressive annual return of 29.2%. While it may seem that investing in the fund would have led to phenomenal returns, the reality was different. According to Fidelity Investments, the average Magellan Fund investor actually lost money during Lynch's tenure. This underperformance can be attributed to various factors, including investors trying to time the market, deviating from Lynch's investment philosophy, or selling out during market downturns
When the words short term appear under any post; the same conditions listed in the Market update under the short term category apply

The end is always near; its the beginning and how you live each moment that counts the most
User avatar
harryg
Advanced
Advanced
Posts: 654
Joined: Fri Nov 05, 2021 8:54 am
Contact:

Re: New Indicators: Codes for scripts, etc

Post by harryg »

I have seen that story before and it is quite incredible. Imagine choosing and investing in a fund with such impressive returns and not making any money.

I don't think it's a secret desire to lose (although it could be).

I read it as the basic overriding human flight response. Avoidance of pain is a very strong trigger, and I'm sure this is why so many people sell into declines. That's what they did with his fund.

Negative emotions seem so much stronger and more immediately compelling than positive ones.

Every day the thing goes down the more it hurts, and the minute you sell, the pain (short-term) is gone.

I've never met anyone totally immune to it. They might explain it differently, but it's that.

Unfortunately, so often, the darned thing goes back up and the pain (long-term) of not being in it is worse. But that's easier to rationalise or ignore than holding something in freefall.

Perhaps it comes down to risk tolerance and the rationalisation between long-term and short-term.

I have no evidence for this, but it seems to me that 99% of those in the markets (including 'professionals') have a short-term perspective. Looking to the longer-term is surely somewhere that we can get a decent edge.

To take a random example, let's imagine that GOOGL could be 1000 in 15 years time against 100 now. Does it really matter if we pay 95 or 105 for it? Or 90 or 110? Paying 90 is nice, but it's the holding to 1000 that makes the money.

When we concentrate our attention on these short-term gyrations, even in a good cause (to get a good entry price), it can skew our outlook to a short-term one. Perhaps we end up selling at 150 and miss 151-1000.
---------------------------------------
https://www.harryginsights.com
User avatar
Yodean
Jeidi
Jeidi
Posts: 2685
Joined: Wed Sep 30, 2020 9:02 pm

Re: New Indicators: Codes for scripts, etc

Post by Yodean »

harryg wrote: Sat Mar 18, 2023 11:08 am I have seen that story before and it is quite incredible. Imagine choosing and investing in a fund with such impressive returns and not making any money.

I don't think it's a secret desire to lose (although it could be).

I read it as the basic overriding human flight response. Avoidance of pain is a very strong trigger, and I'm sure this is why so many people sell into declines. That's what they did with his fund.

Negative emotions seem so much stronger and more immediately compelling than positive ones.

Every day the thing goes down the more it hurts, and the minute you sell, the pain (short-term) is gone.

I've never met anyone totally immune to it. They might explain it differently, but it's that.

Unfortunately, so often, the darned thing goes back up and the pain (long-term) of not being in it is worse. But that's easier to rationalise or ignore than holding something in freefall.

Perhaps it comes down to risk tolerance and the rationalisation between long-term and short-term.

I have no evidence for this, but it seems to me that 99% of those in the markets (including 'professionals') have a short-term perspective. Looking to the longer-term is surely somewhere that we can get a decent edge.

To take a random example, let's imagine that GOOGL could be 1000 in 15 years time against 100 now. Does it really matter if we pay 95 or 105 for it? Or 90 or 110? Paying 90 is nice, but it's the holding to 1000 that makes the money.

When we concentrate our attention on these short-term gyrations, even in a good cause (to get a good entry price), it can skew our outlook to a short-term one. Perhaps we end up selling at 150 and miss 151-1000.
Good post.
Buy Fear, Sell Euphoria. The Neonatal Calf undergoes an agonizing birthing, while the Bear falls into hibernation.
User avatar
jlhooter
Intermediate
Intermediate
Posts: 353
Joined: Fri Jan 29, 2021 2:23 am

Re: New Indicators: Codes for scripts, etc

Post by jlhooter »

Yodean wrote: Sun Mar 19, 2023 7:59 pm
harryg wrote: Sat Mar 18, 2023 11:08 am I have seen that story before and it is quite incredible. Imagine choosing and investing in a fund with such impressive returns and not making any money.

I don't think it's a secret desire to lose (although it could be).

I read it as the basic overriding human flight response. Avoidance of pain is a very strong trigger, and I'm sure this is why so many people sell into declines. That's what they did with his fund.

Negative emotions seem so much stronger and more immediately compelling than positive ones.

Every day the thing goes down the more it hurts, and the minute you sell, the pain (short-term) is gone.

I've never met anyone totally immune to it. They might explain it differently, but it's that.

Unfortunately, so often, the darned thing goes back up and the pain (long-term) of not being in it is worse. But that's easier to rationalise or ignore than holding something in freefall.

Perhaps it comes down to risk tolerance and the rationalisation between long-term and short-term.

I have no evidence for this, but it seems to me that 99% of those in the markets (including 'professionals') have a short-term perspective. Looking to the longer-term is surely somewhere that we can get a decent edge.

To take a random example, let's imagine that GOOGL could be 1000 in 15 years time against 100 now. Does it really matter if we pay 95 or 105 for it? Or 90 or 110? Paying 90 is nice, but it's the holding to 1000 that makes the money.

When we concentrate our attention on these short-term gyrations, even in a good cause (to get a good entry price), it can skew our outlook to a short-term one. Perhaps we end up selling at 150 and miss 151-1000.
Good post.
Yo-dean, you feeling ok? You are never one of a few or less words. Get yourself check :mrgreen: :mrgreen:
Just because 95% is doing it doesn't make it right
User avatar
Yodean
Jeidi
Jeidi
Posts: 2685
Joined: Wed Sep 30, 2020 9:02 pm

Re: New Indicators: Codes for scripts, etc

Post by Yodean »

jlhooter wrote: Sun Mar 19, 2023 8:52 pm Yo-dean, you feeling ok? You are never one of a few or less words. Get yourself check :mrgreen: :mrgreen:
Lol, busy with Wheel-Spinning and discussing recent banking events with a few offline. Also trying to help out a bit with a new potential VaxInjured that just underwent emergency ocular surgery last week.

Stocks to the moon!

Image
Buy Fear, Sell Euphoria. The Neonatal Calf undergoes an agonizing birthing, while the Bear falls into hibernation.
Post Reply