I used a system similar to this with mqII v.3 to connect AmiBroker and Meta Trader together. The reason was the limited functionality of v3 indicator builder. Both MT and AB could have the same file open at the same time, something that you can not do with eXcell or most of MS software. I didnot delete the file in between read writes. What I did was to place a switch on the first line of the file too indicator if data contained in it was new unread or old alread read data. This switch was reset only after all the data was writen to it, so MT would not get bad or partial signal information. Basicly what I did was to use AB to process all data generate from MT generate signals and pass back the results to MT. Which would place and manage the orders. Worked very well.
The CockeyedCowboy
I used a system similar to this with mqII v.3 to connect AmiBroker and Meta Trader together. The reason was the limited functionality of v3 indicator builder. Both MT and AB could have the same file open at the same time, something that you can not do with eXcell or most of MS software. I didnot delete the file in between read writes. What I did was to place a switch on the first line of the file too indicator if data contained in it was new unread or old alread read data. This switch was reset only after all the data was writen to it, so MT would not get bad or partial signal information. Basicly what I did was to use AB to process all data generate from MT generate signals and pass back the results to MT. Which would place and manage the orders. Worked very well.
The CockeyedCowboy
Can this method work in backtesting? I doubt if the data can be exchanged between Matlab and MT4 via CSV file in backtesting. Anybody with similar experience pls comment, thanks
Great job, i'll use this way to feed my neurral network in Matlab...
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article Interaction between MetaTrader 4 and Matlab via CSV Files has been published:
Step-by-step instructions of how to organize data arrays exchange between MetaTrader 4 and Matlab via CSV files.
Now let us check how everything works. Let us try to enable and disable the timer using “Start”. If the timer is enabled, the clock above the path input field must function.
It would be more correct to delete the timer using the "X" button at closing of GUI. If you want to do so, add
at the beginning of function “figure1_CloseRequestFcn”. This function will be called at closing of GUI. You can access to it from GUI editor:
But, please take into consideration that now, if you press “Run” of the editor without having closed the operating GUI, the old timer will not be deleted while the new one will be created. And next time there will be one more created, etc. You can deal with "unsettled" timers using command “delete(timerfind)” from the Matlab console.
Author: Dmitriy