My Skype session for advanced Python advantages on brokerage choice of FXCM Oanda Dukascopy with Linux opinions
All I can say is thanks to Gigi on this as he has proven to be a highly gifted and software developer. Thanks to valuable people who are within my community to make learn to advance
Python is excellent at web scriping for example?
[5:03:00 PM] Gigi: for example I connect to a websocket and download bitcoin full book updates from there
[5:03:07 PM] Gigi: how would I do that in matlab?
Control a browser for webscraping examples:
[5:03:24 PM] Gigi: there are tons of packages for python
[5:03:30 PM] Gigi: for websockets and everything else
[5:03:42 PM] Gigi: or I use python to “control” an Internet Explorer instance
[5:03:49 PM] Gigi: to download some tick data from a website
[5:03:58 PM] Gigi: I literrally say to IE “click this button”
[5:04:57 PM] Gigi: it’s much better to use a single platform
His Python development tool:
[5:06:34 PM] Gigi: but for python i use this – http://www.emeditor.com/
[5:06:49 PM] Gigi: the realy heavy duty tool I use is a classic file manager
[5:06:58 PM] Gigi: http://www.altap.cz/
[5:07:05 PM] Gigi: it’s much faster to navigate than using Windows Explorer
[5:07:11 PM] Gigi: so that’s why I don’t need an IDE
[5:07:31 PM] Gigi: i manuall navigate to the file i need to open using Salamander and press F4 and it opens in the editor
[5:08:52 PM] Gigi: like Numba
[5:09:04 PM] Gigi: and using these you get 95% of C++ speed
[5:09:07 PM] Gigi: it’s even faster than Java 🙂
[5:09:19 PM] Gigi: but of course, not all of python can be accelerated like this
[5:09:43 PM] Gigi: for example I have some C++/CLI code to convert ticks to minute bars
Python vs C++ and Python compilers:
[5:11:15 PM] Gigi: I’m looking at LMAX
[5:11:28 PM] Bryan Downing: They support python now?
[5:11:37 PM] Gigi: they have FIX/JSON/XML
[5:11:43 PM] Gigi: all of that can be used in Python
[5:12:03 PM] Gigi: bu JSON/XML is a joy in Python
[5:12:04 PM] Gigi: unlike C++
[5:12:22 PM] Gigi: JSON is like 1-2 lines of code in Python
[5:12:33 PM] Gigi: so I use it a lot internally
[5:13:06 PM] Gigi: for example I collect 400 MB of JSON tick data from Oanda
[5:13:11 PM] Gigi: and 1 GB of JSON tick data from Dukascopy
(CODE SAMPLES WERE SUPPLIED BUT I AM NOT GOING PUBLISH IT SO SORRY)]
5:14:24 PM] Gigi: but forex is mostly free
5:15:26 PM] Gigi: http://fxtrade.oanda.com/orderbook/orderhistory/images/OrdersEURUSDmonth.png?i=970.7003212647958
[5:15:43 PM] Gigi: for example I collect these images from oanda which represent the live positions of their clients
[5:15:50 PM] Gigi: you can watch for stop hunting
[5:15:54 PM] Gigi: I have 5 years of these images
[5:16:09 PM] Gigi: and I do OCR on the images to extract the text and image data
[5:17:48 PM] Gigi: I have also downloaded a whole forex forum
[5:17:59 PM] Gigi: in the idea to do some machine learning on the text
[5:18:11 PM] Gigi: but I didn’t had time to do that yet
[5:20:00 PM] Bryan Downing: Ok can u set up a demo account with oanda with no funding an account?
[5:20:11 PM] Gigi: yes
[5:20:35 PM] Gigi: http://developer.oanda.com/
[5:21:13 PM] Bryan Downing: How about dukascopy? Same with no funding an account?
[5:21:23 PM] Gigi: unfortunatly no
[5:21:32 PM] Gigi: I mean
[5:21:37 PM] Gigi: you can get tick data from their demo account
[5:21:45 PM] Gigi: but it will also contain demo trades
[5:21:51 PM] Gigi: so I have a live account with them
[5:22:01 PM] Bryan Downing: But do u need to fund for a demo account?
[5:22:06 PM] Gigi: no
[5:22:15 PM] Gigi: but they do expire after 2 weeks
[5:22:20 PM] Bryan Downing: 0h
[5:22:37 PM] Bryan Downing: Does oanda expire?
[5:22:39 PM] Gigi: no
[5:22:47 PM] Bryan Downing: Good to know
[5:22:50 PM] Gigi: oanda has a nice API
[5:22:57 PM] Gigi: easily usable from any language
[5:23:04 PM] Gigi: and streams something like 170 pairs
[5:23:18 PM] Gigi: average of 50,000 ticks per day per instrument
[5:23:25 PM] Bryan Downing: Do they charge extra for the API when u go live?
[5:24:10 PM] Gigi: no
[5:24:16 PM] Gigi: the rest api is free
[5:24:22 PM] Bryan Downing: Good
[5:24:27 PM] Gigi: the FIX/Java ones require 2500 in your account I think
[5:24:54 PM] Bryan Downing: Ok what is the minimum to fund dukascopy?
[5:25:27 PM] Gigi: $100
[5:33:10 PM] Gigi: the main broker I use, FXCM, has a .NET API
[5:33:14 PM] Gigi: and I use it from IronPython
[5:26:00 PM] Gigi: I opened an account just so that I can get the tick data
[5:26:03 PM] Gigi: however
[5:26:10 PM] Gigi: their API SDK is in Java
[5:27:23 PM] Bryan Downing: What are minimum requirement for lmax?
[5:27:34 PM] Gigi: for API access around $10K
[5:27:40 PM] Gigi: but they also have minimum volume
[5:27:49 PM] Gigi: and for FIX it’s much larger
[5:28:11 PM] Bryan Downing: U trust dukascopy more than oanda ?
[5:28:15 PM] Gigi: you have to trade 2 mil notional per month for JSON/XML at lmax
[5:28:25 PM] Gigi: I trust them both the same
Integration with Python with C++ or .NET C#
[5:29:13 PM] Bryan Downing: When u have your c++ with python do I integrate thu Cython ?
[5:29:31 PM] Gigi: I actually wrote the C++ code in the .NET variant – C++/CLI
[5:29:41 PM] Gigi: and then used IronPython (the .NET python version) to easily call that
[5:30:00 PM] Gigi: in the past I also wrote CPython (the normal Python version) extensions
[5:30:16 PM] Gigi: and I also used a python module, ctypes to directly call DLL that I wrote in C++
[5:30:23 PM] Gigi: so I kind of tried all methods
[5:30:29 PM] Gigi: including Boost.Python
[5:30:47 PM] Bryan Downing: But iron Python works best for .net?
[5:31:01 PM] Gigi: IronPython runs ON .NET
[5:31:08 PM] Gigi: it’s actual .NET IL code under the hoo
[5:31:10 PM] Gigi: hodd
[5:31:19 PM] Gigi: practically it’s an Python interpreter written in C#
[5:31:57 PM] Bryan Downing: Do u find it is the best wAy to integrate .net and python with all the
[5:32:34 PM] Gigi: the downside is that most standard Python modules which have parts written in C don’t work in IronPython
Python interpreter inside C++?
[5:34:44 PM] Gigi: basically you embed a Python interpreter in C++
[5:35:06 PM] Bryan Downing: I have seen a video for that which is kind of ugly
[5:35:10 PM] Gigi: yes
[5:35:21 PM] Gigi: some applications which require a scripting language do that
[5:35:28 PM] Gigi: so that you can script them in Python
[5:35:38 PM] Gigi: but usually it’s much much easier to do it the other way around
[5:35:50 PM] Gigi: and call from Python C++ instead
[5:36:03 PM] Gigi: this is also beneficial since Python it’s a much better glue language
Cython and other options:
[5:36:27 PM] Bryan Downing: For newbies what is the best option for python to call c++?
[5:36:38 PM] Gigi: first of all
[5:36:41 PM] Gigi: you can actually call only C
[5:36:56 PM] Gigi: for C++ (meaning classes, templates) you pretty much need to use Boost.Python
[5:37:12 PM] Bryan Downing: So what is best for performance ?
well, putting performance and Python in the same sentance doesn’t make much sense anyway
[5:37:47 PM] Gigi: but I don’t think there are big differences
[5:37:54 PM] Gigi: ctypes/cffi/Cython
[5:37:58 PM] Gigi: are pretty much the same speed
[5:38:05 PM] Gigi: but I didn’t actually benchmarked this
[5:38:10 PM] Bryan Downing: Which js the easiest?
[5:38:20 PM] Gigi: I would guess cffi
[5:38:32 PM] Gigi: it really depends on what you want to do
[5:38:35 PM] Bryan Downing: More flexible to
[5:38:57 PM] Gigi: I can’t say
[5:39:05 PM] Gigi: I usually just called a few functions
[5:39:08 PM] Gigi: and passed some structures
[5:39:21 PM] Gigi: for more complicated stuff, classes, I used C++/CLI and IronPython like I said
[5:39:35 PM] Gigi: but I wouldn’t necesarily go that route again
Numba JIT (Just In Compiler)
[5:39:46 PM] Gigi: today I would look at stuff like Numba
[5:40:04 PM] Gigi: and write the high performance code in Python , and let the Numba JIT compiler compile that to machine code
[5:40:16 PM] Gigi: but if you have existing C++ code, you can’t do that
[5:40:29 PM] Bryan Downing: That makes total sense
[5:40:55 PM] Gigi: do you have some specific C++ code in mind that you want to call?
Charting options in Python:
[5:41:46 PM] Gigi: I have written my own charting in WPF/IronPython
[5:41:50 PM] Gigi: that you saw in the picture
[5:42:03 PM] Gigi: it is really fast, you can scroll at 30 FPS through million of data points
[5:42:09 PM] Gigi: but it’s not very flexible
[5:42:18 PM] Gigi: standard Python charting (matplotlib) is very very slow
[5:42:22 PM] Bryan Downing: Can u call r from python ?
[5:42:27 PM] Gigi: just like mathematica and matlab, and r is slow
[5:42:44 PM] Gigi: all of them – matplotlib, mathematica, matlab, r
[5:42:55 PM] Gigi: choke when you try to display a 5 million tick chart
[5:43:02 PM] Gigi: or scroll thorugh it
[5:43:13 PM] Gigi: so i think that I will write something custom again
[5:43:25 PM] Bryan Downing: Is your charting with a wpf library ?
[5:43:33 PM] Gigi: no, I directly drew the lines
[5:43:44 PM] Gigi: libraries also pretty much can’t handle millions of points
[5:43:48 PM] Bryan Downing: That is work
[5:43:58 PM] Gigi: yes
5:44:34 PM] Gigi: just send the points to the browser
[5:44:35 PM] Bryan Downing: Have u looked at qt?
[5:44:37 PM] Gigi: and use WebGL
[5:44:41 PM] Gigi: yes, I used it a bit
[5:44:46 PM] Gigi: but it’s much worse than WPF
[5:44:53 PM] Gigi: WPF is pretty much the perfect GUI library
[5:44:57 PM] Gigi: XAML is so awesome
[5:45:07 PM] Gigi: unfortunately WPF is also pretty much dead
[5:45:16 PM] Bryan Downing: Really
[5:45:24 PM] Gigi: now I’m writing my trading monitoring applications in HTML5 for the browser
[5:45:41 PM] Gigi: since I also want to be able to access a trading dashboard from my phone for example
[5:45:51 PM] Bryan Downing: Makes sense
[5:46:15 PM] Gigi: PyQT is also nice, nicer than MFC, but not close to WPF
[5:47:16 PM] Gigi: there are a few charting libraries for Python started now
[5:47:20 PM] Gigi: which use the GPU
Views on Linux and Mac development:
5:54:30 PM] Gigi: how come I stay on shitty windows and not move to mac/vim
[5:54:38 PM] Gigi: I was the only one in my team with a lenovo
[5:54:48 PM] Gigi: I tried them
[5:54:55 PM] Gigi: linux is just unusable on the desktop
[5:55:07 PM] Bryan Downing: But why stay on windows
[5:55:11 PM] Bryan Downing: Mac is good
[5:55:12 PM] Gigi: too much fiddleing and praying that the next update doesn’t make your machine unusable
[5:55:17 PM] Bryan Downing: Right
[5:55:18 PM] Gigi: mac doesn’t have good file managers
[5:55:21 PM] Gigi: like Salamander
[5:55:25 PM] Bryan Downing: I see
[5:55:27 PM] Gigi: and like I said, that is my main tool
Join my FREE newsletter to learn more about users like this
I now post my TRADING ALERTS
into my personal FACEBOOK ACCOUNT
. Don't worry as I don't post stupid cat videos or what I eat!