Giter Site home page Giter Site logo

ea31337 / ea31337-classes Goto Github PK

View Code? Open in Web Editor NEW
175.0 18.0 97.0 9.23 MB

๐Ÿ“ฆ๐Ÿ“ˆ EA31337 framework (MQL library for writing trading Expert Advisors, indicators and scripts)

Home Page: https://ea31337.github.io/EA31337-classes

License: GNU General Public License v3.0

MQL5 61.27% MQL4 4.70% C 14.18% C++ 19.78% HLSL 0.07%
mql4 mql5 forex mql library framework trading ea31337 market api

ea31337-classes's Introduction

EA31337

Release Status Status Status Discuss Channel Twitter License Edit

Introduction

EA31337 is an advanced trading robot for Forex markets written in MQL.

About the project

The project aims to deliver fully working EA at the advanced level.

It implements algorithm for managing multiple strategies on different timeframes at once.

This project utilizes the following sub-projects:

The source code is compatible with MQL4 and MQL5 and can run on MetaTrader 4 and 5.

Download

To download this project with all dependencies, use the following Git command:

git clone --branch master --recursive https://github.com/EA31337/EA31337.git

Usage

You can freely use this project for education or research purposes. If you're planning to use it for trading, please take care, as neither it is the holy grail or making money machine. So if you're looking to double your investment in a short period with few clicks, this is not what you're looking for, and most likely you won't find holy grail anywhere else.

To use this project most efficiently, you'll have to invest some time to understand how it works and how you can use it.

To learn more about the usage, please check the Wiki pages.

Features

The EA provides the following out-of-box features:

  • Dozens of trading strategies to choose from.
  • Support for multi-timeframe trading.
  • Risk and price stop management.
  • Plenty of user input parameters to adjust the settings.
  • Filtering system.

Strategies

Each strategy can analyse market on different timeframes independently. The market analysis is based on popular technical indicators.

Feel free to write your own custom strategies.

Risk management

Price stop

As part of the risk management, the EA's price stop algorithm decides when to close a trade with profit or to avoid further lose based on a specific market conditions such as technical indicator analysis.

Filtering system

The unique filtering system controls when to open or close the trades based on set of conditions.

The filters can be based on account, chart, market, indicator, active orders and several other conditions.

You are free to customize these filters using Advanced parameters.

Before you start

Using & Testing

Please be strongly aware that combination of symbol pair, broker, their market gaps and market spreads can give completely results when trading variety of robots.

The EA tries its best to detect the perfect conditions for its trading, however you need to backtest the robot first (or test it on demo account for several weeks), before going into deep waters.

EA is continuing to improve each release, which takes a lot of effort across many months and years, but it is never going to be perfect.

Important tips

When using this EA for the trading purposes, please read the following tips:

  • Take your time to get familiar with the project and how it works.
  • Make sure you have tested EA on the demo account first (at least for few weeks).
  • It is advised to backtest your configuration before running on live account (see Testing section).
  • Choose your broker wisely to make sure EA will work as expected. For example:
    • Be aware of your broker spreads and commissions, otherwise high spreads can easily kill your account, no matter how good EA is.
    • Start with with the smaller deposit first (use account supporting micro lots, otherwise change your broker) to test the broker, market and EA configuration as the whole.
    • Do not use EA in accounts with spreads above 20 points (2 pips) without proper backtesting or good results in the demo account, unless risking affordable minimum (micro lots).
    • Be aware that some brokers dynamically sets very high spreads (over 100) when the market is volatile, so best opportunity for EA could turn into the worse. In this case, you should blame broker, not EA.
    • Do not use brokers which doesn't allow hedging positions. The EA has not been tested for it.
    • Watch out for brokers who "steal" pips by closing orders at a price which is less favourable to you by 1-2 pips which can reduce the profits made by EA.
  • It's recommended to use VPS in order to run EA reliabily (24/7) as often restarts of EA or a trading terminal while trades are opened can drastically affect the expected results.
  • Ensure to provide a stable internet connection to achieve reliable operation of EA as slow network or short disruptions may significantly impact the performance.
  • While running on live, keep monitoring your account (e.g. for any warnings/errors in the logs).
  • Do not increase any lot size or risk criteria if your tradings are going well. The EA will automatically adjust it when needed based on your available balance.
  • Be aware that potential profits can be matter of weeks, not days, so please be patient. The configuration could be right, but it's about finding a good opportunity.
  • Use major symbol pairs (such as EURUSD, GBPUSD, etc), the one which has been tested.

For more important tips, refer to Before you start wiki page.

Installation

For installation steps, refer to Installation wiki page.

Compilation

For compilation steps, refer to Compilation wiki page.

Configuration

The default settings has been optimized for EURUSD symbol pair.

