It is currently September 16th, 2024, 7:12 pm

Market Prices

RSS, ATOM and other feeds, GMail, Stocks, any information retrieved from the internet
User avatar
Mordasius
Posts: 1178
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Market Prices

Post by Mordasius »

emp00 wrote: April 6th, 2024, 11:33 am @Mordasius: You are checking for the string "UNCH" in <change> and <change_pct> but in my stock portfolio I have never seen this giving "UNCH" in my Webparser-dumps:
Actually we are not checking for the string "UNCH" but rather substituting '0' for "UNCH" ( Substitute="UNCH":"0" ) in [mIndex_UpDown]. That's a carry over from earlier versions of MarketPrices ( pre-February 2024) when the price of each stock/index was read from a separate web page which sometimes displayed "UNCH" meaning unchanged. This mostly meant that the stock was not being traded because the markets were closed. However, some stock are traded after hours which shows as changes in price and Indices in particular seem to be "traded" or at least the composite price changes all the time.

So whilst the "UNCH" flag indicates when many stocks and commodities are, or rather are not, being traded it can't be reliably used determine whether the markets are open or closed. I expect all the information you need is buried somewhere in the CNBC xml file - it's just a case of waiting until the markets open on Monday to see what is going on.
sk14
Posts: 25
Joined: February 9th, 2024, 7:21 pm

Re: Market Prices

Post by sk14 »

Mordasius wrote: April 6th, 2024, 6:12 am Yes that is what was needed. It seems to be working well and behaving itself on my desktop. Guess I'll have to leave it there until the markets open to see what happens.
The only changes I made to your last posted Skin was to add the lines limiting decimal places to (2). Don't know if that could have any effect.
sk14
Posts: 25
Joined: February 9th, 2024, 7:21 pm

Re: Market Prices

Post by sk14 »

A few new pics from today showing the "gray" issues with the Skin. Was wondering if you had any luck with finding the culprit.
You do not have the required permissions to view the files attached to this post.
Crick
Posts: 4
Joined: April 16th, 2023, 11:33 pm

Re: Market Prices

Post by Crick »

Hello everyone,
I have a problem with the latest version of the skin. When adding the CW8^-IT action, nothing works anymore. After various tests, this is when a symbol contains "^".
Do you have any ideas to resolve this?
Capture d'écran 2024-04-23 001208.png
You do not have the required permissions to view the files attached to this post.
User avatar
Mordasius
Posts: 1178
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Market Prices

Post by Mordasius »

Crick wrote: April 22nd, 2024, 10:14 pm I have a problem with the latest version of the skin. When adding the CW8^-IT action, nothing works anymore.
I think this is because you entered the wrong symbol in StockSymbols.inc

What you need to do is go to http://www.cnbc.com then enter the stock/index name you want in the search box. When the page opens look in the top-left address window and make a note of EXACTLY what comes after https://www.cnbc.com/quotes/

In this case the page address is https://www.cnbc.com/quotes/CW8%5E-IT which means you need to enter the following in StockSymbols.inc

Code: Select all

Label-1="Amundi Index Solutions"
Symbol1=CW8%5E-IT
Crick
Posts: 4
Joined: April 16th, 2023, 11:33 pm

Re: Market Prices

Post by Crick »

Perfect, thanks you very much :]
sk14
Posts: 25
Joined: February 9th, 2024, 7:21 pm

Re: Market Prices

Post by sk14 »

Mordasius wrote: April 6th, 2024, 6:12 am Yes that is what was needed. It seems to be working well and behaving itself on my desktop. Guess I'll have to leave it there until the markets open to see what happens.
Any update?
emp00
Posts: 117
Joined: October 7th, 2022, 8:08 pm

Re: Market Prices

Post by emp00 »

Dear Team,

I am looking for the possibility to show the current "post market / after hours" price. As of now, the skin only shows the <last> price from the regular market (which is often an outdated closing price) -> I would like to see the "extended market" quote if it's available. If no such extended market price is delivered by CNBC, of course the regular last price shall be displayed. Has anybody already implemented this functionality? Thanks for sharing the relevant measures.

See below NVDA.O as example. In case <extendedMktQuote> is available -- how to parse this additional <last> price from under <extendedMktQuote> (here: 1069.00) and ignore the <last> closing price (here: 1064.69) ? Of course also the <change> and <change_pct> parsing measures should use the <extendedMktQuote> structure tags and since <extendedMktQuote> is not available for all stocks/exchanges, there needs to be some error handling in the parsing measures as well... Can anybody help ?

