scheplick

Make Your Own Index!

scheplick Uppdaterad   
Intro

For my first script, I have released Make Your Own Index version 1. It has a long way to go so please stay tuned. Scroll down to read all the updates and notes as they come in.

Why it matters
Making your index is important to quickly see an index of symbols that you want to chart. Having the ability to assign weightings gives you the opportunity to make the index equal weighted or custom weighted. As we all know, indexes like the S&P 500 are NOT equal weighted, but more heavily weighted toward the winners. Now, you can make your own of a basket of symbols and make them custom weighted or equal weighted. Have some fun exploring this.

Features
You select the symbols of your choice and then chart them as one line with a specific weighting. This can be done in the settings menu once the indicator is selected. Use the symbol search field to add a symbol. From what I have tested, it works for any symbol whether it's stocks, crypto, FX and more. The default is set to stocks.

The Weight field in the settings menu is where you can assign a specific weight to the symbol of your choice. This way you can make an equal weighted index or a custom weighted index. By default each symbol is set to 10 or 10%. There are 10 symbols in the menu, so at 10%, they are equally weighted! In the script I have made it so each weighting is in percentage terms. So type in the percentage and you're good to go.

The chart is currently displayed in a separate window and not as an overlay. This may change in the future. The line can also be changed slightly and the color of it. Stay tuned for more on this.

Send in feedback
I am a Pine rookie in all regards and I am surely looking for support, feedback, and/or ideas. I want to add a lot more to this. If you look at the settings you will see have some input fields that are in their first iteration and currently needing to be improved. Rather than waiting to make them perfect, I just want to get this out there and update as I go. Also, as mentioned, I will definitely need a little support at adding more features that I have in mind.

Credit where credit is due
I used a lot of Open Source indicators as inspiration to quickly get going so thank you to the following people and accounts who share open source scripts that you can use to learn, test, and get started instantly:

@TradingView
@LucF
@PineCoders
@KioseffTrading
@norok
@RedKTrader
@NeoButane
And many others. That's the beauty of open source!

Closing note
Publishing it open source so people can fact check my code and thinking. One thing I know for sure is that this can probably be created in a more efficient way. Nonetheless, please a take look and let me know what you think - I am excited to make some updates over the coming weeks.

Thanks for reading!
Versionsinformation:
Update!

Special thanks to the Pine Code team - wow they are good! They helped me make sure I understood how to make the check boxes in the Index script work properly. The script will now calculate *only* the boxes you have checked in your settings menu. This means you can decide how many symbols you want to include. Check all 10 boxes to include the weights of 10 symbols or only check 3 boxes to make an index with just 3 checks.

More updates coming. Also, if you are using this tool at all, please let me know. I am curious if there is any value or certain things that need to be fixed or improved.

The comments section my pal Alex made a good observation about the weighting calculation. I will look to fix this or add it as a different option so you can decide the math of your weights.

I work at TradingView helping to build charts, tools, and software for everyone interested in financial markets.

Twitter: twitter.com/scheplick
Blog: scheplick.com/
Skript med en öppen källkod

I sann TradingView-anda har författaren publicerat detta skript med öppen källkod så att andra handlare kan förstå och verifiera det. Hatten av för författaren! Du kan använda det gratis men återanvändning av den här koden i en publikation regleras av våra ordningsregler. Du kan ange den som favorit för att använda den i ett diagram.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här skriptet i ett diagram?