There are many of adjustable inputs that you can set. These are documented in a separate provided file.

If you planning to run EA on variety of symbol pairs, it is strongly advised that you should test it on the demo first, alternatively backtest and optimize the settings first. Only run EA on live at your own risk, when you're happy with the backtest or results on the demo account.

Timeframe

For the trading purposes, any timeframe can be used since EA reads data from multiple timeframes independently from the current chart.

Testing

Backtesting

Please be aware that backtesting cannot reliabily simulate the future outcome.

Recommended platform for backtesting and optimization is MetaTrader 5 (not 4).

The backtesting for MT4 has been documented at Backtesting using MT4 wiki page.

SET Files

By default, EA provides the best known optimized settings for EURUSD symbol pair based on the performed optimization tests before each release.

Each release has slightly different, so don't mix old SET files for new EA.

Documentation

Documentation can be found at the wiki page. If you believe some information is outdated, you can propose new changes.

Support

Legal

License

The project is released under GNU GPLv3 licence, so that means the software is copyrighted, however you have the freedom to use, change or share the software for any purpose as long as the modified version stays free. See: GNU FAQ.

You should have received a copy of the GNU General Public License along with this program (check the LICENSE file). If not, please read http://www.gnu.org/licenses/. For simplified version, please read https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3).

Terms of Use

By using EA31337, you understand and agree that we (company and author) are not be liable or responsible for any loss or damage due to any reason. Although every attempt has been made to assure accuracy, we do not give any express or implied warranty as to its accuracy. We do not accept any liability for error or omission.

You acknowledge that you are familiar with these risks and that you are solely responsible for the outcomes of your decisions. We accept no liability whatsoever for any direct or consequential loss arising from the use of this product. You understand and agree that past results are not necessarily indicative of future performance.

Use of EA31337 trading robot serves as your acknowledgement and representation that you have read and understand these TERMS OF USE and that you agree to be bound by such Terms of Use ("License Agreement").

Copyright information

Copyright ยฉ 2016-2021 - EA31337 Ltd - All Rights Reserved

Author & Publisher: kenorb at EA31337 Ltd.

Disclaimer and Risk Warnings

Trading any financial market involves risk. All forms of trading carry a high level of risk so you should only speculate with money you can afford to lose. You can lose more than your initial deposit and stake. Please ensure your chosen method matches your investment objectives, familiarize yourself with the risks involved and if necessary seek independent advice.

NFA and CTFC Required Disclaimers: Trading in the Foreign Exchange market as well as in Futures Market and Options or in the Stock Market is a challenging opportunity where above average returns are available for educated and experienced investors who are willing to take above average risk. However, before deciding to participate in Foreign Exchange (FX) trading or in Trading Futures, Options or stocks, you should carefully consider your investment objectives, level of experience and risk appetite. Do not invest money you cannot afford to lose.

CFTC RULE 4.41 - HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY. SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAN ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.

ea31337-classes's People

Contributors

janckerchen avatar kenorb avatar lemonboy avatar lu43n avatar lucasbodek avatar nickodell avatar nseam 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ea31337-classes's Issues

Implement associative array

Task

Implement an associative array with values accessible by the string keys.

Features:

  • The array should support associative values (where the key is a string) - Array or new Dict class.
  • The array could support array of values without keys (Array class).

Find below a few examples:

Example 1
arr = new Array();
arr.Push(value);
arr.Push(123);
int a = arr.Pop();
string b = arr.Pop();
Example 2
arr = new Array();
arr.Push(new Dict("key", "value"));
arr.Set(new Dict("key", "newvalue")); // Overrides the existing value.
arr.Set(new Dict("key2", 0.123)); // Create if doesn't exist.
Print(arr.ToString());
Example 3
arr = new Array();
arr.LoadFromSET("file.set");
double val1 = arr.GetByKey("Foo1");
double val2 = arr.GetByKey("Foo2");
int val2 = arr.GetByKey("Foo3");

Where file.set is like:

Foo1=0.2
Foo2=0.4
Foo3=1

Tech notes

  • Class: Dict or Array

Refs

Create a class to load, modify and save data values

Create a Data class with methods to add new data values of any format, to change the values on instance level and to save into the file, then restore the data from the file.

Example usage:

  1. data = new Data(); // No argument, so start from scratch.
  2. data.SetValue('max_spread', 10); // Format: data.SetValue(string key, dynamic value);
  3. data.SetValue('ratio', 0.5);
  4. data.SetValue('msg', "Foo");
  5. data.SetValue('msg', "Bar");
  6. ratio = data.GetValueDouble('ratio'); // 0.5 // Wrapper for each format value.
  7. msg = data.GetValueString('msg'); // Bar
  8. is_success = data.Save('data.bin'); // Save all mixed data into file (replacing any existing file).
  9. data = new Data('data.bin'); // Load all data into class array and return the instance.
  10. max_spread = data.GetValueInteger('max_spread'); // 10