Code: Select all

<quickQuote>
  <extendedMktQuote>
    [...]
    <change>4.31</change>
    <change_pct>0.4048</change_pct>
    <last>1069.00</last>
  </extendedMktQuote>
  [...]
  <change>-0.00</change>
  <change_pct>-0.00</change_pct>
  <last>1064.69</last>
</quickQuote>
For reference, this is the full xml structure for the NVDA.O example :
<quickQuote>
<altName>NVIDIA Corp</altName>
<altSymbol>NVDA.O</altSymbol>
<assetSubType>Common Stock</assetSubType>
<assetType>STOCK</assetType>
<cacheServed>false</cacheServed>
<cachedTime>Mon May 27 03:51:02 EDT 2024</cachedTime>
<change>-0.00</change>
<change_pct>-0.00</change_pct>
<cnbcId>0</cnbcId>
<code>0</code>
<comments>Composite</comments>
<countryCode>US</countryCode>
<curmktstatus>POST_MKT</curmktstatus>
<currencyCode>USD</currencyCode>
<exchange>NASDAQ</exchange>
<extendedMktQuote>
<afthrs_last_time>2024-05-24T01:00:00.000-0400</afthrs_last_time>
<change>4.31</change>
<change_pct>0.4048</change_pct>
<exchange>NASDAQ</exchange>
<fullchange>4.3099</fullchange>
<fullchange_pct>0.4048</fullchange_pct>
<last>1069.00</last>
<last_time>2024-05-24</last_time>
<last_time_msec>1716796262674</last_time_msec>
<source>Last NYSE Arca, VOL From CTA</source>
<timeZone>EDT</timeZone>
<type>POST_MKT</type>
<volume>1529669</volume>
</extendedMktQuote>
<feedSymbol>NVDA.O</feedSymbol>
<fullVolume>42949367</fullVolume>
<fundamentalData>
<beta>1.6785</beta>
<DEBTEQTYQ>19.759066</DEBTEQTYQ>
<dividend>0.40</dividend>
<dividendyield>0.0004</dividendyield>
<eps>17.0868</eps>
<feps>24.448</feps>
<fpe>43.549164</fpe>
<fpsales>22.263304</fpsales>
<fsales>117635760128</fsales>
<GROSMGNTTM>75.43435</GROSMGNTTM>
<MPreviousClose>1037.98999</MPreviousClose>
<mktcap>2618960642048</mktcap>
<mktcapView>2618960.5M</mktcapView>
<NETPROFTTM>53.3971</NETPROFTTM>
<PDYTDPCHG>109.60179</PDYTDPCHG>
<pcttendayvol>1.0593</pcttendayvol>
<pe>62.31067</pe>
<psales>32.829754</psales>
<ROETTM>115.6553</ROETTM>
<revenuettm>79773999104</revenuettm>
<revenuettmView>79774.0M</revenuettmView>
<sharesout>2459834112</sharesout>
<sharesoutView>2459.83M</sharesoutView>
<TTMEBITD>49853.0</TTMEBITD>
<tendayavgvol>40543152.00</tendayavgvol>
<yragoprice>305.38</yragoprice>
<yragopricechange>759.30994</yragopricechange>
<yragopricechangepct>248.64429</yragopricechangepct>
<yrhidate>2024-05-24</yrhidate>
<yrhiprice>1064.75</yrhiprice>
<yrlodate>2023-05-24</yrlodate>
<yrloprice>298.06</yrloprice>
</fundamentalData>
<high>1064.75</high>
<issue_id>218647</issue_id>
<issuer_id>27095</issuer_id>
<last>1064.69</last>
<last_time>2024-05-24</last_time>
<last_time_msec>1716796262674</last_time_msec>
<low>1030.00</low>
<mainmktstatus>CLOSE</mainmktstatus>
<name>NVIDIA Corp</name>
<onAirName>NVIDIA</onAirName>
<open>1044.49</open>
<prev_prev_closing>1037.99</prev_prev_closing>
<previous_day_closing>1037.99</previous_day_closing>
<provider>CNBC QUOTE CACHE</provider>
<providerSymbol>NVDA</providerSymbol>
<quoteDesc/>
<realTime>true</realTime>
<reg_last_time>2024-05-24T16:00:00.000-0400</reg_last_time>
<reg_market_close>16:00:00</reg_market_close>
<reg_market_open>09:30:00</reg_market_open>
<responseTime>Mon May 27 03:51:02 EDT 2024</responseTime>
<shortName>NVDA</shortName>
<source>Last NYSE Arca, VOL From CTA</source>
<streamable>1</streamable>
<symbol>NVDA</symbol>
<symbolType>symbol</symbolType>
<timeZone>EDT</timeZone>
<todays_closing>1037.99</todays_closing>
<trading_day_type>HOLIDAY</trading_day_type>
<volume>39728626</volume>
</quickQuote>
<quickQuote>
User avatar
Yincognito
Rainmeter Sage
Posts: 8153
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Market Prices

