AlgoKit is back

114 views
Skip to first unread message

Joel Reymont

unread,
May 1, 2012, 10:29:54 AM5/1/12
to AlgoKit
Folks,

I saved enough money to spend a year developing an algorithmic trading
platform. I also have permission from management (aka my wife) to
spend it :-).

I'm building this for myself first and foremost but I will sell the
final product.

I will start with a backend written in Erlang and hooked up to Rithmic
R|API [1] aka ZenFire. It runs on Mac and Linux and my futures broker
supports it. I do not care about Windows.

I will use EasyLanguage [2] for trading systems development.

Stay tuned!

[1] http://www.rithmic.com/rithmic_sol.html
[2] http://en.wikipedia.org/wiki/EasyLanguage

Joel Reymont

unread,
May 1, 2012, 10:42:01 AM5/1/12
to AlgoKit
Q: Why Erlang?

A: Mine will not be a system with the lowest latency initially. I also
know from experience that I will rewrite the code a few times. I will
be putting my own money on the line and I care about not losing it to
errors. I want to recover gracefully, reconnect, sync trades, etc.
Erlang allows me to do all of the above in a single virtual machine
which is simple. Simple is good.

Q: Why Rithmic R|API (ZenFire)?

A: It's just about the only data feed and execution API available on
the Mac and Mac is my development platform. My broker supports R|API
so I can start collecting prices and paper-trading immediately.

That said, I'm also checking if the FIX 4.2 connection to Rithmic is
available to me.

Q: Why only futures?

A: Why not? One needs to start with something.

Max Lapshin

unread,
May 1, 2012, 11:11:51 AM5/1/12
to AlgoKit


On May 1, 6:42 pm, Joel Reymont <joe...@gmail.com> wrote:
> Q: Why Erlang?
>
> A: Mine will not be a system with the lowest latency initially. I also
> know from experience that I will rewrite the code a few times.

I can share with you bad Java experience: when market is volatile,
java may stop for stop-world-GC.
This is a serious reason for using erlang.

> Q: Why Rithmic R|API (ZenFire)?
>
> A: It's just about the only data feed and execution API available on
> the Mac and Mac is my development platform. My broker supports R|API
> so I can start collecting prices and paper-trading immediately.
>

Do you want to write strategic in Erlang or in C++?

I've started adding some metaprogramming to erlang for trader
convenience:

-argument({local_name, "Local name"}).
-parameter({position_limit, "Position limit", 600000}).
-parameter({broker_comission, "Broker comission in bp", 5}).
-output({profit, "Total profit", 0.0}).


> That said, I'm also checking if the FIX 4.2 connection to Rithmic is
> available to me.
>

I'm developing FIX right now and I'm going to opensource it. Later I
think that I will move some part of it to C, because its parsing is
very easily done via autogenerated parser.

Joel Reymont

unread,
May 1, 2012, 11:16:55 AM5/1/12
to alg...@googlegroups.com
On Tue, May 1, 2012 at 4:11 PM, Max Lapshin <max.l...@gmail.com> wrote:
>
> Do you want to write strategic in Erlang or in C++?

EasyLanguage for TradeStation.

> I've started adding some metaprogramming to erlang for trader
> convenience:

I have written a translator from EL to NinjaTrader C# previously [1]
so I'm considering an about face and using OCaml + ZeroMQ + LLVM
instead of Erlang.

[1] http://groups.google.com/group/topdog/browse_thread/thread/d5fd8feac8e68331

> I'm developing FIX right now and I'm going to opensource it. Later I
> think that I will move some part of it to C, because its parsing is
> very easily done via autogenerated parser.

Quotes are not available over FIX with Rithmic/ZenFire so I'll be using R|API.

--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------

Max Lapshin

unread,
May 1, 2012, 11:24:59 AM5/1/12
to alg...@googlegroups.com
On Tue, May 1, 2012 at 7:16 PM, Joel Reymont <joe...@gmail.com> wrote:
>
> EasyLanguage for TradeStation.
>

Is it easier for you to use than plain erlang?


>> I've started adding some metaprogramming to erlang for trader
>> convenience:
>
> I have written a translator from EL to NinjaTrader C# previously [1]
> so I'm considering an about face and using OCaml + ZeroMQ + LLVM
> instead of Erlang.

Do you think it will be convenient? It looks like a space shuttle with
trench digger attached to left wing =)
No, really, I understand that Erlang lacks compile-time numeric types
like "this is dollar", but speak via ZeroMQ?

> Quotes are not available over FIX with Rithmic/ZenFire so I'll be using R|API.
>

It is your broker?

Joel Reymont

