It is currently May 8th, 2024, 8:22 am

Market Prices

RSS, ATOM and other feeds, GMail, Stocks, any information retrieved from the internet
emp00
Posts: 83
Joined: October 7th, 2022, 8:08 pm

Re: Market Prices

Post by emp00 »

"One more thing" -- my last words... (don't overlook my cheerful posting before this one!) :welcome:

Currently in [mIndex1_UpDown], you have used IfAbove / IfEqual and IfBelowValue. Working fine with 3 colors, mainly red/green for "+" and "-" values.

What I'd like to do:
1.) Negative values are shown with the "-" minus and they are colored red. That's redundant in my thinking. Can we eliminate the "-" from the String? Probably via a simple RegEx? If I see red percentages I already know it's negative, would prefer removing the minus sign, relaxing my eyes and saving a pinch of space, you know... Don't kill me, yes, I like it perfectly customized...

2.) For the colors, I'd like to have two different colors for <0 = "DownSlow" (yellow) and <-3 = "DownFast" (red) and same for "UpSlow" (light green) and "UpFast" (regular green). I know this does not work with IfAboveEqualBelow. See below my coding attempt with a set of IfConditions. Problem: It gives strange results, not as designed - from my gut feeling, the operators "<" ">" do not work correctly with the String [mIndex1_UpDown]? But I wonder, why does IfAbove / IfEqual and IfBelowValue work on this string but not my IfConditions? Anything else I missed? Do I need to create another Calc measure to convert the string to a number and then use the IfCondition on this measure? Maybe a more elegant solution? Thanks so much...

Mordasiu's code:

Code: Select all

