PHP
  Home arrow PHP arrow Building an E-mini Trading System Using PHP and Advanced MySQL Queries
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Building an E-mini Trading System Using PHP and Advanced MySQL Queries
By: Codex-M
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 3
    2009-11-10


    Table of Contents:
  • Building an E-mini Trading System Using PHP and Advanced MySQL Queries
  • Implementation, steps 1 through 5
  • Implementation, steps 6 through 13
  • Implementation, steps 14 and 15

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Building an E-mini Trading System Using PHP and Advanced MySQL Queries
    ( Page 1 of 4 )

    This article shows illustrative examples of how PHP and some advanced MySQL queries can be used to build an online trading system. For simplicity, we will be featuring one of the most common stock indexes: the S&P 500 index.

    This is also called E-mini S&P 500 futures, one of the most commonly traded equities/futures.

    The Design

    As of September 2009, there was no currently working trading system on the Internet powered by PHP and MySQL despite the platform's popularity among open source communities.

    A trading system is used to enter and exit a trade in a stock or futures market. Although in exiting a trade to grab profits and control losses, money management  is a more useful tool than a trading system.

    To create a fully working trading system, you need the following processes:

    The raw data should be taken from a reputable source for S&P 500 index data. In this article, we will be using Yahoo! Finance data. The export file type is mostly .csv and Excel, so you first need to export the raw data to the MySQL database. (See details below)

    The heart of the process is the trading system. It is a method for analyzing raw data and making judgments. Every trader has his or her own trading system to follow, but in this example, we will use the following rules:

    Rule 1: Define Delta as the difference between “50 days moving average “and “200 moving average.” If the delta is positive, it indicates a bullish trend, otherwise it's bearish. You can read more about moving averages.

    Rule 2: Define % Strength of the trend as Delta/MA 200. This quantifies the strength of the trend. Apply historical data (define limits) for judgment (computation of limits is out of scope for this tutorial). This is more like a trend confirmation.

    Use PHP to display the data in HTML tables while using MySQL advance queries (computing average and getting index data) to do some calculations of the moving average.



     
     
    >>> More PHP Articles          >>> More By Codex-M
     

       

    PHP ARTICLES

    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek