OmniTrader Professional Forum OmniTrader Professional Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


This message cannot be deleted. It is the first message of the thread.
Administrators or moderators may choose to delete the entire thread


 
Boris Lund

Regular
2525
Posts: 59

Joined: 12/9/2021

User Profile
 
Subject : Read Weights from internal list
Posted : 1/10/2022 11:37 AM
Post #31828

'Reads from listed symbols and their outstanding shares.
'Calculates Market Cap for each and sums it up in a Total Market Cap.
'Second run it calculates each weight: Price*Shares / Total Market Cap
Example is done with a very simple list for verification.
SymbolShares = "AAPL,1,ABBV,2,ABT,3,"

From the DebugMSG
AAPL 170.33 Shares 1 MarketCap 170.33 Weight 0.2012524
ABBV 135.15 Shares 2 MarketCap 270.3 Weight 0.3193714
ABT 135.24 Shares 3 MarketCap 405.72 Weight 0.4793762
MarketCapTotal 846.35

Now it is possible to look at several symbols summarized, weighted or how many did x or y.
Example, how many from this list have hit their highest high within x-peiods (from the fear/greed index)


Thank you Jim for the pointers :)

[Edited by Boris Lund on 1/10/2022 11:41 AM]

Attached file : ReadWeigths.txt (2KB - 263 downloads)

Deleting message 31828 : Read Weights from internal list


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.