Post by Yincognito »

emp00 wrote: May 27th, 2024, 8:32 am Dear Team,

I am looking for the possibility to show the current "post market / after hours" price. As of now, the skin only shows the <last> price from the regular market (which is often an outdated closing price) -> I would like to see the "extended market" quote if it's available. If no such extended market price is delivered by CNBC, of course the regular last price shall be displayed. Has anybody already implemented this functionality? Thanks for sharing the relevant measures.

See below NVDA.O as example. In case <extendedMktQuote> is available -- how to parse this additional <last> price from under <extendedMktQuote> (here: 1069.00) and ignore the <last> closing price (here: 1064.69) ? Of course also the <change> and <change_pct> parsing measures should use the <extendedMktQuote> structure tags and since <extendedMktQuote> is not available for all stocks/exchanges, there needs to be some error handling in the parsing measures as well... Can anybody help ?

Code: Select all

<quickQuote>
  <extendedMktQuote>
    [...]
    <change>4.31</change>
    <change_pct>0.4048</change_pct>
    <last>1069.00</last>
  </extendedMktQuote>
  [...]
  <change>-0.00</change>
  <change_pct>-0.00</change_pct>
  <last>1064.69</last>
</quickQuote>
Short answer - you should use branch reset groups in your final extraction measures:
https://www.regular-expressions.info/branchreset.html
Use the <extendedMktQuote> <last> pattern as the 1st branch, and the regular <last> one as the 2nd branch. That way, the regex will first look to capture the <last> in <extendedMktQuote> as \1, and if it fails, it will instead capture the regular <last> as \1.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
emp00
Posts: 117
Joined: October 7th, 2022, 8:08 pm

Re: Market Prices

Post by emp00 »

Yincognito wrote: May 27th, 2024, 11:14 am Short answer - you should use branch reset groups in your final extraction measures:
https://www.regular-expressions.info/branchreset.html
Use the <extendedMktQuote> <last> pattern as the 1st branch, and the regular <last> one as the 2nd branch. That way, the regex will first look to capture the <last> in <extendedMktQuote> as \1, and if it fails, it will instead capture the regular <last> as \1.
That sounds like a perfect-fit solution! I really tried: reading, understanding, finding examples (I need concrete examples for understanding...). Found even this branch reset demo on regex101.com but it's too much for me. Can you give me a hint how to adapt the below RegExp expression in the measure [mIndex1_Price] ?

Below code includes the Webparser and all variables needed for live testing, if needed. it's basically Mordasius skin. This CNBC-RegExp grabs 7 stock symbols from around the world, some with extended market data... StringIndex=1 is obviously NDAQ and StringIndex=6 is NVDA in this example... I just need a working expression for 1 measure. Thanks for sharing your incredible RegEx expertise!

Code: Select all

StockSymbolList="NDAQ|.FTSE|.SZSC|TL01-FF|MSFT|NVDA|%40GC.1"
QuickQuote=(?(?=.*<quickQuote>).*<quickQuote>(.*)<\/quickQuote>)

[CNBC]
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=[&StockSymbolList]&callback=quoteHandler1
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0
RegExp=(?siU).*#QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote##QuickQuote#
UpdateRate=600

[mIndex1_Price]
Measure=WebParser
URL=[CNBC]
StringIndex=1
; This is the current/last price!
RegExp=(?siU)^.*?<last>(.*)<\/last>
StringIndex2=1
DecodeCharacterReference=1