Codes

Equity Recorder for MetaTrader 4

Record the performance of individual strategies real time in offline charts

Forum

The hardcore quants amongst you might be interested in this:

With version 1.3 my mt4R.dll has finally reached production quality and is released under GNU GPL https://sites.google.com/site/prof7bit/r-for-metatrader-4 and some example code that illustrates how to use it can be found here

Posting code snippets in this forum is almost impossible

Posting code snippets in this forum is almost impossible. Everytime I try to post code or answer a posting with code in the quotation it is pure luck when the formatting doesn't get messed up completely. formatted text 3 spaces now try to quote this without messing up the indentation. Could the

MQL4 -> R

I finally did it! attached is the dll along with its .mqh header and in the source zip is the dll source code

@metaquotes dev: strange zero division exception inside terminal.exe *after* start() is already done

[1332] exception C000008E at 004CBF22 in C:\Programme\BestDirectMT4\ terminal.exe Could it be that there is some uncaught zero division somewhere inside terminal.exe happening when calculating the y scale of the indicator window? I am having not much fun with a really ugly and ongoing debugging

5 digits detection

double pointsPerPip(){ string suffix = StringSubstr ( Symbol (), 6 ); int digits = MarketInfo( "EURUSD" + suffix, MODE_DIGITS); if (digits == 0 ){ digits = MarketInfo( "EURUSD" , MODE_DIGITS); } if (digits == 0 ){ return ( 1 ); } else { if (digits == 5 ){ return

Sleep() function wrongly documented in the mql4 reference

The Sleep() function documentation in the MQL4 reference currently reads: The Sleep() function suspends execution of the current expert within the specified interval . The Sleep() function cannot be called from custom indicators since they calculate in the interface thread and may not decelerate it

deadlock in start() during deinit(), mt4 freezing, kill it and lose any changes to chart objects

for the second time in a week I have managed to crash (freeze and kill) MT4 and when this happens I lose all objects that were drawn into a chart since it was started. The freeze happens during timeframe switching, something I do in start() seems to run into a deadlock, most often MT4 will timeout

"shutdown by timeout" when switching timeframes -- solved: MT4 bug + workaround!

0.01% of you might be interested in the following: I had strange timeout problems one out of 10 times when switching between timeframes when one of my EAs was attached to the chart. This included every EA that makes use of the ofline_charts library to plot equity curves and is relevant to all EAs

unclickable text objects, strange behavior

Sometimes I work with text objects in the chart, for example in one of my EAs i have a text object that i can move around with the mouse and it will give me a profit estimation based on the position of the text object and write the result of the calculation into the text object. This involves using

creating a magic number

/** * create a positive integer for the use as a magic number. * * The function takes a string as argument and calculates * an 31 bit hash value from it. The hash does certainly not * have the strength of a real cryptographic hash function * but it should be more than sufficient for generating a *