See: FileReadArray/FileReadArray, FileWriteArray/FileWriteArray

Est. 6-8h

Finish up the Indicator class file to store the indicator values

Finish Indicator class which aims to store the values of the indicators.

Here are the job goals:

  • store the values depending on the type (doubles, integers or bools, you can use MqlParam struct, overloaded methods or function templates),

  • for each value, store the bar datetime and key of the value (e.g. MODE_MAIN, MODE_SIGNAL),

  • when new key is specified along with the value, add this key as new automatically,

  • each value is added on the top of the array (Array as Series), so accessing 0th element should always return the latest,

  • when value has been added for the same bar time again for given timeframe, ignore it (unless force option is specified, so it'll update the existing one),

  • here is the proposed sample usage of that class given dummy values of MA and MACD indicators, so after finish demonstrate that the class is working on the existing simple code,

  • print the values when calling ToString(),

  • adjust and provide code demonstrating sample usage of that class for the testing purposes (as per link above, you can use the existing one).

Coding rules:

  • provide warning/error free code,

  • use the existing class, don't create a new one,

  • don't use external libraries or classes other than existing,

  • avoid adding not related things,

  • use indentation of 2 spaces, no trailing spaces,

  • clean up any unused objects to avoid any memory leak reports,

  • existing code is compatible with MQL5 and MQL4, so it should stay this way.

Class file: Indicator.mqh

Related: GH-23, GH-50

--

Est. 6-10h

SummaryReport: More values

  • max down time (TAE)
  • largest margin
  • avg trade profit XX$ XXp (+XX$/-XX$)
  • max loss streak
  • annual return
  • profit factor (PRR: X.YY)
  • Sharpe ratio
  • Kelly criterion X.YY
  • OptimalF
  • Ulcer index XX%

Source: Zorro

New Queue class

The goal of this task is to create a new Queue class (aka SmartQueue).

Requirements:

  • TBC

Fix MQL implementation of MD5

File: MD5.mqh

The problem is that it returns the wrong sum with minus in the front.

The code is based on this old code.

Example code:

#include <MD5.mqh>
void start() {
  Alert("Sum of 123 is: ", MD5:MD5Sum("123"));
}

Or use the following test file: md5_test.mq4.

Should work in MQL5. The MQL editor/compiler can be found in here.

Also fix two outstanding compiler warnings (conversion messages).

Class to create SVG image file

Write a class to generate SVG vector image to recreate market chart.

See: Line charts

  1. Create SVG.mqh class with constructor which creates the file and deconstructor which closes the file. See: Files functions.
  2. Create OnInit() function which will initialize svg.
  3. Create OnTick() function which will append points to existing polyline or path based on the Ask price.
  4. OnDeinit close the file.

Test the code by backtesting for 1-2 days which should generate the image.

The code should work for MQL4 and MQL5.

Similar class: Registry.mqh

SVG example from shell using gen_bt_data.py+gnuplot:

./gen_bt_data.py -s 10 -p none 2014.01.01 2014.01.30 1.0 4.0 | gnuplot -p -e "set datafile separator ','; plot '-' using 3 w"

Example SVG format: chart.svg.zip using Highcharts

--

Est. 12h

OrderSelect - Support for Trades mode

Orderselect() maybe buggy

Print orderticket=0

OrderSelect(pos_4, SELECT_BY_POS, MODE_TRADES)

this function may not working

Get none order info

History mode working, but Trades mode not

Fix CI tests

Two CI tests to fix: Appveyor & Travis

Files to fix: *.mqh

Language: MQL (you need to install Metaeditor to compile the files). After installation, copy/clone the repo under MQL5 or MQL5/Include folder of the platform, so you can open them and compile. Other dependent repos should be cloned recursively into MQL5/Include (e.g. strategies).

The redefinition/already-defined errors happens, because include-files are including another .mqh files (<> instead of "") and compiler probably doesn't recognise that these are the same files. After that there should be only very few errors.

Implement socket library

Modelling Quality for H1 : 0.00%

Modelling Quality for H1 : 0.00% for M15 test.

TestModellingQuality EURUSD,M15: Symbol:        : EURUSD
TestModellingQuality EURUSD,M15: Period:        : 15
TestModellingQuality EURUSD,M15: ### Modelling Quality
TestModellingQuality EURUSD,M15: Modelling Quality for M1  : 25.00%
TestModellingQuality EURUSD,M15: Modelling Quality for M5  : 85.88%
TestModellingQuality EURUSD,M15: Modelling Quality for M15 : 86.58%
TestModellingQuality EURUSD,M15: Modelling Quality for M30 : 85.59%
TestModellingQuality EURUSD,M15: Modelling Quality for H1  : 0.00%
TestModellingQuality EURUSD,M15: Modelling Quality for H4  : 68.75%

And: Modelling Quality for M5 & M15: 0.00% for M1 test:

TestModellingQuality EURUSD,M1: Symbol:        : EURUSD
TestModellingQuality EURUSD,M1: Period:        : 1
TestModellingQuality EURUSD,M1: ### Modelling Quality
TestModellingQuality EURUSD,M1: Modelling Quality for M1  : 25.00%
TestModellingQuality EURUSD,M1: Modelling Quality for M5  : 0.00%
TestModellingQuality EURUSD,M1: Modelling Quality for M15 : 0.00%
TestModellingQuality EURUSD,M1: Modelling Quality for M30 : 74.00%
TestModellingQuality EURUSD,M1: Modelling Quality for H1  : 0.00%
TestModellingQuality EURUSD,M1: Modelling Quality for H4  : 37.50%

See: build 402029290

Lua parser

Investigate possibility of LUA integration into MQL.

Summary: Deposit is zero

Initial deposit is always zero for backtests.
CalculateInitialDeposit() is to fix.
Class: SummaryReport.mqh

Test:

void OnDeinit(const int reason) {
  double ExtInitialDeposit = CalculateInitialDeposit();
  CalculateSummary(ExtInitialDeposit);
  Print(GenerateReport());
}

To test, run EA with WriteSummaryReport input param to generate the report file.

Est. 2-3h

SummaryReport should take into the account magic numbers

Method: SummaryReport.CalculateSummary()

Currently, all profit is calculated from the history. It would be great if the summary report has the breakdown of profits for the given magic numbers. So if multiple EAs are run on some demo account, the reports shows only profits/losses for EA31337.

The solution is to extend CalculateSummary() by adding the range of magic number (e.g. _no_magic_min and _no_magic_max param), then if the values are specified, filter the statistics only for the given number.

Related: EA31337/EA31337/issues/26

Write Account class which implements Account Information functions.

Convert existing code (Account.mqh) into class which implements all listed Account Information methods using the same name as in MT4 documentation (some of them are already there). These methods should work for both MQL4 (MT4) and MQL5 (MT5) platforms (see the MT5 docs). Remove anything else which is not related to Account methods.

Language: MQL 4&5

To compile for each version, you need to install both platforms (MT4 & MT5) and compile using MetaEditor.

File::FileIsExist does not work

Check why the following code doesn't work by not recognising its own file:

#include <File.mqh>
int OnInit() {
  if (File::FileIsExist(Terminal::GetExpertPath() + "\\" + __FILE__)) {
      Print("File exists!");
      return (True);
  } else {
      PrintFormat("File does not exist: %s!", Terminal::GetExpertPath() + "\\" + __FILE__);
      return (False);
  }   
}

Compile and run in MT4. It should return True.

The goal is to check whether the original source code file which was compiled from exists or not.

Est. 1-3h

OrdersCloseAll for MQL5

The goal is to write a method which closes all open orders given the magic number. If the magic number is not present, close all of them.

The logic for MQL4 is already present, we need compatible code with MQL5.

Ideally we should have one standard code which should re-use existing compatible methods (e.g. Orders::OrdersTotal instead of OrdersTotal, and so on). Otherwise, separate methods.

  • Class: Trade
  • Branch: master
  • Est.: 1d

Trade: Add calculation of support and resistance

For example:

// See: http://forum.mql4.com/49780
void CalculateSupRes() {
   int commonPoint;
   int minLevel, maxLevel;
   double highest, lowest, stepIncrement, tolerance, high;
   double storeLevel[];
   ///ArrayResize(storeLevel, loopback);

   minLevel = iLowest(Symbol(), Period(), MODE_LOW, loopback, 0);
   maxLevel = iHighest(Symbol(), Period(), MODE_HIGH, loopback, 0);
   highest = iHigh(Symbol(), Period(), maxLevel);
   lowest = iLow(Symbol(), Period(), minLevel);

   //Print("max: " + highest + " min: " + lowest);
   stepIncrement = 0.0005;
   tolerance = 0.0002;
   static double tmp;
   tmp = 0.0;


   for (double actPrice = lowest; actPrice <= highest; actPrice += stepIncrement) {
      for (int i = 1; i <= loopback; i++) {
         //do some stuff here...
         high = iHigh(Symbol(), Period(), i);
         double topRange, bottomRange;
         // if is the first value tmp stores the first high encountered until that moment
         if (tmp == 0) {
            tmp = high;
         } else {
            //define a buffer adding a subtracting from tmp to check if the new high is within that value
            topRange = tmp + tolerance;
            bottomRange = tmp - tolerance;

            if (high <= topRange && high >= bottomRange) {
               commonPoint++;
            }
         }
         //if has been touched at least three times reset common point
         //tmp goes to the new high value to keep looping
         if (commonPoint == 3) {
            commonPoint = 0;
            tmp = high;
            ///Print("valore tmp: " + tmp);
            storeLevel[i] = tmp;
         }
      }
   }
}

Refs: https://www.mql5.com/en/forum/140136

Extend Timeseries class for MQL4/MQL5 compability.

Write, extend and correct the existing Timeseries class in order to implement cross-version methods which should correspond to Timeseries Functions from MQL4. Similar to #1, #2 & #3.

Each method should compile, be callable and should return same format and values in both MQL4 and MQL5. Remove all other functions which are not mentioned on the list.

In case of blockers, create a method placeholders with todo comments.

See: porting table for some guidance.

OrderSend: Support for IOC type filling

Requirements

Support for ORDER_FILLING_IOC filling mode, as some brokers support only IOC.

Because the brokers(most of them) do not support all filling types, the idea is to find EA's filling types in order to avoid invalid filling messages.

No matter what broker I'm using, the filling is set to FOK(fill or kill) every time.

Example broker to test: IC Markets.

Example

Example code:

request.type_filling=ORDER_FILLING_IOC;

Technical notes

Class: Order
Function: OrderSend()

Refs

'Timer' - local variables cannot be used

File: Profiler.mqh

Sample usage:

void Example() {
  #ifdef __profiler__ PROFILER_START #endif
  // Some code.
  #ifdef __profiler__ PROFILER_STOP #endif
}

Error during compilation in MT4:

'Timer' - local variables cannot be used

Write DateTime class which implements Date and Time functions.

Convert existing code (DateTime.mqh) into class which implements all listed Date and Time methods using the same name as in MT4 documentation (some of them are already there). These methods should work for both MQL4 (MT4) and MQL5 (MT5) platforms. Remove anything else which is not related to Date and Time.

E.g. Hour() method should return Hour() value in MT4, but MqlDateTime in MT5.

Language: MQL 4&5

To compile for each version, you need to install both platforms (MT4 & MT5) and compile using MetaEditor.

Class to hold indicator values

I try to complete your jobs, it's very useful to hold indicator values in object-oriented style rather than MT4 indicator buffers.

But I have a differend idea for under data structure, I prefer the linked list rather than dynamic array because performance issue.

my ideas:

  1. class IndicatorBuffer is an abstract for data buffer implemented by double linked list. Implementation with Dynamic array (with ArrayResize) has performance issue. EA slow down rapidly as data grows because ArraySetAsSeries +ArrayResize will move data in memory.

  2. IndicatorBuffer always keep the list sorted according to bar time, the newer value insert to head. so there is a head pointer.

  3. when IndicatorBuffer grows to max_size, the limit of buffer capacity, IndicatorBuffer discard oldest value, so there is a tail pointer and double linked way.

  4. class Indicator is an abstract for multi-buffer indicator. It has a array of IndicatorBuffer and the length of array is determined by second parameter to constructor.

  5. Add(double) and Add(int) adaptive to data type and store in corresponding field of MqlParam. GetDouble(mode) and GetInt(mode) search list from head pointer and return right value and proper type.

  6. Passing indicator name as string to constructor, not enum defined in Indicator class, will keep flexibility and isolated.

  7. ToString() display last n values in buffers, default n=3.

Indicator.mq4 is a demo to demonstrate how to use the base class to implement a customize indicator, and show the value on MT4 chart. Place Indicator.mq4 in Indicators directory manually.
screenshot of parallels desktop 2017 5 2 18 07

pull request #22

Class to send html e-mails from the file with tokens

Write a class to send e-mails with the following features:

  • check whether SendMail() can send html format,
  • create method like Mail::SendHtmlFromFile(string subject, string filepath, tokens[]);
  • create method like Mail::SendHtmlFromText(string subject, string text, tokens[]);
  • HTML format,
  • token replacement support (like the one in templates/ MT folder) provided by the array,
  • without DLL if possible, otherwise ignore the import and method when __no_dll__ is specified (see: Inet.mqh for example)

Sample example: SMTP Mail Library

  1. Sending e-mails through web server (no DLLs through WebRequest)
  2. Using Windows DLLs (without SSL) or self-made DLLs with SSL.

Est. 1d

Use filename from the 1st tick when saving ticks to CSV

Class: Ticker
Function: SaveToCSV

Current logic:
filename = filename != NULL ? filename : StringFormat("ticks_%s.csv", DateTime::TimeToStr(TimeCurrent(), TIME_DATE));

On the last parsed tick, it seems MT4 incorrectly passing TimeCurrent() which generates wrong filename.

For example, when testing 2018 data for the whole year, having RecordTicksToCSV param enabled in EA31337, the following filename is created:

  • ticks_2011.04.14

with content, either last tick, or empty:

Datatime,Bid,Ask,Volume

The solution could be to use the first tick for the filename.

Is the project alived?

It's amazing job for professional mql4 developer, never give up please.

What's the plant for next few months?

Write Trade class to implement MQL4/MQL5 Trade Functions

Write, extend and correct the existing Trade class in order to implement cross-version methods which should correspond to Trade Functions from MQL4. Similar to #1 & #2.

Basically please solve all @todo comments in Trade.mqh.

Each method should compile, be callable and should return same format and values in both MQL4 and MQL5. Remove all other functions which are not mentioned on the list.

In case of blockers, create a method placeholder with todo comment.

See: porting table for some guidance.

Est. 5-8h

Class to write HTML files

Wring HTML.mqh class to write HTML files.

Ideally using chained method calls.

Use http://example.com/ as example, e.g.

html = new HTML();
div = html.Body().Div("class=foo");
div.H1("Example Domain");
div.p("Foo"); // 2nd parameter can be ID
html.SaveToFile("output.html");

Or like:

html = new HTML("output.html");
table = html.Table(4,4);
table = table.AddRow();
div = Div().P("Footer");
image = Img("foo.png")
table = table.InsertAfter(div).InsertAfter(image);
html.body = table;
html.SaveToFile();

It should support header tag, tag properties (such as id, class), tables and inserting images or custom code.


Est. 8h

Method to predict losses based on the given orders

Given the following input params for the given pair:

  • lot size for buy and sell;
    write the method to assess the risk such as (one of the following):
  • maximum change to hit the margin call;
  • maximum change that account can handle, or reach certain % of DD;

Write SetFile class to load a file and expose its variables.

Write SetFile class (SetFile.mqh) and its methods with the following goals:

  • method which can load any .set file into class variables (e.g. LoadFromFile(string file)),
  • another similar method to load from the string (e.g. LoadFromText(string text))
  • after loading the file, the class will parse and store individual variables (via its own setter method, e.g. SetValue) with its values into class instance (e.g. into array),
  • write a getter method (e.g. GetValue) which expose the stored variables, so for given key will return its value,
  • calling the setter on existing key will replace the value.

The code should work for both MQL4/MQL5 syntax.

In other words, the task expects one class with 4 methods. One to load the file (in key=val format, sample ini-like format linked) into class array variable, another load from text representation (they both actually can be combined), and one setter (to set) and getter method to load the value based on the key (from the loaded settings). The technical documentation is not needed, since I give freedom to how this may be implemented. I've added placeholder class for a guidance.

Est. 6-8h

Implement new time series analysis and indicators

  • AC | Accelerator Oscillator | โœ”
  • ADO | Accumulation/Distribution Oscillator | โœ”
  • AGC | Automatic gain control | โœ”
  • ADX | Average Directional Movement Index | โœ”
  • ADXR | Average Directional Movement Rating | โœ”
  • Alligator | Alligator 3-line indicator | โœ”
  • ALMA | Arnaud Legoux Moving Average | โœ”
  • Amplitude | Amplitude of series | โœ”
  • AO | Awesome Oscillator | โœ”
  • APO | Absolute Price Oscillator | โœ”
  • Aroon | Aroon Indicator | โœ”
  • AroonOsc | Aroon Oscillator | โœ”
  • ATR | Average True Range, original | โœ”
  • ATRS | Average True Range, simple MA | โœ”
  • AvgPrice | Average Price | โœ”
  • BandPass | Bandpass filter | ย 
  • BBands | Bollinger Bands | โœ”
  • BBOsc | Bollinger Bands oscillator | โœ”
  • Beta | Beta value | โœ”
  • BOP | Balance Of Power | โœ”
  • Butterworth | Butterworth filter | โœ”
  • CBI | Cold Blood Index | ย 
  • CCI | Commodity Channel Index | โœ”
  • ccyMax | Strongest Forex pair | โœ”
  • ccyMin | Weakest Forex pair | โœ”
  • ccyReset | Initialize currency strength | โœ”
  • ccySet | Define currency strength | โœ”
  • ccyStrength | Get currency strength | โœ”
  • CDL2Crows... | 60 classic candle patterns | โœ”
  • CGOsc | Center Of Gravity oscillator | โœ”
  • ChandelierLong | Chandelier exit long | โœ”
  • ChandelierShort | Chandelier exit short | โœ”
  • Chikou | Ichimoku Chikou line | โœ”
  • CI | Choppiness Index | โœ”
  • CMO | Chande Momentum Oscillator | โœ”
  • concave | Curve concavity | ย 
  • ConnorsRSI | Connors RSI indicator | โœ”
  • Coral | Coral indicator | โœ”
  • Correlation | Pearson correlation coefficient | โœ”
  • COT | Commitment Of Traders report | โœ”
  • COT_CommercialPos | COT commercials net position | โœ”
  • COT_CommercialIndex | COT index | โœ”
  • COT_OpenInterest | COT open interest | โœ”
  • Covariance | Covariance coefficient | โœ”
  • crossOver | Curve cross over | ย 
  • crossOverF | Fuzzy cross over | ย 
  • crossUnder | Curve cross under | ย 
  • crossUnderF | Fuzzy cross under | ย 
  • dayClose | Day close | โœ”
  • dayHigh | Day high | โœ”
  • dayLow | Day low | โœ”
  • dayOpen | Day open | โœ”
  • dayPivot | Day pivot | โœ”
  • DChannel | Donchian Channel | โœ”
  • DCOsc | Donchian Channel Oscillator | โœ”
  • Decycle | Ehlers' Decycler | โœ”
  • DEMA | Double Exponential Moving Average | โœ”
  • DominantPeriod | Fundamental price oscillation | ย 
  • DominantPhase | Fundamental price phase | ย 
  • DPO | Detrended Price Oscillator | โœ”
  • DX | Directional Movement Index | โœ”
  • EMA | Exponential Moving Average | โœ”
  • ER | Efficiency Ratio | โœ”
  • FIR3 | Finite Impulse Response filter, 3 taps | ย 
  • FIR4 | Finite Impulse Response filter, 4 taps | ย 
  • FIR6 | Finite Impulse Response filter, 6 taps | ย 
  • falling | Curve falling | ย 
  • fallingF | Curve falling, fuzzy | ย 
  • findIdx | Find element | ย 
  • Fisher | Fisher transform | โœ”
  • FisherInv | Inverse Fisher transform | โœ”
  • FisherN | Fisher transform with normalization | โœ”
  • FractalDimension | Fractal Dimension | โœ”
  • FractalHigh | High Fractal indicator | โœ”
  • FractalLow | Low Fractal indicator | โœ”
  • frechet | Frechet pattern detection | ย 
  • Gauss | Gauss filter | ย 
  • HAClose | Haiken Ashi Close | โœ”
  • HAHigh | Haiken Ashi High | โœ”
  • HALow | Haiken Ashi Low | โœ”
  • HAOpen | Haiken Ashi Open | โœ”
  • HH | Highest High | โœ”
  • HMA | Hull Moving Average | โœ”
  • HighPass | Wide highpass filter | ย 
  • HighPass1 | 1-pole highpass filter | ย 
  • HighPass2 | 2-pole highpass filter | โœ”
  • HTDcPeriod | Hilbert transform cycle period | โœ”
  • HTDcPhase | Hilbert transform cycle phase | โœ”
  • HTPhasor | Hilbert transform phasor components | โœ”
  • HTSine | Hilbert transform sine wave | โœ”
  • HTTrendline | Hilbert transform instantaneous trendline | โœ”
  • HTTrendMode | Hilbert transform trend indicator | โœ”
  • Hurst | Hurst exponent | โœ”
  • IBS | Internal Bar Strength | โœ”
  • Ichimoku | Ichimoku indicator | โœ”
  • KAMA | Kaufman Adaptive Moving Average | โœ”
  • KAMA2 | KAMA with individual settings | โœ”
  • Keltner | Keltner channel | โœ”
  • Laguerre | Laguerre lowpass filter | โœ”
  • LinearReg | Linear regression | โœ”
  • LinearRegAngle | Linear regression angle | โœ”
  • LinearRegIntercept | Linear regression intercept | โœ”
  • LinearRegSlope | Linear regression slope | โœ”
  • LL | Lowest Low | โœ”
  • LowPass | Lowpass filter | ย 
  • MACD | Moving Average Convergence/Divergence | โœ”
  • MACDExt | MACD with various MA types | โœ”
  • MACDFix | MACD with standard parameters | โœ”
  • MAMA | MESA Adaptive Moving Average | โœ”
  • MAVariablePeriod | Moving Average with variable period | โœ”
  • MaxVal | Highest value | โœ”
  • MaxIndex | Index of highest value | โœ”
  • Median | Median filter | ย 
  • MedPrice | Center price of candle | โœ”
  • MidPoint | Center value of period | โœ”
  • MidPrice | Center price of period | โœ”
  • MinVal | Lowest value | โœ”
  • MinIndex | Index of lowest value | โœ”
  • MinMax | Lowest and highest values | โœ”
  • MinMaxIndex | Indexes of lowest and highest values | โœ”
  • MMI | Market Meanness Index | โœ”
  • MinusDI | Minus Directional Indicator | โœ”
  • MinusDM | Minus Directional Movement | โœ”
  • Mode | Most frequent value | โœ”
  • Mom | Momentum | โœ”
  • Moment | Mean, variance, skew, kurtosis | โœ”
  • MovingAverage | Moving Average with various MA types | โœ”
  • NATR | Normalized Average True Range | โœ”
  • Normalize | Normalize to -1 .. +1 | โœ”
  • NumInRange | Count ranges in interval | โœ”
  • NumDn | Count of falling elements | โœ”
  • NumRiseFall | Length of streak | โœ”
  • NumUp | Count of rising elements | โœ”
  • NumWhiteBlack | Difference of white and black candles | โœ”
  • peak | Curve peak | ย 
  • peakF | Curve peak, fuzzy | ย 
  • Percentile | Percentile | ย 
  • PercentRank | Percent rank | ย 
  • PlusDI | Plus Directional Indicator | โœ”
  • PlusDM | Plus Directional Movement | โœ”
  • polyfit | Polynomial regression | ย 
  • polynom | Regression polynomial | ย 
  • PPO | Percentage Price Oscillator | โœ”
  • predict | Curve peak / crossover prediction | ย 
  • predictMove | Predict price move by statistics | โœ”
  • predictSeason | Predict price move by seasonal analysis | โœ”
  • ProfitFactor | Ratio of positive to negative returns | โœ”
  • rising | Curve rising | ย 
  • risingF | Curve rising, fuzzy | ย 
  • R2 | Determination coefficient | ย 
  • RET | Rate of change between two points | โœ”
  • ROC | Rate of change | โœ”
  • ROCP | Rate of change percentage | โœ”
  • ROCR | Rate of change ratio | โœ”
  • ROCL | Logarithmic return | โœ”
  • ROCR100 | Rate of change ratio, 100 scale | โœ”
  • Roof | Ehlers' roofing filter | โœ”
  • RSI | Relative Strength Index, original | โœ”
  • RSIS | Relative Strength Index, simple MA | โœ”
  • RVI | Ehlers' Relative Vigor Index | โœ”
  • SAR | Parabolic SAR | โœ”
  • SentimentLW | Williams' Market Sentiment | โœ”
  • SentimentG | Genesis Sentiment Index | โœ”
  • ShannonEntropy | Randomness metric | โœ”
  • ShannonGain | Expected gain rate | โœ”
  • SIROC | Smoothed Rate of Change | โœ”
  • SMA | Simple Moving Average | โœ”
  • SMom | Smoothed Momentum | โœ”
  • Smooth | Ehlers' super-smoother | โœ”
  • Spearman | Spearman's rank correlation coefficient | โœ”
  • Spectrum | Spectral analysis | ย 
  • StdDev | Standard deviation | โœ”
  • Stoch | Stochastic oscillator | โœ”
  • StochEhlers | Ehlers' predictive stochastic | โœ”
  • StochF | Stochastic Fast | โœ”
  • StochRSI | Stochastic RSI | โœ”
  • Sum | Sum of elements | โœ”
  • SumDn | Sum of falling elements | โœ”
  • SumUp | Sum of rising elements | โœ”
  • T3 | Triple smoothed MA | โœ”
  • TEMA | Triple EMA | โœ”
  • touch | Curve touches another | ย 
  • Trima | Triangular Moving Average | โœ”
  • Trix | TEMA rate of change | โœ”
  • TrueRange | True range | โœ”
  • TSF | Time Series Forecast | โœ”
  • TSI | Trend Strength Index | ย 
  • TypPrice | Typical price | โœ”
  • UltOsc | Ultimate Oscillator | โœ”
  • UO | Universal Oscillator | โœ”
  • Variance | Variance | โœ”
  • valley | Curve valley | ย 
  • valleyF | Curve valley, fuzzy | ย 
  • Volatility | Annualized volatility | โœ”
  • VolatilityC | Chaikin Volatility indicator | โœ”
  • VolatilityMM | Min/Max volatility | โœ”
  • VolatilityOV | Empirical volatility | โœ”
  • WCLPrice | Weighted Close Price | โœ”
  • WillR | Williams' Percent Range | โœ”
  • WMA | Weighted Moving Average | โœ”
  • yield | Riskfree rate at bar | โœ”
  • ZigZag | ZigZag indicator | โœ”
  • ZMA | Zero-lag Moving Average | โœ”

Source: Zorro functions & download

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.