nicholish en / Publications
Codes
CDouble & CDoubleVector for MetaTrader 5
A library for common rounding methods used in MQL development, primitive wrapper class for type (double), and vector for CDouble objects. MQL5 and MQL4 compatible
CMqlParams for MetaTrader 5
MqlParams container class that uses method chaining to quickly add params and reduce lines of code
High-performance iTimeSeries for time-sensitive applications for MetaTrader 5
This time-series library brings lightning-fast timeseries access to MQL5 for time-sensitive applications while implementing the familiar methods of MQL4, e.g. iBarShift
Forum
[SOLVED] Indicators are not properly instantiated when called/created from an Indicator of different working time-frame.
UPDATE: See the workaround below CopyBuffer() throws an error of 4806 (Indicator data not accessible) when calling an indicator with a different Time-Frame from within the code of an indicator. It happens when calling a valid Indicator handle to a different Time-Frame from the current working
MQL file organizer script
Get script here -> https://gist.github.com/nicholishen/...f530e162c40f43 What it is: A script that gathers all your MQL files and organizes them together and provides detailed reports in JSON and Excel. How it works: The script recursively searches the defined directory for MQL files (default is
Major issue with MT5
Looking at the CLEK20 (crude futures contract @ AMP futures) on the MT5 platform. The contract is currently trading at -8.00bbl, however the platform is frozen at 0.01. I suspect the platform is not equipped to handle negative prices
pymt5adapter: A developer friendly wrapper for MetaTrader5
I wanted to spin off a separate thread for this package so topics and discussions won't clutter up the original Python thread. Summary: pymt5adapter is a drop-in replacement (wrapper) for the `MetaTrader5` python package by MetaQuotes. The API functions simply pass through values from the
Example of how to use CiCustom
After some in depth debugging, I realized I've been using CiCustom wrong. The documentation is unclear but by implementation it is now apparent that CiCustom was intended to derive subclasses. Making custom indicator classes is very easy of you use the following pattern. Inherit CiCustom Make a
METAEDITOR BUG
This code crashes metaeditor. I know it's because of recursion, however, it should not crash the entire program. #include <arrays/arrayobj.mqh> typedef bool (*ArrayFilterFunc) (CObject*); template < typename T> class objvector : public CArrayObj { protected : static objvector<objvector<T>*>
I finally found a good use for function pointers.
Here is an example of putting function pointers to good use. Those who know javascript or python will likely recognize this pattern immediately. This is a generic object vector that I frequently use, and I've added a filter method which takes a function as an argument and returns a pointer to a new
Post your useful snippets here.
Useful snippets go here
Python script to parse MQL4/5 log files to Excel workbooks for filtering and analysis.
python requirements: easygui, openpyxl import os import re import sys from pathlib import Path import easygui as ez from openpyxl import Workbook def parse_log(file: str): if not Path(file).match('*. log '): raise Exception('Error: Not a valid log file') if 'MQL4' in file: p