Codes

Programmatic modification of Tester "From:" and "To:" fields with user32.dll for MetaTrader 4

This script uses the Windows API to modify the "From:" and "To:" fields within the strategy tester according to user input. For this script the strategy tester should already be open. Tested on Windows 7 64 bit. If you are using another version of win

Forum

Memory handler: cannot allocate 16419849

Hi guys, I have been working on an EA of mine for the past month or so. It works great in the strategy tester, so I decided to try it out on the live demo. However, after a few trades I get this message: "2010.04.26 18:51:58 Memory handler: cannot allocate 164202016 bytes of memory." Also, when I

Strategy tester, DLLs, and FreeLibrary()..

I have seen this issue mentioned here and there, especially by 7bit, but I was never able to get around this problem: The strategy tester does not properly decrement the reference count of the loaded library during deinit(). Because of this, the DLL file stays loaded in the system, and crashes when

How to modify symbol swap in tester?

I have a script that modifies the spread of a currency in the tester by editing symbols.sel I need the same thing but for Swap Long and Swap Short. Can anyone help me out with that? Or if not, then perhaps someone knows what file this info is stored in

Please help me understand what's going on here

The i-Regr indicator (as well as numerous others) calculates the linear regression of X bars and displays it on the screen (green line): At each new bar the index buffers are cleared and re-written with new values; the indicator repaints (as it should). When it does this all prior regression values

i-Regr (linear regression) bar shift?

I use a linear regression indicator (i-Regr) in my EA. Specifically, I use the slope of the linear regression. I define the "slope" like this: slope = MathAbs ( 1000000 *(CurrentReg - LastReg)/ Period ()); (where CurrentReg is the regression's value at the current bar's close price, and LastReg is

Reading data from MYSQL database through Lazarus DLL (stumped and desperate).

7bit solved my initial problem. Please scroll down to my second post for my current issue. I am attempting to query my MySQL database with a DLL that I made in Lazarus, and return the result to MQL4. I made a standalone 'program' in lazarus that queries the database without any problems; but when I

MT4 Journal bug?

I made the following code as a test and ran it on open bar mode in the strategy tester . int start() { int q= 0 ; for ( int i = 0 ; i< 10 ; i++) { q++; Print (q); } Print ( "---------------------------------------" ); return ( 0 ); } Most of the time it

FileOpen with a .set file?

How would my FileOpen statement have to look if I wanted to read a tester .set file? FILE_READ|FILE_CSV , FILE_READ, or FILE_BIN|FILE_READ

How canI find the relation between a binary and continuous variables? (In MatLab)

I have an EA that I regularly backtest and optimize. I want to determine a relationship between the probability of a given trade being profitable and a certain statistical measure called kurtosis at the time the trade was initiated. I programmed my EA to generate a .csv file containing each trade's

How to tell EA that it is on its last round of optimization?

I need to trigger a specific function at the end of the final round of optimization, from the EA's deinit() function. What is the best way to do this? Do I have to calculate it out by making start, step, and stop globally available variables? Or is there an easier way