Archive for the ‘robot’ Category

Trading robot DSL and opentick-ruby source codes

Sunday, November 25th, 2007

del.icio.us Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Yahoo Bloglines Bookmark.it Ask Mister Wong Netvouz

I have created SVN repository for Trading robot DSL and opentick-ruby. You can get development version of DSL by svn (it must be installed :)

svn checkout http://tradingrobotdsl.rubyforge.org/svn/
or
svn checkout svn://rubyforge.org/var/svn/tradingrobotdsl

For opentick-ruby project replace tradingrobotdsl with opentick-ruby.

Opentick history quotes disadvantage

Sunday, November 25th, 2007

del.icio.us Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Yahoo Bloglines Bookmark.it Ask Mister Wong Netvouz

If you request quotes for a single symbol, for example MSFT, it works fine - no troubles.


robot do
  ...
  query MSFT do
     # trading robot body
  end # query
end # robot

But if you request quotes for two or more symbols, then opentick servers process you request step by step, i.e. you’ll receive all history quotes for the first requested symbol, then for the next and etc.


robot do
  ...
  query MSFT, GOOG, CSCO do
      # trading robot body
  end # query
end # robot

In the last case you’ll need to wait until all requested historical quotes for all symbols will be received, and only after that, trading robot body will be executed.
How can we solve this problem? The simplest way is to create query command which will request quotes in a little at a time. For example, you request history for a year, but our command requests history day by day and execute trading robot body for received day.

P.S. added to project development TODO list.

TODO for trading robot DSL

Saturday, November 24th, 2007

del.icio.us Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Yahoo Bloglines Bookmark.it Ask Mister Wong Netvouz

  1. Online and history quote mode for opentick servers
  2. Other type of trading orders (stop, stop limit, trailing & etc)
  3. Some useful functions for technical analysis
  4. Improve redundancy for order placement plugin (must remeber it’s state in all securities)
  5. All-in-one installation program and instructions for Linux/OSX/Windows
  6. Documentation for plugin’s API
  7. Documentation for trading robot DSL syntax

will see :)

Trading robot DSL version 0.0.2 released

Saturday, November 24th, 2007

del.icio.us Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Yahoo Bloglines Bookmark.it Ask Mister Wong Netvouz

Changes:

  1. Plugins support for flexibility
  2. IB Trader workstation online and history mode for quotes
  3. IB Trader workstation market and limit order placement
  4. SMA and EMA functions

List of plugins:

  • IBHistoryPlugin - for history quotes IB TWS
  • IBOnlinePlugin - for online quotes IB TWS
  • IBOrderPlugin - for order placement IB TWS
  • TAPlugin - for technical analysis functions

Here some working examples:
1. Online quotes mode:


robot do
  # loading plugins, first must be plugin for query
  plugin DSL::IBOnlinePlugin, DSL::IBOrderPlugin, DSL::TAPlugin
  # online quotes mode configuration with bar duration = 10 seconds
  online :duration => 10
  # contract specifications YM symbol future on ECBOT exchange with 200712 expiry date
  YM.ECBOT FUT, USD, 200712
  # main loop: query online quotes for YM
  query YM do
    if (ema YM, 9)/(ema YM, 25) - 1 > 0.05
      # place buy market order with size = 1 for YM future
      order YM, BUY, MKT, 1
    end
    if (ewa YM, 9)/(ewa YM, 25) - 1 < -0.05
      # place sell market order with size = 1 for YM future
      order YM, SELL, MKT, 1
    end
  end # query
end # robot

Trading robot DSL for automated trading programs released

Monday, November 19th, 2007

del.icio.us Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Yahoo Bloglines Bookmark.it Ask Mister Wong Netvouz

Yes, version 0.0.1 released - only historical mode works. Tomorrow i’ll add online mode (during trading session) and order placement.

This example simple get quotes for GOOG and CSCO tickers and print simple average (period=3):


robot connect do
	login 'test_opentick', '123123'
	history :duration => 300, :from => Time.now-10*24*3600, :to => Time.now
	query GOOG.Q,CSCO.Q do
		p avg GOOG.Q, 3
		p avg CSCO.Q, 3
	end # query
end # robot

see Download page