Simple Statistical Analysis Script

This project was successfully completed by sljukic for $133 USD in 3 days.

Get free quotes for a project like this
Employer working
Completed by:
Skills Required
Project Budget
$30 - $250 USD
Completed In
3 days
Total Bids
Project Description

We need a simple script written. Either PHP or Perl.

This script will have an input of a CSV file and will output a CSV file and separate report text file.

The input file will have stock market historical data for a stock. For example, it will have the low, high, and closing price of IBM shares for the past 10 years. (See Yahoo’s stock history CSV files as an example.)

This script will input each line of data, which corresponds to one day's trading data, and make simple mathematical decisions based on that data and the previous days' data.

For example, the script may have to look at a 60-day moving average, which is the average price of the stock the past 60 days, and if the closing price of the day is 110% of the 60-day moving average, then the software would calculate the profit we would make if we purchased shares the following day.

Each day after the hypothetical stock purchase happened, we would need to calculate the current profit or loss. If the stock price fell below 90% of the 60-day moving average, we would need to calculate a hypothetical stock sale and document the profit or loss.

Essentially, the output CSV file would contain the original CSV file, with additional information about when a hypothetical purchase could have been made, using certain parameters, the calculated profit at the close of each day if a trade was opened, and then the hypothetical close of a position.

The meat of the script will be the decision-making, based on the trading strategy parameters. Any errors in this part of the script are unacceptable. The script must be 100% accurate in the decision-making.
This part of the script will also need to be designed for easy changing in the future. We will want to use this script to test a variety of different training strategies.

In addition to the output CSV file, we need a separate text report file. We will need to know a handful of extreme numbers. For example, we will need to know the maximum draw-down amount. That's that amount of money we would lose at the lowest point over the historical data.

At this point, all trading decisions in this script will be based on the three pieces of data already provided each day (low price, high price, and closing price), and easy computations based on that data.

This should be a very easy script to write for someone who knows what they're doing. There will be additional work in the future if you write this script well.

Thank you for taking the time to review this project and place a bid.

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online