[mIndex1_UpDown]
Measure=WebParser
Url=[InfoIndex1]
Substitute="UNCH":"0"
StringIndex=3
IfAboveValue=0
IfAboveAction=[!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorUp#"]
IfEqualValue=0
IfEqualAction=[!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorSteady#"]
IfBelowValue=0
IfBelowAction=[!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorDown#"]
OnChangeAction=[!SetOption "LabelIndex1" "FontColor" "#ColorStockName#"] [!Redraw]
My revision:

Code: Select all

[mIndex1_UpDown]
Measure=WebParser
Url=[InfoIndex1]
Substitute="UNCH":"0"
StringIndex=3
; Here we use IfConditions to set two different colors if below or above threshold (+.)3%
IfCondition=(mIndex1_UpDown <= -3)
IfTrueAction=[!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorDownFast#"]
IfCondition2=(mIndex1_UpDown > -3) && (mIndex1_UpDown < 0)
IfTrueAction2=[!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorDownSlow#"]
IfCondition3=(mIndex1_UpDown = 0)
IfTrueAction3=[!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorSteady#"]
IfCondition4=(mIndex1_UpDown > 0) && (mIndex1_UpDown < 3)
IfTrueAction4=[!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorUpSlow#"]
IfCondition5=(mIndex1_UpDown >= 3)
IfTrueAction5=[!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorUpFast#"]
OnChangeAction=[!SetOption "LabelIndex1" "FontColor" "#ColorStockName#"] [!Redraw]
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Market Prices

Post by Mordasius »

emp00 wrote: January 25th, 2024, 8:08 pm Yes - Yes - Yes :-) This did it! ..... Shall I share my complete, modified revision with you, so that you can upgrade your official skin distribution package
Thanks for the offer but I don't think I'll be adding this 'feature' to MarketPrices.ini. The reason is that I and maybe others want to see the prices and the price changes exactly as they are shown on CNBC.com. That is why what is displayed by MarketPrices.ini is the price string exactly as shown on CNBC.com without any trucation, rounding or formating.
emp00 wrote: January 25th, 2024, 8:08 pm I saw a few more details in the script, such as using "Group=2" in a few measures but no Group bangs being used
If you had looked in [MtLogo] you would have seen LeftMouseUpAction=[!ToggleMeterGroup 2]. This shows/hides all the values if you click on the logo. Can be used to clean up your desk top and only display the prices when you want to see them.
emp00 wrote: January 25th, 2024, 9:06 pm 1.) Negative values are shown with the "-" minus and they are colored red. That's redundant in my thinking.
Umm.. well it's your choice but for me it's the "-" minus sign that makes the number negative. Take the "-" away and you have a red coloured positive number. But it's your skin and if you don't need the "-" then you can substitute it out in [mIndexX_Change] and [mIndexX_ChangePer] with Substitute="UNCH":"0", "-":""
emp00 wrote: January 25th, 2024, 9:06 pm 2.) For the colors, I'd like to have two different colors for <0 = "DownSlow" (yellow) and <-3 = "DownFast" (red) and same for "UpSlow" (light green) and "UpFast" (regular green). I know this does not work with IfAbove/Equal/Below.
IfConditions would seem to be the best way to do what you want to do here. I used IfActions because IfConditions weren't part of Rainmeter when the MarketPrices skin was first posted in 2014. With reference to your Revision of [mIndex1_UpDown]

1) Although you can put your IfConditions in any measure, I suggest you make a completely new measure (say [mIndex1_ChangeRate]) and leave [mIndex1_UpDown] as is. You can comment it out or delete it once all your other changes are working.
2) If Conditions can only be used to evaluate a numeric formula. So I suggest that [mIndex1_ChangeRate] is a Calc measure.
3) The Calc measure should have Formula=[mIndex1_ChangePer] as [mIndex1_ChangePer] uses StringIndex=4 which is the percentage change in price. StringIndex=3 used in [mIndex1_UpDown] is the absolute change in price and this could well be the cause of your "strange results".
4) I assume that you'll want to change more than just the font colour of "LabelIndex1_ChangePer" so you will need to add bangs to change the font color of "LabelIndex1_Change" and the image used for "UpDownImage_1".

So the new measure will look something like this

Code: Select all

[mIndex1_ChangeRate]
Measure=Calc
Formula= [mIndex1_ChangePer]*1
IfCondition=(mIndex1_ChangeRate <= -3)
IfTrueAction=[!SetOption "LabelIndex1_ChangePer" "FontColor" "#ColorDownFast#"] [!SetOption "LabelIndex1_Change" "FontColor" "#ColorDownFast#"] [!SetOption "UpDownImage_1" "ImageName" "#@#DownFast.png"]

etc.
etc.
P.S. I do hope you are using downloaded files of each stock you are tracking while testing your skin as suggested by Yincognito and eclectic-tech above e.g.

Code: Select all

[InfoIndex1]
Measure=WebParser
URL=File://#CURRENTPATH#Page-1.html
or 
URL=File://WebparserDump1.txt
emp00
Posts: 83
Joined: October 7th, 2022, 8:08 pm

Re: Market Prices

Post by emp00 »

THANK YOU @Mordasius - no more questions, you were 100% correct, now all is working fine! :great:
Adj39
Posts: 8
Joined: November 10th, 2021, 1:32 am

Re: Market Prices

Post by Adj39 »

Hi Mordasius.

Thanks for creating such a great skin, I check it constantly throughout the day.

I was wondering if it would be possible to add an extra column on the right, that shows the market values for each row, plus the total market value for these rows at the bottom?

The market values would essentially be the combination of the Invested column plus the overall gain/loss columns.

I tried playing around with the skin settings myself, but I couldn’t get it working properly.

Thanks in advance.
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Market Prices

Post by Mordasius »

Adj39 wrote: February 7th, 2024, 4:04 amI was wondering if it would be possible to add an extra column on the right, that shows the market values for each row, plus the total market value for these rows at the bottom?

The market values would essentially be the combination of the Invested column plus the overall gain/loss columns.
I'm guessing you are using the MyPortfolio skin and want to add a column showing the current value of each investment. I think this would be best inserted between the Todays Gain/Loss and the Overall Gain/Loss Column. Is that right?
Adj39
Posts: 8
Joined: November 10th, 2021, 1:32 am

Re: Market Prices

Post by Adj39 »

Hi Mordasius,

Yes that is correct, I am using the MyPortfolio skin found on DeviantArt, with a previous modification from you that adds double digit resolution to the latest price and percentages columns (eg latest prices would be in $1.11 format and both percentages columns would show 1.11 % instead of 1.1 % in the default skin). I have attached a screenshot of my current skin for reference.

Your suggestion to add a new column showing the current value of each investment, inserted between the Todays Gain/Loss and the Overall Gain/Loss Column is exactly what I am looking for.

Would it also be possible to add the double digit resolution to the latest price and both percentages columns again?

Thank you very much for your help with this.
You do not have the required permissions to view the files attached to this post.
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Market Prices

Post by Mordasius »

Adj39 wrote: February 7th, 2024, 4:44 pm Your suggestion to add a new column showing the current value of each investment, inserted between the Todays Gain/Loss and the Overall Gain/Loss Column is exactly what I am looking for.
You can try the adapted version of MyPorfolio from the rmskin below. The new layout should look something like this
MyPortfolio.jpg
If this is the sort of thing you want firstly unload the skin and then copy your old version of MyStockCodes.inc to the ..Documents\Rainmeter\Skins\MyPortfolio-Extended\@Resources folder.

Load the MyPortfolio-Extended skin and it should show your values. If you want to play around with the column position settings in MyPortfolio-Extended\@Resources\Skinvars.inc you should first make the following changes to [Infos] in MyPortfolio-Extended.ini

Code: Select all

[Infos]
Measure=WebParser
URL=https://quote.cnbc.com/quote-html-webservice/quote.htm?partnerId=2&requestMethod=quick&exthrs=1&noform=1&fund=1&output=xml&symbols=[&Symbols]&callback=quoteHandler1

;-- use Debug=2 to write the WebParserDump.txt file on every update
; Debug=2
;-- copy the WebParserDump.txt file to #@# folder and use the following when modifying the skin ------
;URL=file://#@#WebParserDump.txt

UserAgent=#MyUserAgent#
RegExp=(?siU).*#ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote##ExpQuote#
UpdateRate=#UpdateQuotes#
This will use the info from Stocks.txt so that you can play around without the chance of getting your IP blocked. Once you've got it looking as you want it delete the ;-- before the upper URL= line and put ;-- before URL=file://#@#WebParserDump.txt
.
MyPortfolio-extended_25022024.rmskin
You do not have the required permissions to view the files attached to this post.
Last edited by Mordasius on February 25th, 2024, 11:16 am, edited 1 time in total.
Adj39
Posts: 8
Joined: November 10th, 2021, 1:32 am

Re: Market Prices

Post by Adj39 »

Hi Mordasius,

This skin is perfect. Thank you very much for your help with this.
sk14
Posts: 25
Joined: February 9th, 2024, 7:21 pm

Re: Market Prices

Post by sk14 »

Been using MarketPrices for years and just downloaded the latest version. Currently tracking 13 stocks

2 questions:

1. Why do some of the prices and changes display 3 decimal places while most display only 2? (tried adding the NumOfDecimals=2 to each stock in "MoreThanOne.inc" but that had no effect.)

2. Why don't I see a "," for prices over 1,000? (i.e. 12,995 versus 12995)

Thanks for your help.
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Market Prices

Post by Mordasius »

sk14 wrote: February 9th, 2024, 7:29 pm Been using MarketPrices for years and just downloaded the latest version. Currently tracking 13 stocks
I think the problem is that I've got all muddled up with recent changes to both the MarketPrices and MyPortfolioValue skins. Some changes I incorporated in the latest versions posted on DA and others I did not. I'll fix the problem with commas in the prices shortly but I'm at a loss with the Decimal Places as I thought that was only in MyPortfolioValue. Can you post a screen short to be sure what skin and stocks we a talking about. Thanks