I am integrating foursquare place api.
They provide place price as numeric value (1~4)
This is their official doc
I want to know exact price value.
For example, for 1 Cheap => 1$ ~ 100$
They have no explain about this.
Where can I get this info?
Thanks
The price value is a relative allocation. The algorithm scraped menu prices and does a comparison of nearby places (simplest way to explain it). So there isn't an actual dollar amount assigned to any tier.
Related
I am writing a trading bot in C++. I am making limit orders that allow for 1% leniency. As you can see there is a market price of 2.2532, and I made a limit buy at 2.2757. Logically, if the limit buy should be activated once the market price is at or below the limit price. However, as you can see from the pictures below, this is not the case. I posted pictures of both the order book and the trade history. What I am wondering is why. Does this have something to do with the order book? I also noticed when placing market values generally there is a fairly large discrepancy between the price of the market and the average price it is filled at.
Since getting the market price on Binance does not seem to actually tell you if the market order will be full-filled at that price, or if the limit order can go through at a price around there. Is there a way to actually programmatically/mathematically find out if a limit order will go through. Or, find out what the actual average price of a market order will be if bought in that moment?
UPDATE
So when I go to place a market order, I get this message:
Your order price will be 8% higher than the latest market price. Please proceed cautiously. When I want to buy at the market price. Partially I want to know why. But also, is there a way to get the exact number in which this price will be? Also, Is there a way to get this on the API exactly what the next market buy/sell will be?
After some more research on the question. According to investopedia
A trade will only occur when someone is willing to sell the security at the bid price, or buy it at the ask price.
Meaning, the price at which the asset will be sold at has less to do with the current market price, and a lot more to do with the order book. Looking at the pictures above, at that time according to limit orders the lowest someone was willing to sell the asset was, was 2.500 and the highest someone was willing to buy the asset for was 2.499. These are the ask price and bid price respectively. Since no one was willing to buy at the ask price or sell at the bid price, the transaction did not go through. Notice that the quantities are also important for knowing how much of the order will be filled, for your future reference.
For those that might be a little confused, you need to buy at the lowest someone is willing to sell. You need to sell at the highest someone is willing to buy. These come from the limit orders.
Back to the original question, the update on the 8% difference makes sense, the ask price probably dropped a little. However, if you notice 2.2532 * 1.08 is 2.433456 which is much closer to the 2.5 price above than the limit buy created at 2.2757 meaning the 8% notification makes sense.
I will now explain how you would calculate this using mathematics and coding. You need to pull from the order book ticker. This api request is /api/v3/ticker/bookTicker
I am going to use the example of wanting a market buy for GRTUSD. The dictionary you get back from the link https://api.binance.us/api/v3/ticker/bookTicker?symbol=GRTUSD is {"symbol":"GRTUSD","bidPrice":"0.1391","bidQty":"3613.45000000","askPrice":"0.1393","askQty":"5183.18000000"}
Some quick math shows that 5183.18000000 of GRT is the equivalent of a little over 722 USD at the ask price. This means if I placed a market buy for GRTUSD. As long as the amount of USD I was investing at that moment was equivalent to or less than 722 USD it would get filled at the ask price of 0.1393
I have little experience with payment gateways, and am trying to figure out how to synthesize the type of subscription billing that I am looking for: the monthly price gets rebalanced once a year, based on another attribute (a number that can get as high as seven or eight digits).
So, for example, the monthly subscription price as of January 1st will be a % of a user's credit card debt balance as of Dec 15th in the prior year. But the debt balance can get very high / does not have a cap.
I looked at the Stripe documentation to figure out of there's a way to do this. The only thing I could come up with is to use unit_amount in metered pricing and tying this to the credit balance. In other words, I would grab the debt balance number and use it as the unit_amount, and then apply a %. But then I need to also forward bill, so I trick the logic into shifting by a month, which seem impractical.
Alternatively, I am not sure I could do this with per seat pricing (e.g. $1 in debt = 1 seat). But I assume there's a max to the number of seats (i.e. someone cannot have, say 1m seats). I just couldn't determine this from the documentation...
That's what I was thinking, anyway. Perhaps there's a better way?
You've got a couple different options here:
At the start of the year you update the Subscription to a new price based on the calculations of the customer's credit card debt balance by specifying items[0].price_data. Setting items[0].price_data (see the api ref) allows you to create an "in-line price" that as part of the updating the Subscription, so you don't have to create one separately through a separate API request. If you haven't seen Stripe's docs on how to update the price of a Subscription you can see an example here, and you'll likely want to read about proration_behavior as well.
You have a single Price where 1 seat = $1 in debt, and you control how much you want to charge by changing the number of seats for the Subscription. I don't think Stripe has a limitation to the number of seats (as long as it's a valid integer), but they do have a limitation on the maximum amount you can charge which you can read about here. For USD the maximum charge amount is $999,999.99, so the maximum quantity would be you could specify for a $1 price is 999,999.
You could look into using metered pricing, but given that you don't want to bill at the end of the billing cycle the other two options seem better.
I think the first option (updating the price year by year) is your best one, but definitely try all of them out in test mode and take a look at how the Invoices look to see which one you like best.
I just want to thank you guys in advance. I think you guys are doing a great job in helping people out with programming stuff. Pats on the back for all of you.
Here is what I've been working on: I have daily stock price return data on about 4000 stocks. I want to add them to my portfolio after observing their performance for 12 months. I will choose the top 10% best performers and bottom 10% worst performers. I will create multiple portfolios over a period of time. I have done that with no problem.
I want to use the INDEX function to calculate the daily return of my portfolio. Not all 4000 stocks are in my portfolio, about 300 stocks are in my portfolio at any given time. The daily portfolio returns will be calculated by multiplying the weights (they are equal weighted, so 1/300) to that stock's return on the specific date. I assume it has to do with a combination of INDEX, SUMPRODUCT, and IF or MATCH functions.
I have been thinking this for a long time and I just can't get to the bottom of it. I have attached pictures for a portion of what I was working on. I think will give you a good picture of what I'm trying to do. I bet this is such an easy thing for you guys. I hope you can help me out! Thanks again!
PICTURES:IN or OUT portfolio & Stock's individual returns
Charles
Not sure I understood your problem, but here is a trial suggestion:
You get data for 4000 stocks while you are monitoring 300. So, you need to find the correct one within your sheet (there will be 3700 that will not match anything).
If you have your stocks listed in, say, column "A", you could use the function LOOKUP (well explained in the Web). If you need to get the row of your stock, you can use the function MATCH.
If this is not what you are looking for, it means that I (at least) did not understand you, so you would need to add details to your question.
I need to develop web-based application that can compute or analyze the google average page rank of a keyword. It is the top 10 sites of that keyword in google. It is telling the script to add the pr of each 10 sites and divide it to 10.
Let say, I will input 500 keywords in a web-form then click Get Average Page Rank. It will give result of 500 keywords with average PR beside each one of it.
Option to sort PR from higher to lower, option to download as CSV. Option to use proxy server so not to get banned by google for many inquiry in one time.
The interface is like the text box to input keywords .output below but in 2 columns. 1 column for keyword and 1 column for average pr.
is there any google api available for this purpose ?
Thank you!
There is no Google API for that and the very idea that there is a global average rank for a given keyword is flawed. A keyword's influence depends on the page's niche and the user's search request.
Here is another question I have about being able to calculate this scenario in Access, or even at all for that matter:
I have a query that find the TOP 5 items sold in a given timeframe, and it groups by site. I use this to create a comparative chart between the site for ppt presentations. I do a lot of these but I have a problem with the presentation that I foresee they will have a problem with and it makes for bad metrics:
Some stores are bigger than others, and get much more supply. So a straight aggregate total of just qty of toping selling items, and comparing the locations is stacking the deck a little.
So if Site A gets 80% of the supply, and sells 500, Site B gets 15% supply and sell 75, and site C get 5% supply and sells 50 items, then Site C actually has the best sales for their size. I have exactly what I need in terms in the first chart (from my queries and such) to show the aggregate total, but what do I need to represent the idea mentioned above.
The factors that I have that go into this are:
ItemID - group by
Item - group by
qty sold - sum/descending (which is the variable that determines the Top 5)
Store/Location - Group By
and then I run a seperate query to get the total deliveries (supply) to each site
I realize that this may just be a lack of mathmatical understanding on my part, but can anyone help with this?
thanks
The first issue that I see isn't about SQL savvy; it's how to serve your data customer. What does he or she want to see? Metrics is a term with a holy ring, and for good reason: it's supposed to be what is used for the big business decisions, and it's scary easy to measure the wrong thing.
So I'd make sure I know what my customer wants. If you can't model it on a spreadsheet, you won't be able to develop your reporting effectively.
Every deck of cards is loaded. You have to know how they want it loaded.