unread,
May 1, 2012, 11:43:35 AM5/1/12
to alg...@googlegroups.com
On Tue, May 1, 2012 at 4:24 PM, Max Lapshin <max.l...@gmail.com> wrote:
> On Tue, May 1, 2012 at 7:16 PM, Joel Reymont <joe...@gmail.com> wrote:
>>
>> EasyLanguage for TradeStation.
>>
>
> Is it easier for you to use than plain erlang?

It's way easier and less verbose than Erlang. It's also specialized
towards trading. See the translation example I mentioned earlier for
the tons of verbose C# boilerplate vs. compact EL.

Check out other examples on the net as well, e.g.
http://lionsfutures.com/easylanguage_tutorials/

I'm building a platform for sale and EL is something of a standard.
It's used in various trading magazines, lots of people know it and
love it, etc.

That said, I'll try to improve on EL to build a perfect trading
language, eventually. I'm sure that Erlang is not it, though, nowhere
near.

>> so I'm considering an about face and using OCaml + ZeroMQ + LLVM
>> instead of Erlang.
>
> Do you think it will be convenient? It looks like a space shuttle with
> trench digger attached to left wing =)
> No, really, I understand that Erlang lacks compile-time numeric types
> like "this is dollar", but speak via ZeroMQ?

You have a ticker plant, a process that receives price quotes and
blasts them out to subscribers. You have the order management system
that all trade executions and confirmations go through. Finally, you
have the strategies themselves.

All of the above components need to talk to each other and exchange
messages. ZeroMQ is that "message bus".

>> Quotes are not available over FIX with Rithmic/ZenFire so I'll be using R|API.
>>
> It is your broker?

No, Mirus/Dorman is my broker.

Rithmic/ZenFire is a great trading API.

See http://rithmic.com/home.html.

Max Lapshin

unread,
May 1, 2012, 11:49:27 AM5/1/12
to alg...@googlegroups.com
Ok, thank you.

I'll take a look at easy language.


My current broker use FIX so I have to implement it.

Konstantin Savelyev

unread,
May 1, 2012, 2:30:16 PM5/1/12
to AlgoKit
>>>
I can share with you bad Java experience: when market is volatile,
java may stop for stop-world-GC.
>>>

Modern Java based trading systems can cope with issues with GC by
preallocating large arrays and pooling (LMAX). They can be done in a
way when they don't produce garbage at all.

In .Net world in addition you can use value types (don't know if they
exist in Java). Our margin calculation service written in C#
continuously calculates 200k clients without producing garbage at all.

Idon't say that it is easy to do, but it is perfectly possible.

Don't get me wrong I'm not trying to advocate .Nat and Java to change
your mind and use these platforms instead of Erlang :)
From: Max Lapshin
Sent: 01.05.2012 17:12
To: AlgoKit
Subject: Re: AlgoKit is back


On May 1, 6:42 pm, Joel Reymont <joe...@gmail.com> wrote:
> Q: Why Erlang?
>
> A: Mine will not be a system with the lowest latency initially. I also
> know from experience that I will rewrite the code a few times.

I can share with you bad Java experience: when market is volatile,
java may stop for stop-world-GC.
This is a serious reason for using erlang.

> Q: Why Rithmic R|API (ZenFire)?
>
> A: It's just about the only data feed and execution API available on
> the Mac and Mac is my development platform. My broker supports R|API
> so I can start collecting prices and paper-trading immediately.
>

Do you want to write strategic in Erlang or in C++?

I've started adding some metaprogramming to erlang for trader
convenience:

-argument({local_name, "Local name"}).
-parameter({position_limit, "Position limit", 600000}).
-parameter({broker_comission, "Broker comission in bp", 5}).
-output({profit, "Total profit", 0.0}).


> That said, I'm also checking if the FIX 4.2 connection to Rithmic is
> available to me.
>

I'm developing FIX right now and I'm going to opensource it. Later I
think that I will move some part of it to C, because its parsing is
very easily done via autogenerated parser.

--
You received this message because you are subscribed to the Google
Groups "AlgoKit" group.
To post to this group, send email to alg...@googlegroups.com.
To unsubscribe from this group, send email to
algokit+u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algokit?hl=en.

Max Lapshin

unread,
May 1, 2012, 2:41:08 PM5/1/12
to alg...@googlegroups.com
On Tue, May 1, 2012 at 10:30 PM, Konstantin Savelyev <ksav...@gmail.com> wrote:
>
> Modern Java based trading systems can cope with issues with GC by
> preallocating large arrays and pooling (LMAX). They can be done in a
> way when they don't produce garbage at all.

It is a very interesting experience.

> Don't get me wrong I'm not trying to advocate .Nat and Java to change
> your mind and use these platforms instead of Erlang :)

Of course =) I hope I will never have to deal with Java
Reply all
Reply to author
Forward
0 new messages