It is currently February 22nd, 2024, 9:39 pm

Market Prices

RSS, ATOM and other feeds, GMail, Stocks, any information retrieved from the internet
sk14
Posts: 19
Joined: February 9th, 2024, 7:21 pm

Re: Market Prices

Post by sk14 »

Notice the prices for Google and Blackstone. There are also intermittent issues with excessive decimal points in the Price Change column, though not in this particular instance. Thanks for the help.
MarketPrices.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Mordasius
Posts: 1163
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Market Prices

Post by Mordasius »

sk14 wrote: February 9th, 2024, 7:29 pm 2. Why don't I see a "," for prices over 1,000? (i.e. 12,995 versus 12995)
That was me forgetting to add formatting for the prices coming from the common .xml file. That's fixed in the latest version of Market Prices posted on Deviant Art.
sk14 wrote: February 9th, 2024, 7:29 pm 1. Why do some of the prices and changes display 3 decimal places while most display only 2?
The prices are presented to two decimal places by default. However, the skin presents the Price Changes using the same string that is returned by CNBC.com. While most are to two decimal places there are some exceptions for the price change of stuff like crypto currencies which sometimes only change at 6-7 decimal places (see Shiba price changes below).
with commas.jpg
sk14 wrote: February 9th, 2024, 7:29 pm ....(tried adding the NumOfDecimals=2 to each stock in "MoreThanOne.inc" but that had no effect.)
If you want to change the decimal places for the Price for Stock 3 go to [LabelPrice_3] in MoreThanOne.inc and change the digit '2' in format_price( [&mIndex3_Price] , 2 )

Code: Select all

[LabelPrice_3]
Meter=STRING
MeterStyle= sTextRight | sColorSetGray
x=#Col2XPos#
Text=[&mFormatPriceScript:format_price( [&mIndex3_Price] , 2 )]
To change the decimal places for the Percentage Price Change of Stock 3 go to [LabelIndex3_ChangePer] and change the digit '2" at the end of [mIndex3_ChangePer:/1, 2 ]

Code: Select all

[LabelIndex3_ChangePer]
Meter=STRING
MeterStyle=sTextRight 
FontColor=#ColorSteady#
x=#Col5XPos#
Text=([mIndex3_ChangePer:/1,2]%)
You do not have the required permissions to view the files attached to this post.
sk14
Posts: 19
Joined: February 9th, 2024, 7:21 pm

Re: Market Prices

Post by sk14 »

The new version of the Skin solved both issues. Thanks again.
sk14
Posts: 19
Joined: February 9th, 2024, 7:21 pm

Re: Market Prices

Post by sk14 »

Is there a way to also have the same 2 digit limit on the "[LabelIndex7_Change]" function? As you see in the attached, there are several stocks where the "Change" column shows a variety of decimal places (i.e. Nvidia, Home Depot and Lockheed Martin). I'm just trying to have a consistent 2 decimal display. I certainly appreciate all your help.
Market Prices_2_12_24.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Mordasius
Posts: 1163
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Market Prices

Post by Mordasius »

sk14 wrote: February 12th, 2024, 3:52 pm Is there a way to also have the same 2 digit limit on the "[LabelIndex7_Change]" function?
The quick way is to open MoreThanOne.inc and edit [LabelPrice_7] to be like this:

Code: Select all

[LabelPrice_7]
Meter=STRING
; MeasureName=mIndex7_Price
MeterStyle= sTextRight | sColorSetGray
x=#Col2XPos#
Text=[&mFormatPriceScript:format_price( [&mIndex7_Price] , 2 )]
sk14
Posts: 19
Joined: February 9th, 2024, 7:21 pm

Re: Market Prices

Post by sk14 »

That line is already in the MoreThanOne.inc in your newest Skin. That appears to be for the "Price" attribute, not the "Change" attribute. Is there something I can add to format the ".._Change" attribute similar to what you added for the "Price" and "ChangePer" functions?
User avatar
Mordasius
Posts: 1163
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Market Prices

