What are FIX-Protocol 4.4 CURRENCY DERIVATIVES ( futures / options ) TAGS? - fix-protocol

I have to implement Currency derivatives for Institutional model.
We have a trading application.
I would like to know are there any specific FIX-Protocol tags which are received or are to be sent from FIDESSA/BLOOMBERG terminals for Currency Derivative Trading?
For ex: a tag 21= ( {1|2|3}-indicating if it's BEST or DMA ).
Or they use the same set of tags which are generally used for Equity derivatives.
I would really appreciate if someone has a log or something or if someone can post a FIX-Protocol string for an Order Instruction for Currency Derivative trading.

Related

Does getPriceAmountMicros() include local taxes for skus of type subscription?

I've been using the Android billing client for a while now and always display the prices using getPriceAmountInMicros() from the SkuDetails object returned from the billing client.
Often we get complains from some of the customers that the price we display is not the same price they're paying. I've always assumed this is due to local taxes and that the Google play Store doesn't return the prices with local taxes included.
However, going to the documentation of getPriceAmountInMicros() things start to get a bit fuzzy. In particular this section:
This value represents the localized, rounded price for a particular currency.
What is a "localized price"? Is this including taxes? I cannot find any explicit place where it says this includes taxes or that it doesn't. By contrast the documentation for getPrice() explicitly states that the price does not include taxes.
Looking into a completely different resource, yet connected to a sku, one can see the same method - getPriceAmountInMicros(). In this method, it's explicitly stated that the price does not include taxes. It would seem odd to me that they would choose to name the method in a SkyDetails object the same, but have different semantics. Nevertheless, I want to be sure and would highly appreciate your help!
Thanks for pointing this out.
Because the QPS of computing taxes during skuDetails queries would be high, our servers defer tax computation to the purchase flow. So unless you need getPriceAmountMicros() for, say, refunds; you should simply use getPrice().

perfect fit for a Postgres function or not (and how)?

I'm working on this kind of data structure :
Now, say I have to search for products that are < 90 EUR, it should only returns the product "item2". On the other hand, if I search for products that are == 100 EUR, I should only returns the product "item1".
I have 60 000 products and 16 currencies, so I just can't convert all products in all currencies on a daily basis (as the currency rates updates daily) only to be able to perform this search.
I have 2 questions :
is this use case a good fit for a Postgres function ? Is there any other good and sustainable solution if not ?
if a postgres function is the solution. Given that I'm using Ruby on Rails (4.2) and the search requests (on products sizes, colors etc...) are chained using ActiveRecord : is the call to the DB function still chainable and usable in AR ?
Thanks for your help
Using a function for this is a terrible idea, because performance will suffer greatly: the exchange rates will change over time, rendering your indexes useless.
Further, it's a terrible idea to store a single price per item. Thing psychological prices and tax considerations: if something is €99.99 including VAT in the Eurozone, it'll probably make sense to sell it for $99.99 plus sales tax in the US. No amount of exchange rate manipulation using functions or other will change that. (Compare the prices of Apple in the US, in France, in the UK, etc.).
For each item, associate a price in Euros, one in Dollars, etc. -- each with a currency_id, and have the exchange rates reside in a separate table. Or create some kind of price-list table in which you associate prices based on currency (e.g. €99 = $99) to a price_id, and associate the products (it's actually the SKU, btw) to their corresponding price_id.
You can fill this data in semi-automatically using an exchange rate table, and periodically update them using one as well. But really: do reserve the ability to manually set prices, make sure you mark prices as including or excluding tax. And when it comes to taxes, don't forget that tax rates are different from a place to the next and from a product to the next.
For the record, I ended up creating a new column "price_eur" in the "products" table where I convert each price to EUR whatever is the original currency. Doing so I can perform a consistent search based on this price_eur column.
I just wanted to know if there was an alternative solution but looks like there is no other simple way...

How to cluster mail subject lines to mail threads?

If I only have the subject lines of mails (no other headers) is there a good algorithm (or package) to cluster them into a set of "related messages"?
A mail with the subject
Our travel plans
is probably related to
Re: Our travel plans and
Re: Re: Our travel plans.
So far so good, but there is also
AW: Our travel plans
Fwd: Our travel plans
Our travel plans (Forward)
I want to cluster all of them together into one thread. Mails with subjects like plans, Re: Our meeting and so on should not be in that thread, of course. I could very well live a hierarchical result -- actually, I kind of like that, because I'd expect that the chance that mails with similar content would get "closer" to each other.
So, i have a lot of ideas: Suffix matching, Prefix trees, Levensthein distances, Q-Gram profiles -- maybe too many. Therefore I ask myself: "Did anyone do this already?"
For sequence comparisons, I use Open Refine (formerly Google Refine) to try out clustering algorithms to fine-tune and identify the algorithm to use. It includes key collision (fingerprint, ngram & double-metaphone) and nearest neighbor (levenshtein distance & prediction by partial matching (PPM)).
https://github.com/OpenRefine/OpenRefine/wiki/Installation-Instructions
Once you have your data imported, just use facets to do your clustering.
Facet > Text facet > Cluster

What is the best way to manage number with currency?

In my application it's possible to store a price for every object and the user can also choose its preferred currency.
What is the best way to store and manage number with currency in iPhone SDK?
More infos about my app:
It uses Core Data.
Number that can be stored must be of type xxx.xx (e.g. 100.00).
How can I sort these numbers ascending or descending?
What kind of attribute I must set in my entity to store a number like this?
Have you got links, docs, source or guides to show me examples? I never user number with currency, then I've got some problems with them :)
Thanks a lot,
Matthew
Store it in GP (gold pieces) with a conversion factor ;)
It doesn't look like there's a datatype for currency, so storing the number and decimal part, and a setting for the current currency, is probably as good as you're going to get. See this: HowTo for newbie: Managing currency in iPhone app

a simple/practical example of fuzzy c-means algorithm

I am writing my master thesis on the subject of dynamic keystroke authentication. To support ongoing research, I am writing code to test out different methods of feature extraction and feature matching.
My current simple approach just checks if the reference password keycodes matches the currently typed in keycodes and also checks if the keypress times (dwell) and the key-to-key times (flight) are the same as reference times +/- 100ms (tolerance). This is of course very limited and I want to extend it with some sort of fuzzy c-means pattern matching.
For each key the features look like: keycode, dwelltime, flighttime (first flighttime is always 0).
Obviously the keycodes can be taken out of the fuzzy algorithm because they have to be exactly the same.
In this context, how would a practical implementation of fuzzy c-means look like?
Generally, you would do the following:
Determine how many clusters you want (2? "Authentic" and "Fake"?)
Determine what elements you want to cluster (individual keystrokes? login attempts?)
Determine what your feature vectors will look like (dwell time, flight time?)
Determine what distance metric you will be using (how will you measure the distance of each sample from each cluster?)
Create exemplar training data for each cluster type (what does an authentic login look like?)
Run the FCM algorithm on the training data to generate the clusters
To create the membership vector for any given login attempt sample, run it through the FCM algorithm using the clusters you found in step 6
Use the resulting membership vector to determine (based on some threshold criteria) whether the login attempt is authentic
I'm not an expert, but this seems like an odd approach to determining whether a login attempt is authentic or not. I've seen FCM used for pattern recognition (eg. which facial expression am I making?), which makes sense because you're dealing with several categories (eg. happy, sad, angry, etc...) with defining characteristics. In your case, you really only have one category (authentic) with defining characteristics. Non-authentic keystrokes are simply "not like" authentic keystrokes, so they won't cluster.
Perhaps I am missing something?
I don't think you really want to do clustering here. You might want to do some proper fuzzy matching though instead of just allowing some delta on each value.
For clustering, you need to have many data points. Additionally, you'd need to know the proper number of means you need.
But what are these multiple objects meant to be? You have one data point for every keycode. You don't want to have the user type the password 100 times to see if he can do it consistently. And even then, what do you expect the clusters to be? You already know which keycode comes at which position, you don't want to find out what keycodes the user use for his password...
Sorry, I really don't see any clustering here. The term "fuzzy" seems to have mislead you to this clustering algorithm. Try "fuzzy logic" instead.