♥ 0 |
Hello Room, Hello Pete I trying to convert this script from a trend indicator to a daily percent gainer to plot the Symbol, the price & the % change from the last close onto the chart. With this script, users can plug in multiple ticker symbols they want to watch and have the % change labels update (red/green) in real-time whether it be indices, stock or futures. What line of code would I add to make this possible? declare lower; input TLT_Trend_Length = 5; input FXY_Trend_Length = 5; input GLD_Trend_Length = 5; input DIA_Trend_Length = 5; input SPY_Trend_Length = 5; input QQQ_Trend_Length = 5; input IWM_Trend_Length = 5;
Marked as spam
|
Private answer
This has already been asked and answered. Be sure to view the four links I provide in answering this post: https://www.hahn-tech.com/ans/add-chart-label-to-display-price-price-change-of-price-change-days-atr/ The very last of the four links will show how to display daily change for alternate ticker symbols. After viewing all four posts that are linked, you should be able to complete your request. Not to mention you will have new ideas on how to apply chart labels.
I will take the code from this post: https://www.hahn-tech.com/ans/label-color-change-as-current-price-fluctuates/ and just replicate it over and over. Changing the symbol each time. The only thing to add is a computation for percent change: Notice it is rounded to the nearest 10th to remove excess digits. Here is a fully functional example that includes 2 symbols. You can add as many symbols and labels as you like. Just follow the pattern of renaming input and variable names. Got that? So Here is the full code that includes two symbols:
That should get you well on your way. Marked as spam
|
Please log in to post questions.
Yeah, I actually found this before I posted the question. It doesn’t show how to add the percent change to multiple symbol(s). No worries. I have other contacts who know Thinkscript well who can help me.
Yeah, well that is super easy to do. Sorry I thought you were the one that wrote the code you posted in your question. From that I expected you were just trying to learn how to do this. I will update my answer to include the full solution.