python support

3 messages Options
Embed this post
Permalink
murty

python support

Reply Threaded More More options
Print post
Permalink
Hi

Is there support for Python in addition to Ruby? If not, can someone
give me advice or tips on how to get started on how to add support for
Python? I would like to work on the source and see if I can add
support for Python.

--
Thanks
Murty Rompalli
_______________________________________________
m-etc-users mailing list
[hidden email]
http://lists.marketcetera.org/cgi-bin/mailman/listinfo/m-etc-users
gm-mrktc

Re: python support

Reply Threaded More More options
Print post
Permalink
Hey Murty,
Unfortunately we currently don't have any support for Python built in
to the Marketcetera platform.  Here are two places that it could
potentially be integrated.

 * As a stand-alone trading app (orders and executions would still be
reflected in photon, but your app would be only loosely coupled to the
Marketcetera Platform through ActiveMQ).  This would require the use
of the Python API for QuickFIX (http://www.quickfixengine.org/), and
the Python client for ActiveMQ (http://stomp.codehaus.org/Python).
* In Photon, as a replacement for Ruby.  This would require the use of
Jython, (currently we use JRuby as the Ruby implementation).  Swapping
out the scripting engine itself would be fairly straightforward, but
because we use RDT for the Ruby editing environment, we would have to
find a suitable replacement for Python/Jython, and integrate it.

Both of these options are likely to be a fair amount of work.  If
either of them sounds like what you need, I could go into more detail.

graham

On 8/8/07, murty <[hidden email]> wrote:

> Hi
>
> Is there support for Python in addition to Ruby? If not, can someone
> give me advice or tips on how to get started on how to add support for
> Python? I would like to work on the source and see if I can add
> support for Python.
>
> --
> Thanks
> Murty Rompalli
> _______________________________________________
> m-etc-users mailing list
> [hidden email]
> http://lists.marketcetera.org/cgi-bin/mailman/listinfo/m-etc-users
>


--
Marketcetera Trading Platform
download.run.trade.
www.marketcetera.org
_______________________________________________
m-etc-users mailing list
[hidden email]
http://lists.marketcetera.org/cgi-bin/mailman/listinfo/m-etc-users
gm-mrktc

Re: python support

Reply Threaded More More options
Print post
Permalink
In reply to this post by murty
OK, in that case, here is how I suggest you get started:

* Familiarize yourself with the build process here:
http://trac.marketcetera.org/trac.fcgi/wiki/Marketcetera/BuildingPhoton
Get Photon building in its current form.
* Notice that we have a plugin called org.jruby.bsf.  This contains
the libraries for both JRuby (http://jruby.codehaus.org/) and
BSF(http://jakarta.apache.org/bsf/).  Putting them both in the same
plugin is probably stylistically not ideal, but eliminates some sticky
classloading issues.  You will need to create a similar plugin for
Jython/BSF.
* There are a couple of places where the code makes reference to Ruby:
one call to         BSFManager.registerScriptingEngine() in
PhotonPlugin.start(); ScriptRegistry.initBSFManager calls
loadScriptingEngine("ruby") and evals a couple of expressions into the
Ruby runtime; ScriptLoggingUtil is a set of utility methods for
getting useful error messages out of BSF/JRuby exceptions.  Each of
these will need to be ported.

At this point you will be in pretty good shape.  You then should be
able to create a JPython script in a text editor, and drop it into the
ActiveScripts directory in the Photon workspace and run it.  It will
need to subclass from the "Strategy" Java class in the same way a Ruby
script does ( http://trac.marketcetera.org/trac.fcgi/wiki/Marketcetera/PhotonScripting
).

Next you will need to tackle the inclusion of PyDev (or similar).
Here's what I suggest.
* Get binary versions of the PyDev plugins and put them into your
target platform directory (don't forget to go to Preferences->Plug-in
Development->Target Platform and hit "Reload" or else your IDE won't
recognize the new plugins).
* Open up the plugin.xml file in the "org.marketcetera.photon" plugin,
and replace the dependency on "org.rubypeople.rdt.core" with the name
of the PyDev plugin (or plugins).
* There is only one direct dependence on the RDT stuff in the code: in
PhotonPlugin.ensureDefaultProject(), we have to add the "Ruby Nature"
to the default project when we create it.  Likely we will need to do
something similar for JPython/PyDev.

Dealing with these Eclipse plugins may be the trickiest part of this
whole process, so feel free to ask any questions about that or
anything else.  I hope this is enough to get you started.

graham




On 8/8/07, murty <[hidden email]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Graham
>
> Thanks for the response. I would choose the second option because I
> prefer to have complete support for Python. I understand the benefits
> and ease of Ruby, especially RoR and other good stuff but
> unfortunately, it is my opinion that Ruby is not rich in libraries or
> for that matter in institutional acceptance (outside Japan). There is
> Pydev for Eclipse which I believe is the equivalent of RDT. If not,
> take a look at Python from Enthought (http://code.enthought.com/)
> which I will, in the weekend.
>
> I appreciate any more details you might have to help me contribute.
> Thanks
>
> Murty Rompalli
>
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGumxU8nY4Ppot1YYRAiZxAJ0dxsKWaEV/qqlX9paGJyziZbFN3ACfXN4s
> gM2ufNyqeLeKZpZrR2Ntjt0=
> =Vgit
> -----END PGP SIGNATURE-----
>
>


--
Marketcetera Trading Platform
download.run.trade.
www.marketcetera.org
_______________________________________________
m-etc-users mailing list
[hidden email]
http://lists.marketcetera.org/cgi-bin/mailman/listinfo/m-etc-users