Java: Get position's price Google Finance API - java

I need to use google finance api for my application and I must retrieve position's price.
I have looked for how to do that in the google docs but I have not find it.
I use Java api and I thought use PositionEntry and PositionData object but nothing about price into these objects.
So, how to retrieve this price ?

You can't directly access stock prices, using the Google Finance API, because they do not expose raw quote data due to data rights and licensing reasons.
You can compute it, however. Look at the transaction feed for a given position (You must own shares of the position, not just a 0-share entry.) Compute the total number of shares owned (cumulative buys less cumulative sells) and then look at the market value of the position.
Market value / number of shares owned = individual share price.

Related

Find location in radius

I have a gps coordinate, I wish to get a list of adresses inside it's certain radius. From these adresses I wish to select the ones that are companies and contain specific sector name. (clothing, finance, metallurgy, etc..), I thought the returned api object may contain the necessary information to make the distinction. Is there a free api that has the necessary functions to bring me closer to my goal ? (like google maps, google places, yahoo placefinder, and similar applications.)
Note: I use the MVEL language, I guess it has access to some Java functions so you can consider me writing Java, but any information considering the MVEL language is also appreciated.
Note2: Radius is not an essential requisite, it would be enough if I found the adresses in a certain district. The classification however, is necessary.
I think you can take a look into :
GoogleMapServicesJava
Particulary into the Places API service :
Places API
Where you can query a search sort by radius, place type, etc...
Hope that will help !

Android in-app payment for physical items, where to store price information?

I am working on a Android app with the possibility to purchase a physical items. The payment will be implemented with help of the Paypal SDK.
Now i am facing a problem. I only offer two products which can be ordered. First one for say 10 Euro and the second one for 15 Euro.
Where do I have to place the price information which is then to be transfered to Paypal? I don´t think hardcoding the price for my items
into the app is a good approach, but I did not find any better solution for it. I decompiled the app of one competitioner and saw that he also just saves the
price into the app?
Once i hardcode the price information into the app, how should I change it in future? Old app installations will always have
the old price? Lets say it was 10 Euro and now it should be 12 Euro?! How should I change that?
One possibility would be to get the price informaton from my CloudService each time the user starts my app?
What are other solutions for that problem? I want to be flexibel to change the price of my products and to be safe from manipulation.
(I would verifiy the payment with my CloudService and Paypal)
Regards
Store price on your Server this is the best way
You set pricing in Google Play Console.
Go to your application, Store presence, In-app products.
You can add your products and pricing info in there.

Is there anyway we can associate all ticker symbols against the stock exchange they are listed in?

I've been using Yahoo! Finance API to fetch stock prices. The XML in the links 1 and 2 have a list of most ticker symbols I would need, but they are jumbled and not sorted based on the stock markets they are associated with (for e.g., I would like to associate Google's ticker symbol 'GOOG' against NASDAQ). Given the total number of companies listed in the XML files, it would be extremely time consuming to try and manually associate them against their stock market.
Is there anyway we can achieve this using code (preferably Java) or is there an available site which does that for us? I have been Googling this for the past couple of days but haven't been able to find anything helpful. Please let me know if anymore details are required.

Java: Accessing Memory Objects, Members, and Information in Computer's memory (With Reflection?)

Dr. Gamut's Comment:
"Here's the memory locations of the string data of items for sale and purchase history, the offsets in bold are the only ones that need to be adjusted. For sale: [[[[[[[ffxiv.exe+F8EBE0]+20]+18]+84]+20]+32C]] Price +0 Total +4 Quantity +8 Town +C Retainer +10 Next Item Price +14 Purchase history [[[[[[[ffxiv.exe+F8EBE0]+20]+1C]+84]+20]+AFC]] Price +0 Quantity +4 Buyer +8 Time +C Next Item Price +14 I'm going to work on my own standalone application for private use, but integrating a feature like this into your program which is already widely used and trusted could really benefit the community."
I want to access this memory location using Java. I'm creating a FFXIV Market Analyzer and can so far: - Receive Input for an Item (Name, Description, Personal Notes, Components of this Item, Items this is a component of, Current Prices and Historical Prices based on High/Regular Quality) - Save and Load said Input from a Data File. - Analyze data to give you the average current individual price, quantity, and total gil price. - Analyze data to give you the average historical individual price, quantity, total gil price, average time between purchases, and average gil traded per hour. There is no problem with the tools for analyzation, but getting the info is tedious and repetitive. How can I access this memory so that the input system becomes automated?
I heard that Reflection can give me an object and it's members, but how do I access memory from the main computer?
Reflection is used to get references to Class, Method and Constructor objects (among others). Essentially you are accessing meta-data about loaded classes. It is not used for retrieving data from memory or disk.
You don't access the main memory. You cannot do this with Java and most operating system will forbid it anyway, no matter which language. It would be a big security issue if you could just "access" some memory.
And: No matter what you want to do, accessing "some memory" is a pretty bad idea. Languages like Java are made to hide things like - because it is a bad idea. Sometimes you must access memory addresses, like when you develop a driver or some operating system facilities. Maybe for other hardware dependent task. But I think in your case (collecting some price data of something) it the completely wrong way.
And by the way, who is Dr. Gamut?

product comparison across categories

I was looking a price comparison site like this. So the question is how it knows two products from two different sites to be of same product and clubs the two to same bucket to show the price comparison.
If it is only books than i can understand that all books have unique ISBN number so just write some website specific code which will fetch data from the websites and compare.
e.g. you have two websites:
www.xyz.com
www.pqr.com
Now these two websites list their books differently i.e. the html will be different, so parse the HTML and fetch ISBN, price from it. Than for corresponding ISBN we can put the two website's price. It is simple, but how you will parse for products which does not have an id which is unique and uniform (like presser cooker, watch etc…) across websites like ISBN.
Thanks.
Other products also have identification numbers, in Europe it is the EAN which is currently turned into a global number called GTIN. In ecommerce usually Amazon IDs (ASIN, of which ISBN is a subset) are often used.
If you don't have these numbers available, which is usually the case, you will need a strategy called Record Linkage or Data Matching.
TL;DR It usually uses a string matching algorithm to find similar "worded" products (using an inverted index on n-grams for example). In the end you can use machine-learning to remove the wrong matches (false-positives). This requires a lot of training data (there are no or too small public datasets available) and thus most of the time a human will check those matches.
For a more detailed analysis of the problem I can only recommend reading the book Data Matching by Peter Christen. It goes deep into information retrieval (how to find similar products) and then how to sort out wrong or right matches using machine-learning (e.g. via structural analysis).
There are also plenty of papers by him available on the net, so checkout his scholar profile.

Categories