Natural language date/time for trading robot DSL

November 27th, 2007

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

In previous example of using Opentick history quotes plugin for providing time interval i used Time variables like this:

Time.now and (Time.now-24.3600)

I thinks, that more convenient way is using natural language date/time like this:

3 years ago, 5 months before now, 7 hours ago, 7 days from now, 1 year ago tomorrow, 3 months ago saturday at 5:00 pm

The main disadvantage of this way is using quotes in DSL code to separate natural language date/time string. It is Ruby language’s restriction.

Tomorrow i’ll try to add natural languae date/time support in our trading robot DSL.

Technical analysis library for trading robot dsl

November 26th, 2007

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

I have found very interesting library for technical analysis. The list of functions is very great. I’ll try to develop Ruby wrapper for this library and then use it’s functions in our trading robot dsl. I think it’s better than implement them from scratch.

Added to project’s TODO list.

Opentick history mode (for OHLC) added

November 26th, 2007

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

Opentick history mode now supported (OHLC mode, not raw ticks)
Plugin loaded by plugin command:


plugin DSL::OpentickHistoryPlugin

configurated by history command:


history :host => 'feed1.opentick.com', :port => 10010,

  :user => 'opentick account login',:password => 'opentick account password',

  :from => Time.now - 24*3600, :to => Time.now, :duration => 300

Parameters description:
host, port, user, password - opentick servers connection parameters
from..to - time period for history quote requesting
duration - bar size in seconds

P.S. Later i’ll improve history command to be more user friendly, it will like this:


history do
  host 'feed1.opentick.com'
  port 10010
  user 'opentick account login'
  password 'opentick account password'
  from yesterday
  to now
  duration 5 min
end

will see :)

Trading robot DSL and opentick-ruby source codes

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

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.