How to set a TP and SL using Limit and Stop orders in FIX API/QuickFIX/n - quickfix

I am using QuickFIX/n to write an application. I followed an example from the documentation(QuickFIX/n Example). Using this example I got the application working, but I want to know how to get the market price into my trading session so that I can set Limit and Stop Orders that act as SL/TP for my market orders.
The problem is I don't know how to get the pricing data into my trading application. Settings for the trading session and pricing sessions are different(even the host address, port, username, password).
I know that I need to have 2 sessions, pricing and trading sessions running simultaneously in the same application where I can access the pricing details such as Bid/Ask price so that I can set the limit/stop orders, but I don't know how to achieve this.
If someone can provide some assistance in this regards it would be great.
(an example application would be brilliant)
Thank you in advance.

Related

Golang server background notofication process

I apologize in advance for my bad english.
I've created simple training service in golang, which supports login and registration system with MongoDB. This service allows you to scrape rooms for rent in London in specified location if you loggedin. So, now I want to implement notifications for loggedin user's about new rooms in user's marked location. My first idea was to make some background process, which will scrape rooms every 30 seconds, save the results (in mongo, in cookies or somewhere else, advise me please), match new scrape results with previous and save differences (new rooms) in DB for future posting to user in some form (email or list on html page).
1) Is my idea about notifications generally correct? If not, please describe me better way to do this or point to some relating examples.
2) What is the best way to make that background process in go?
3) This would be great if you'd point me on some examples relating to the case.
The demo of service on Heroku
Github repo
I appreciate your concern.

Restrict Users from Programmatically posting form data

I have a very old ASP.net Application with a Web Form with 1 Dropdown Box and 2 Text Boxes and a Submit Button.
All 3 are mandatory fields. Based on the data entered, once the user clicks Submit Button additional details are shown on the next page from the database.
On Submit data is posted via Query String that looks like
http://myserver/myapp/search.aspx?f1=1&f2=tom&f3=sales
Though the application is doing what is supposed to do, off late we came across lot of issues:
As couple of entities that are interested in our data wrote programs to programatically build the querystrings and hitting our server.
This is slowing down the server and regular users who manually search records are facing lot of slowness.
Due to come legal restrictions we couldn't implement CAPTCHA or have users get authenticated.
I would appreciate if you can let me know if any of you have come across this kinda situation and how you have dealt with it.
Thanks in advance.
You could implement source-based rate limiting. I.e. per IP address only allow so many requests per minute. If the requester makes too many requests you simply reject the requests. You could also blacklist the IP addresses that are hitting your app too aggressively. Both of these policies can be enforced by a load balancer like HAProxy or nginx.

how do i track a users activity online

We are building a system that seeks to calculate and score the value of information and users of information - based on the interaction between the two.
To do this, we need to track and measure these interactions. We are working on different ways - from connecting your social services and monitoring them (hard to scale and requires very patient users happy to connect services) to explicit tracking having a bookmarklet ala digg that user can trigger whenever she is on a piece of information (basically, content) that she wants included in her score.
What we'd really like is a tool that could do something like;
monitor all activity of a person across all networks (read, watch, comment, post, tweet, author, etc) and actively sit in the users browser and 'listen and report' back to HQ anytime a defined activity takes place.
Suggestions?
If you want to monitor the Social network activities for ex. Facebook, you need to take the authentication from the user like read/friends list etc. and fetch the updates from facebook with in specific interval of time and report same to HQ.
The same thing you need to report for other networking sites.
Each network sites may have different APIs you need collect and take the permission of the users (like signin).
Hope it helps.

How do I show information to users belonging to different groups (web) in modx

I have created a website using modx evolution v1.0.2.
The website that I have developed has 12 different types of users (categorized in groups). Each user will be shown a different price depending on the group to which he belongs.
Till now I have been able to fetch the group name of current logged in user (created a snippet for that), but how can I achieve the above mentioned functionality so that each user should be able to see only the price that I have coded according to his group.
For example:
If a user is associated with the 'ocassional' group then he should be shown the price as , say, 50 bucks
and if a user is associated with the 'regular' group then he should be shown the price as, say, 40 bucks
I can easily do this by coding a single snippet for every product's variant, but there are a lot of variants (more than 100 and growing).
I have created a resource(page) for every product and it's variant. Every variant has a price. It is this price that I want to be shown according to the logged in user group membership.
I hope I am able to explain my query clearly.
Please help me do this functionality.
Thanks
I'm not really convinced that modx (as much as i love it) is a great solution for e-commerce sites.
However, the best solution might be to use the database to store the prices of variants per user group and retrieve them yourself using a snippet.

Get User Count for a Google Apps Domain

How do you get the total number of users in a Google Apps Domain? I'm aware of the "Retrieve All Users in Domain" call using the Google Provisioning API, but I'd rather not execute such an intensive call just to count up all the users. Is there a simpler way to do this?
I found a solution that isn't as resource-heavy as retrieving all users: The Google Reporting API can be used to get the total number of accounts in a Google Apps domain.
The Google Apps Admin Settings API allows you to retrieve both the current and maximum number of users in the domain:
https://developers.google.com/google-apps/admin-settings/#retrieving_the_current_number_of_users_in_a_domain
this would be preferable to the reports API as it's both lower in traffic and it's closer to real time (reports are only updated every 24 hours so it won't take into account users recently added).
You could try "Retrieve All Nicknames in Domain" which could save some bandwidth as it hopefully really only retrieves the nicknames, although I think this won't get you the exact count because "Retrieve All Nicknames for a User" seems to imply that a user can have multiple nicknames.
If you've got some test domain, also assure that retrieving all users really is too much overhead and keep in mind that depending on what you want to do, you can perhaps build some kind of cache around it that only does a full request after the cache is older than X.