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.
It is currently September 8th, 2024, 1:06 am
Market Prices
-
- Posts: 25
- Joined: February 9th, 2024, 7:21 pm
Re: Market Prices
You do not have the required permissions to view the files attached to this post.
-
- Posts: 1178
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Market Prices
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.
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).
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 )]
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.
-
- Posts: 25
- Joined: February 9th, 2024, 7:21 pm
Re: Market Prices
The new version of the Skin solved both issues. Thanks again.
-
- Posts: 25
- Joined: February 9th, 2024, 7:21 pm
Re: Market Prices
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.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 1178
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Market Prices
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 )]
-
- Posts: 25
- Joined: February 9th, 2024, 7:21 pm
Re: Market Prices
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?
-
- Posts: 1178
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Market Prices
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 )]
-
- Posts: 25
- Joined: February 9th, 2024, 7:21 pm
Re: Market Prices
The code you sent worked great, thank you. I do have another question. I've noticed another anomaly with the pricing.
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.
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.
-
- Posts: 1178
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Market Prices
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. 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
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.
-
- Posts: 25
- Joined: February 9th, 2024, 7:21 pm
Re: Market Prices
]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"
Thanks again for your help and I will send the debug results next week. Here is the "MoreThanOne.inc"
You do not have the required permissions to view the files attached to this post.