Build Algorithmic Trading Strategies with Python & ZeroMQ: Part 2

preview_player
Показать описание

* Connect with the presenter on LinkedIn:

** Follow Darwinex on LinkedIn:

*** Get the latest updates to the DWX-ZeroMQ-Connector project, troubleshoot your applications, give and get help from fellow algorithmic traders and more, over at the Darwinex Collective Slack Workspace:

Risk Disclosure:

If you haven't watched the first the following related tutorials, you'll need to, so here they are again:

1. How to Interface Python Trading Strategies with MetaTrader via ZeroMQ

2. Algorithmic Trading via ZeroMQ: Python to MetaTrader - Trade Execution, Reporting & Management

-----------------------
IMPORTANT REQUEST: Please please please.. if you find this content useful, please do consider liking and sharing it on YouTube, Twitter, Facebook, LinkedIn and whatever other social networks you have circles in.

Darwinex relies almost exclusively on organic growth, primarily through recommendation via informative content.

YouTube’s algorithms measure the quality of Darwinex content on the basis of:
- Reach
- Engagement
- and several other related variables

With seemingly small actions such as:
- Clicking the Like button
- Clicking the Subscribe button
- Clicking the Share button (on YouTube) and distributing our content
- etc

… YOU inform YouTube’s algorithms of your sentiment towards Darwinex, thereby directly helping Darwinex MASSIVELY in achieving organic growth.

Thank you very much for your kind consideration!
-----------------------

Missed part 1? Here it is again:

In this strategy, NINE "simulated algorithmic traders" will go head to head:

1. Using 1 ZeroMQ connector to send orders to market via MetaTrader.

2. Decide on whether to BUY or SELL using a coin flip!

3. Trading 1 symbol each, with a fixed lot size of 0.01 lots.

4. Trade a maximum of 1 trade at any given time.

5. Close any trade after it has been in execution greater than 5 seconds.

Contents of this tutorial:
--

1) Writing convenience code to perform trading and reporting functions.

2) Understanding how the DWX_ZeroMQ_Connector performs data exchange between Python and MetaTrader

3) Writing a re-usable "Base" Trading Strategy in Python to build upon.

4) Extending the base class above to create a "coin flip" live trading robot!

Download the source code from GitHub here:

1) DWZ_ZeroMQ_Connector

2) DWX_Execution Wrapper Class

3) DWX_Reporting Wrapper Class

4) DWX_Strategy Base Class

5) Final "Coin Flip Trading" Strategy Class

--
Are you a good trader?

We'd love to have your strategy listed on our Exchange, enabling you to earn performance fees on investor profits!

More details here:

1.9M in performance fees paid to date:

Topics:
#algorithmictrading #python #metatrader
Рекомендации по теме
Комментарии
Автор

Hi everyone! Just a quick note:

We recently released a successor to the dwx-zeromq-connector project, called 'dwxconnect', adding MetaTrader 5 (MT5) Support as well as enhancing the project itself quite considerably!

Here's the link to DWX Connect on GitHub:

It is recommended that you watch the following presentation for a demonstration of all its capabilities:

All the best,
The Darwinex Team

Darwinexchange
Автор

Really learnt a lot about sockets: I love the introduction [for me] to communication patterns and using multiple ports for different communication patterns. I used to just push everything through the same socket, and separate everything in tasks, rather than communication patterns. Now in my future websocket implementations, I will add this strategy of separating the channels on which the different tasks' data travels...


Thanks again

djsamke
Автор

Hi great series.. at 10:00 are you using the comment '(EURUSD for example)_Trader' and then getting the ticket with that comment?

Oisinkelly
Автор

amazing tutorial. could you guys do a tutorial on how we would backtest this strategy

tommyypoon
Автор

Once i test the coin flip strategy i get this output in the Ipython:


{'_response':


And MetaTrader 4 in the experts tab shows something like this:


2020.03.30 EURUSD, M5:


Whats the problem?

marcovalentinoalvarado
Автор

Great man your video help me a lot <3

rafaelcavalcante
Автор

realy great!
My big worry is about indicators.
I hope we are not to recode mt4 indicators in python.
how can we use metatrader indicator readings the easiest way ?

aboelfawares
Автор

Hello, thaks for another great video. I have a question, im not sure you can help me...

Following your videos i was able to send some test orders that got open just fine using either _DWX_MTX_NEW_TRADE_ and _execute_ which makes me think that the bridge between python and mt4 is working fine.

But when i run coin_flip_traders.py from pycharm i got no errors (Process finished with exit code 0), but nothing happens on MT4. I dont have much experience as most people here, have any ideas what the problem would be?

leocruz_rj
Автор

Thanks for the great tutorials! I really appreciate it and think they are great! When I ran into this strategy, it just kept opening trades 1 after another, even if there were already trades open on that pair. I printed out the _ot_shape[0] after line 219 in the coin_flip_traders, and it stays at 0. I've looked through the code, and I know it has to do with the reporting, I just am learning more about dataframes and such, but any suggestions on why I might not be getting the proper number of currently open trades on?

adamfetters
Автор

What category does the DWZ_ZeroMQ_Server come under between: EA (template), EA (generate), Script, Library or New Class?

joshuam
Автор

hello, how about it set stop loss for prev high/low automatically, do you cover that?

hangtuahTRADING
Автор

At the outset, I would like to thank Darwinex for bringing up this amazing content.


I have downloaded the codes provided and after modification of path etc, while I run coin_flip_traders_v1.0.py, it shows me the following error. Says that _get_response is not an attribute of 'DWX_ZeroMQ_Connector'.
Can you please help me out?




File Downloads\Coin Flip Exercise\coin_flip_traders_v1.0.py", line 139, in _updater_
print('\r{}'.format(str(self._zmq._get_response())), end='', flush=True)
AttributeError: 'DWX_ZeroMQ_Connector' object has no attribute '_get_response'

palashjyotiborah
Автор

Is there a function to get an update for stop loss/take profit execution from MT4?

vinaykumar
Автор

Do you have some example on implement method?

antoniohita
Автор

while I am waiting for advanced strategy that use indicators and neural network models. Can't we simply connect metatrader easily to python via text files. the sender writes and the receiver reads.What about that easier idea ? does it have problems?

aboelfawares
Автор

I have some general questions about metatrader privacy. can by any mean mt4 broker see my expert or my indicator code or download expert or indicator files? can metaquotes see them or download them ? can metaquote decompile ex4 files? is it legal for broker or metaquotes to do so?

aboelfawares
Автор

In terms of presentation it would be better to show how you get the information and not just "what to type". I.e. open a REPL and call the objects and look at them.

syphiliticpangloss
visit shbcf.ru