It is currently September 14th, 2024, 7:02 am
Market Prices
-
- Posts: 180
- Joined: May 6th, 2021, 2:57 pm
-
- Posts: 11
- Joined: February 12th, 2016, 3:15 pm
- Location: Orilla
Re: Market Prices
Terrific work, although i have a question concerning conversions.
I live in the UK and therefore use sterling GBP, I currently have 4 Ericsson (ERIC) shares and it doesn't convert the Swiss Franc into sterling.
I don't have many shares in ERIC and only just bought them and have to buy a few each month.
the current value of the 4.23 shares is £35.23, yet the skin shows as 5.208.
Is it me not editing the prices correctly or something related to converting the swiss franc?
any tips?
You do not have the required permissions to view the files attached to this post.
I Want To believe
-
- Posts: 85
- Joined: May 19th, 2010, 9:05 pm
- Location: North of the Border
Re: Market Prices
thanks for the help and input. i've so busy at work haven't had a chance to check it out.
hopefully i have time this weekend.
thanks again for your help.
-
- Posts: 1178
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Market Prices
The MyPortfolio skin does not perform any form of currency conversion so the price you see is the price in whatever currency it says at the top of the page. Obviously the daily and overall Gain/Loss values are going to be a mess if they combine shares that were bought and are quoted in different currencies. It would be possible to incorporate some sort of exchange rate conversion in the MyPortfolio skin but let's try a quick and dirty fix first.Alienmoon wrote: ↑August 6th, 2021, 6:15 pm I live in the UK and therefore use sterling GBP, I currently have 4 Ericsson (ERIC) shares and it doesn't convert the Swiss Franc into sterling.
I don't have many shares in ERIC and only just bought them and have to buy a few each month.
... the current value of the 4.23 shares is £35.23, yet the skin shows as 5.208.
Am I right in thinking all the other shares you are watching are quoted in GBP and that the 'BuyPrices' you have used are in GBP? If so, you could try the following Q&D fix:
1) Edit the appropriate entry in Mystockcodes.inc to:
Code: Select all
Symbol3 = ERIC
;-[ The number of units you hold
Units3 = 4.23
;-[ Your Buy price in GBP = 35.23 / 4.23 = 8.3286052 GBP / unit
BuyPrice3 = 8.3286052
;-[ Convervsion of the quoted Price to GBP = 0.72 GBP/USD
Convert3 = 0.72
Code: Select all
[cDayLossGain3]
Measure=Calc
;xxxxx Formula= ( mIndex3_Change * #Units3# )
Formula= ( mIndex3_Change * #Convert3# * #Units3# )
RegExpSubstitute=1
Substitute="\-":"","^(\d{1,3})(\d{3})(\d{3})$":"\1,\2,\3","^(\d{1,3})(\d{3})$":"\1,\2"
DynamicVariables=1
[cChangeFromBuyPrice3]
Measure=Calc
;xxxxx Formula= ( mIndex3_Price - #BuyPrice3# )
Formula= ( ( mIndex3_Price * #Convert3# ) - #BuyPrice3# )
IfCondition=(#CURRENTSECTION# > 0)
IfTrueAction=[!SetVariable "OverallColor3" "#ColorUp#"]
IfCondition2=(#CURRENTSECTION# = 0)
IfTrueAction2=[!SetVariable "OverallColor3" "#ColorSteady#"]
IfCondition3=(#CURRENTSECTION# <0 )
IfTrueAction3=[!SetVariable "OverallColor3" "#ColorDown#"]
OnChangeAction=[!ShowMeterGroup OverallGroup3] [!UpdateMeterGroup OverallGroup3] [!Redraw]
DynamicVariables=1
Does the entry for LM Ericsson Telefon make any more sense now?
-
- Posts: 11
- Joined: February 12th, 2016, 3:15 pm
- Location: Orilla
Re: Market Prices
All are in GBP except ERIC, as you say, the numbers are all messed up.
I tried adding my 12th stock this morning, but only a blank space appeared, not showing the stock or any numbers.
I will have to edit the code hopefully on Sunday, short for time over the weekends, but i will report back and let you know the outcome.
Question
Do i replace all
Code: Select all
Symbol4=ERIC
Units4=4.23
BuyPrice4=11.53
Code: Select all
Symbol4 = ERIC
;-[ The number of units you hold
Units3 = 4.23
;-[ Your Buy price in GBP = 35.23 / 4.23 = 8.3286052 GBP / unit
BuyPrice3 = 8.3286052
;-[ Convervsion of the quoted Price to GBP = 0.72 GBP/USD
Convert3 = 0.72
or do i make it look like this?
Code: Select all
Symbol4=ERIC
BuyPrice3 = 8.3286052
Convert3 = 0.72
Excuse my naivety
again, Thanks for everything
I Want To believe
-
- Posts: 1178
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Market Prices
Please note that all the Variable names MUST end in the same number which in my example is number three (3). So following my example the entry for Stock No. 3 should be:Mordasius wrote: ↑August 7th, 2021, 5:07 am
1) Edit the appropriate entry in Mystockcodes.inc to:Code: Select all
Symbol3 = ERIC ;-[ The number of units you hold Units3 = 4.23 ;-[ Your Buy price in GBP = 35.23 / 4.23 = 8.3286052 GBP / unit BuyPrice3 = 8.3286052 ;-[ Convervsion of the quoted Price to GBP = 0.72 GBP/USD Convert3 = 0.72
Code: Select all
Symbol3 = ERIC
Units3 = 4.23
BuyPrice3 = 8.3286052
Convert3 = 0.72
Having made that correction I suggest you cut and paste the following at line 191 in AddMoreStocks.inc.
Code: Select all
[cDayLossGain3]
Measure=Calc
Formula= ( mIndex3_Change * #Convert3# * #Units3# )
RegExpSubstitute=1
Substitute="\-":"","^(\d{1,3})(\d{3})(\d{3})$":"\1,\2,\3","^(\d{1,3})(\d{3})$":"\1,\2"
DynamicVariables=1
[cChangeFromBuyPrice3]
Measure=Calc
Formula= ( ( mIndex3_Price * #Convert3# ) - #BuyPrice3# )
IfCondition=(#CURRENTSECTION# > 0)
IfTrueAction=[!SetVariable "OverallColor3" "#ColorUp#"]
IfCondition2=(#CURRENTSECTION# = 0)
IfTrueAction2=[!SetVariable "OverallColor3" "#ColorSteady#"]
IfCondition3=(#CURRENTSECTION# <0 )
IfTrueAction3=[!SetVariable "OverallColor3" "#ColorDown#"]
OnChangeAction=[!ShowMeterGroup OverallGroup3] [!UpdateMeterGroup OverallGroup3] [!Redraw]
DynamicVariables=1
Also please note that you will have to reapply the cut/paste at line 191 in AddMoreStocks.inc everytime you add or remove new stocks. This is because the file AddMoreStocks.inc is over-written every time you change the NumberOfStocks.
-
- Posts: 11
- Joined: February 12th, 2016, 3:15 pm
- Location: Orilla
Re: Market Prices
Yes, i added the 4 in my post for ERIC as it was 4th in the list, however, I have done as you instructed and it would seem I have done something wrong. As you can see the overall Gain / loss in the 3rd row is broken.Mordasius wrote: ↑August 8th, 2021, 6:34 am Please note that all the Variable names MUST end in the same number which in my example is number three (3). So following my example the entry for Stock No. 3 should be:
Save the files you have edited and hit Refresh. Now have a look at entry number 3 in your portfolio. It should be for LM Ericsson Telefon and show the corrected values for amount invested, daily gain and overall gain/loss in GBP (assuming 1 USD = 0.72 GBP). How does it look now?
Also please note that you will have to reapply the cut/paste at line 191 in AddMoreStocks.inc everytime you add or remove new stocks. This is because the file AddMoreStocks.inc is over-written every time you change the NumberOfStocks.
Plus, all the decimals are in the wrong places, take Greencoat for instance, the skin shows i have over £10.751, when i actually only have £107.51.
The UK works in Pence and seeing that I'm only a small investor, I have to buy a number of shares each time i get paid.
I've bought shares 4 times in greencoat all at differing prices, so i alter the BuyPrice to reflect the number invested each time i buy.
BT Group shows i have £925.00 invested when I've only begun buying BT, a few at a time and only spent £9.25p
Alphawave says i have £5.506 as its supposed to be £55.06 and Darktrace is supposed to be £68.36.
Ignore those at £0 as I'm watching those and plan to buy in the next month or two.
Overall the skin reports i have £32.215 pound invested (I Wished), is this because of the difference between the US and UK markets count their doollars and pounds?
Added a 12th stock under NOKIA and as you can see, it shows up Blank
Code: Select all
[Variables]
;-------- Enter the number of stocks you want to track below -------------
NumberOfStocks=12
; #### Symbols -----------------------------------
; Find Symbols by going to http://www.cnbc.com then entering 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/ If there is a Period "." after the backslash "/" you must include it. or it will not work.
;eg https://www.cnbc.com/quotes/TSLA --> Symbol1=TSLA -----------------
; Units = Number of Units held
; BuyPrice = Per Unit Price of stock when bought
Symbol1=BT.A-GB
Units1=5
BuyPrice1=185.02
;----------------------------------
Symbol2=UKW-GB
Units2=80
BuyPrice2=134.39
;----------------------------------
Symbol3 = ERIC
Units3 = 4.23
BuyPrice3 = 8.3286052
Convert3 = 0.72
;----------------------------------
Symbol4=ORIT-GB
Units4=75
BuyPrice4=108.22
;----------------------------------
Symbol5=JAY-GB
Units5=4
BuyPrice5=11.18
;-----------------------------------
Symbol6=AWE-GB
Units6=12
BuyPrice6=458.85
;-----------------------------------
Symbol7=DARK-GB
Units7=11
BuyPrice7=621.45
;------------------------------------
Symbol8=SSIT-GB
Units8=0
BuyPrice8=113.25
;------------------------------------
Symbol9=TRIG-GB
Units9=0
BuyPrice9=133.00
;------------------------------------
Symbol10=DRX-GB
Units10=0
BuyPrice10=403.80
;------------------------------------
Symbol11=NOKIA-IT
Units11=0
BuyPrice11=5.26
;------------------------------------
Symbol12=GSF-GB
Units12=0
BuyPrice12=112.00
Again, Sorry for all the issues
You do not have the required permissions to view the files attached to this post.
I Want To believe
-
- Posts: 1178
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Market Prices
I'm sorry to say that this skin is not capable of doing what you expect it to do - at least not in the way you are trying to use it.
Without wasting our time on the details of each stock you are trying to track let's just say that:
1) The BuyPrice you use must be in the same units as those quoted for the price on CNBC.com. So if CBNC quotes the price of Greencoat in GBP you need to specify the BuyPrice2 in GBP/unit (not pence per unit as you seem to have done).
2) This skin can not handle multiple buy prices. The skin is made for people that buy so many units at a price of XX and that is that. If, as you appear to be doing, you are buying a few units at price x and a few more units at price y this skin is never going to work without a lot of averaging on your part. Either that or you would have to add each batch of buys as a separate 'stock' which would be cumbersome at best.
Without wasting our time on the details of each stock you are trying to track let's just say that:
1) The BuyPrice you use must be in the same units as those quoted for the price on CNBC.com. So if CBNC quotes the price of Greencoat in GBP you need to specify the BuyPrice2 in GBP/unit (not pence per unit as you seem to have done).
2) This skin can not handle multiple buy prices. The skin is made for people that buy so many units at a price of XX and that is that. If, as you appear to be doing, you are buying a few units at price x and a few more units at price y this skin is never going to work without a lot of averaging on your part. Either that or you would have to add each batch of buys as a separate 'stock' which would be cumbersome at best.
-
- Posts: 11
- Joined: February 12th, 2016, 3:15 pm
- Location: Orilla
Re: Market Prices
Thanks for the clarification, i will add them as its supposed to be as you advice, I don't suppose I could just change the decimal location then?Mordasius wrote: ↑August 9th, 2021, 3:57 pm I'm sorry to say that this skin is not capable of doing what you expect it to do - at least not in the way you are trying to use it.
Without wasting our time on the details of each stock you are trying to track let's just say that:
1) The BuyPrice you use must be in the same units as those quoted for the price on CNBC.com. So if CBNC quotes the price of Greencoat in GBP you need to specify the BuyPrice2 in GBP/unit (not pence per unit as you seem to have done).
2) This skin can not handle multiple buy prices. The skin is made for people that buy so many units at a price of XX and that is that. If, as you appear to be doing, you are buying a few units at price x and a few more units at price y this skin is never going to work without a lot of averaging on your part. Either that or you would have to add each batch of buys as a separate 'stock' which would be cumbersome at best.
or is that not possible because of how CNBC.com works?
As for any stocks not in GBP, Ill just add them to your other skin, my portfolio, I think it'll make life easy as I'll not have to keep copy pasting over the rewrite.
I understand what you mean by adding multiple of a company each time i buy shares, i tried that, but didn't like how it looked and it only confuses the issue more.
again, thank you
I Want To believe
-
- Posts: 1178
- Joined: January 22nd, 2011, 4:23 pm
- Location: GMT +8
Re: Market Prices
The only way to fix your decimal place issue is by setting the BuyPrice in the same units used by CNBC.com when quoting the current share price. If you bought shares at 25 pence each and CNBC quotes the current price in GBP simply change your BuyPrice to 0.25 and the total Invested, Daily Gain/Loss and Overall Gain/Loss should show the correct values in GBP.