Giter VIP home page Giter VIP logo

market-analysis's Introduction

Market-Analysis

Overview

In Market Analysis we build the basics tools that help us to predict the market by connect to MQL4 in a real time from other programing languge , create a dataset by pulling data from the market , Analysis the data using different Machine Learning techniques , and test it in MQL4 with real time trading.

Components

Dataset

Introduction

Create a Dataset for any symbol in any period of time in Forex market that contain this Features.

How we do it

We do it by pulling data from MQL4 in to our CSV file , the data is pulled using MQL4 build in functions that create our Features.

Setup

  1. Download the code in Dataset (here)
  2. Git in the code and write the number of bars you need.
  3. Run the script (Dataset) in any symbol and any period of time.

Features

"OPEN","CLOSE","HIGH","LOW","VOLUME","MA","STO","FIBO","AC","BUL","ICCI","MACD","RSI","BEAR","AD","ATR","AO","MOM","OSMA","MARKET" open=OPEN(i); close=CLOSE(i); high=HIGH(i); low=LOW(i); volume=VOLUME(i); ma=movingaverge(i); sto=Stochastic(i); fibo=fibonacci(i); ac=AC(i); bul=BUL(i); ic=ICCI(i); macd=MACD(i); rsi=RSI(i); bear=BEAR(i); ad=AD(i); atr=ATR(i); ao=AO(i); mom=MOM(i); osma=OSMA(i); market=Market(i);

ML-Models

Introduction

Different Machine Learning models that we used to learn from the Dataset.

How we do it

  • We build the the models in python using scikit-learn.
  • It learn from our predefined Dataset.
  • And save it after finsh traning in PKL file.

Setup

  1. After creating the Dataset copy the CSV file in to your python project.
  2. Download the code in ML-Models (here) in to your python project.
  3. Run the program and it will generate the PKL file.

Connection

Introduction

Connect the strategy that has been developed in Python with MQL4 in a real time connection the structure has been developed by darwinex-labs you can see their project for installation and more information (here).

How we do it

  • We have modified the code that has been developed by darwinex-labs to suit us.
  • The structure of the code has developed on Server/Client structure were MQL4-connector is the server and Python-connector is the client.
  • We modifie it to receive market data from the server (MQL4) in a live time and predict in the client side (Python) by load the Machine Learning model from ML-models.
  • Then if we got new prediction send order back to server to close the previous order and open a new order based on the new prediction.

MQL4-connector :(DWX_ZeroMQ_Connector_v2_0_1_RC8.mq4) the server.

Python-connector:(DWX_ZeroMQ_Connector_v2_0_1_RC8.py) the client.

Setup

  1. Follow ZMQ installation steps in (here).
  2. Download the code in Connect (here).
  3. Generate the Dataset to use it in ML-Models(here).
  4. Generate the Model (here).
  5. Copy the PKL file in the same Python project of Connect code.
  6. Open MQL4 and any python IDE.
  7. Load MQL4-connector in MQL4.
  8. In Python IDE in console type the following in order:
_zmq = DWX_ZeroMQ_Connector(_SUB_PORT=32771)
_zmq._DWX_MTX_SUBSCRIBE_MARKETDATA_('GOLD')
_zmq._trader_()

Note: Make sure that you enable Auto Trading.

Tester

Introduction

Tool that use to test the strategy that has been developed outside MQL4 in MQL4.

How we do it

  • The structure of Tester component is complicated because the strategy developed outside MQL4.
  • And MQL4 cannot test any strategy developed out side MQL4.
  • What we have done is that we connect from strategy tester in MQL4 with Python-Tester
  • And save the prediction and the time in CSV file in a period of time.
  • Then convert the file in to a common MQL4 file.
  • And test it in MQL4.

MQL4-Tester :(DWX_ZeroMQ_Server_v2.0.1_RC8.mq4) the server.

Python-Tester:(DWX_ZeroMQ_tester.py) the client.

Setup

  1. Follow ZMQ installation steps in (here).
  2. Download the code in Tester (here)
  3. Generate the Dataset (here) to use it in ML-Models.
  4. Generate the Model (here).
  5. Copy the PKL file in the same project of Tester code.
  6. Open MQL4 and any python IDE.
  7. Go to Python IDE in console type the following in order:
_zmq = DWX_ZeroMQ_Connector(_SUB_PORT=32771)
_zmq._DWX_MTX_SUBSCRIBE_MARKETDATA_('GOLD')
  1. Load DWX_ZeroMQ_Server_v2.0.1_RC8.mq4 in MQL4 strategy tester.

  2. Go to Python IDE in console type :

_zmq._tester_()
  1. After generate a CSV file copy the file in to MQL4 files directory.
  2. Load the converter script.
  3. Now test the stratgy by load DWX_ZeroMQ_tester2.mq4 in MQL4 strategy tester.

Note: The order is important.

market-analysis's People

Contributors

amjad-aburaya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

market-analysis's Issues

Tester

Hi,

Im trying to perform the test , and when im "Load DWX_ZeroMQ_Server_v2.0.1_RC8.mq4 in MQL4 strategy tester." there is a problem with loading libzmq.dll . Its at the folder , dont know why it happens. Screenshot attached.

tester
LIB

After that when " Go to Python IDE in console type :
_zmq.tester() "

No csv file generated. Just "Closed" printed at the console.
Screenshot attached.

PY

Would really appreciate if you could help!

p.s. ive changed GOLD symbol for GBPUSD, as i dont have such a symbol, and its not working that way also...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.