Post by Mordasius »

sk14 wrote: February 13th, 2024, 3:07 pm Is there something I can add to format the ".._Change" attribute similar to what you added for the "Price" and "ChangePer" functions?
You could try changing [LabelIndex7_Change] to

Code: Select all

[LabelIndex7_Change]
Meter=STRING
; MeasureName=mIndex7_Change
MeterStyle= sTextRight 
FontColor=#ColorSteady#
x=#Col4XPos#
Text=[&mFormatPriceScript:format_price( [&mIndex7_Change] , 2 )]
sk14
Posts: 19
Joined: February 9th, 2024, 7:21 pm

Re: Market Prices

Post by sk14 »

The code you sent worked great, thank you. I do have another question. I've noticed another anomaly with the pricing.
Market Prices 10_46_am.jpg
Market Prices 10_23_am.jpg
The 2 photos were taken about 20 minutes apart and you can see for the first 4 stocks/indices (Dow Jones, Nasdaq, S&P 500, Amazon) the pricing and price change move in tandem. However, for the remaining stocks, the "pricing change" variable changes while the "price " variable does not. Nvidia for instance shows no change in Price (732.02) yet the Price Change goes from 17.38 to 16.89. When I checked CNBC, the price had definitely changed and corresponded to the Price Change variable.

Clearly the Skin is picking up a change in Price, but the Price display isn't changing. The only 4 stocks that appear to show fully correct numbers are the top 4 in my list. I wonder if something in the code is not quite correct for stocks 5-13.

Thanks for your continues support of this great skin.
You do not have the required permissions to view the files attached to this post.
User avatar
Mordasius
Posts: 1163
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Market Prices

Post by Mordasius »

sk14 wrote: February 14th, 2024, 4:00 pm .... the Skin is picking up a change in Price, but the Price display isn't changing. The only 4 stocks that appear to show fully correct numbers are the top 4 in my list. I wonder if something in the code is not quite correct for stocks 5-13.
Sorry but I can't replicate this problem. My version seems to be indicating corresponding changes for Price and Price Change although I must admit I didn't use a calculator to check the values.
30minutes.png
I had to use Asian stocks rather than your stocks because the US Markets don't open until the evening over here but I can't see any reason why that would make any difference to the price and price changes being displayed.

Without anything else to work on I suggest that you collect a few WebParserDump.txt files for us to look at. Firstly modify the [Infos] Webparser measure to set Debug=2.

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 the URL=file://#@#WebParserDump.txt if you want to test adaptations or customisation of the skin.
; URL=file://#@#WebParserDump.txt
;---- setting Debug=2 will download your stock prices to WebParserDump.txt which can then be copied the #Resources folder for testing
Debug=2

Load MarketPrices.ini and once the prices are being shown go into the ....Documents\Rainmeter\Skins\MarketPrices folder and rename WebParserDump.txt to indicate the time it was downloaded (something like WebParserDump-1402.txt). Continue renaming the new WebParserDump.txt files every ten minutes or so. Once you spot a few prices that haven't been updated to correspond to the Price Change please attach two or three of the most recently renamed WebParserDump.txt files to a post here.

It might also help to add a copy of your current MoreThanOne.inc file to see if that is where the problem lies.
You do not have the required permissions to view the files attached to this post.
sk14
Posts: 19
Joined: February 9th, 2024, 7:21 pm

Re: Market Prices

Post by sk14 »

]Will do, though it will have to wait until next week as I will be out of town the next few days. It is very strange behavior as the prices shown on the skin remained fixed for a couple of hours, even though the price of the actual stocks changed significantly during that time. At one point several hours later the prices were once again correct. The "price change" variable moved up and down all day, every 10 minutes as expected so it was just a matter of the actual "price" variable not updating on the display.

Thanks again for your help and I will send the debug results next week. Here is the "MoreThanOne.inc"
MoreThanOne.inc
You do not have the required permissions to view the files attached to this post.