Find Jobs
Hire Freelancers

automatic stock trading program

$100-500 USD

Cancelled
Posted over 15 years ago

$100-500 USD

Paid on delivery
Write a program to submit a list of orders for stocks each morning after the market opens. You will be modifying an example program provided by the broker, Interactive Brokers. ## Deliverables The program will send commands to Interactive Broker's servers to automatically buy and sell shares of stocks. The stock symbols and quantities will be read in from a text file. The program starts by doing nothing except wait until 1430 GMT (which is when the U.S. Stock exchanges open). At that time, it will start placing orders for the various stocks in the text input file. The process of placing an order is different for stocks on the NASDAQ exchange than it is for stocks on the NYSE or AMEX exchange. For NASDAQ stocks, it will send a request for market data (“SendReqMktData??) using an exchange name of “SMART??. It will then wait until it receives a response for both the bid (“bidPrice??) and ask (“askPrice??) and they are within $0.10 or less of each other. If they are more than $0.10 apart, it will continue to wait until their difference is $0.10 or less. At that time, the program will send an order to buy that stock at the market (“placeOrder??). The program will never place an order for more than 1000 shares at a time. If the input text file indicates the program should buy 3500 shares, the program will do this in four separate orders of 1000, 1000, 1000 and finally 500. Each time it places an order, it waits until (1) the order is filled (“orderStatus??), then (2) after the order is filled, it waits until it receives both another bid (“bidPrice??) and ask (“askPrice??), and finally (3) the bid and ask are $0.10 or less apart. After all three of these things are found in order, it can then submit an order for another 1000 shares, or however many remain. It repeats these steps again and again until it has filled the full number of shares requested at which time it is done for that particular stock. When it's done, it cancels it's request for market data for that particular stock (“cancelMktData??). For NYSE and AMEX stocks, the process is just a little different. Once 1430 GMT has arrived, it first sends a request for market data (“SendReqMktData??) using an exchange name of “NYSE?? for NYSE stocks and “AMEX?? for AMEX stocks. It waits until it receives both a bid (“bidPrice??) and ask (“askPrice??) for the stock. In this case, they can be any amount. There is no $0.10 restriction ??" yet. Once the bid and ask are received, the program will cancel the market data request (“cancelMktData??), wait 3 seconds, then send in another request for market data (“SendReqMktData??). In this second request, it will use the exchange name of “SMART??. The reason for this two step process is the first request is causing the program to wait until the stock opens for trading on its home exchange (NYSE or AMEX). Once trading has begun on the home exchange, it cancels the request on that exchange and resubmits a request for data from any exchange (“SMART??). At this point, the algorithms becomes identical to the one described above for NASDAQ. That is, (1) it waits for both a bid and ask, (2) waits until the bid and ask are within $0.10 of each other, then places an order for 1000 shares or less. It then waits for the fill, waits for another bid and ask under $0.10 before it places another order for 1000 or less. It repeats until it's filled the full amount of the order, then cancels the market data (“cancelMktData??). While the program is running, it should keep information about each company it's working with. It should have at least the following fields, plus any additional information you'll need to keep track of the status of each stock as it progresses through it's buying process. Struct { char Symbol[11]; // stock symbol char Exchange[7]; // NASDAQ, AMEX or NYSE long AvgVol; // average volume over the recent past long close; // yesterdays closing price * 100000 long sharesToBuySell; // number of shares to buy (positive) or sell (negative) long sharesOnOrder; // number on order (+ for buy, - for sell) // when filled, remove from here and add to sharesFilled long totalOnOrder; // dollar amount calculated by shares * price * 100 (cents) // for buys, price = ask. For sells, price = bid. long sharesFilled; // when an order is filled, add total bought or sold here long totalPaid; // dollar amount of actual fill * 100 (so no decimal cents) } The program should also display the current status of all stocks in a Window regarding orders submitted, filled and total dollar amounts. The grand total should display in a summary row. When finished all stocks, the program should create a text file with the final results. Information on how to program the trading interface is available at: <[login to view URL]> Click on the “Proprietary API?? tab. The various sub-tabs below it will give you the sample source code (use the Windows API 9.51 version), the manual describing how to use it and links to various forums, notes and other sources of help. You'll also need the basic trading platform from IB. You can get by clicking under the “Software?? tab on “Trader Workstation??. You'll want to get the “Standalone Download?? for Windows. To actually run the platform and do the programming, you'll need an account. I will give the successful bidder the name/password for a paper trading account. To write the program, you should start with the sample code available from Interactive Broker's web site at <[login to view URL]>************************ Whenever you make changes, please setoff your additions/changes with a comment above and below, like so (using your initials instead of “BXD?? and setting the date as mm/dd/yyyy. // CHANGESTART BXD 09/23/2008 // submit order if bid-ask spread is less than 10 cents diff = ask ??" bid if (diff <= 0.10) SubmitOrderRoutine(); // CHANGEEND BXD 09/23/2008
Project ID: 3236891

About the project

4 proposals
Remote project
Active 16 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
4 freelancers are bidding on average $1,296 USD for this job
User Avatar
See private message.
$850 USD in 14 days
4.9 (17 reviews)
6.0
6.0
User Avatar
See private message.
$2,550 USD in 14 days
4.5 (2 reviews)
4.9
4.9
User Avatar
See private message.
$85 USD in 14 days
0.0 (4 reviews)
0.0
0.0
User Avatar
See private message.
$1,700 USD in 14 days
0.0 (1 review)
0.0
0.0

About the client

Flag of UNITED STATES
United States
5.0
8
Member since Feb 7, 2007

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.