|
|
Register
|
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
|
|
Exclusive Forum
|
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
- Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
- Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more
|
 |
|
|

03-21-2006, 05:29 PM
|
 |
Senior Member
|
|
Join Date: Oct 2005
Posts: 1,000
|
|
Running a program from MetaTrader is not a hard thing anymore!
Hi folks,
Scenario 1:
The EURUSD went up, I want to tell the boss. What if the MetaTrader can open my email client!
Scenario 1:
The EURUSD went down. Could MetaTrader open the notepad to write a piece of note.
If you are a lazy person like me, or you have more useful ideas (scenarios) about running applications from MetaTrader!
Running a program from MetaTrader is not a hard thing anymore.
Just you this library.
And enjoy with the Shell function:
Usage:
use this function to run any program you want from your MQL code.
Parameters:
FullPath (string) the full path and the file name
Parameters (string) any parameters you want to pass to the program
Return vale:
( int) the handle of the program in success and -1 in error
Example:
int res = Shell ("c:\\window\\notepad.exe", "");
http://www.metatrader.info/node/89
|

03-21-2006, 06:58 PM
|
|
Junior Member
|
|
Join Date: Dec 2005
Posts: 14
|
|
|
cglib
It is nice to have this capability.
I noticed the download file is named cglib.mq4
I change it to cglib.mqh and placed it in the include file.
Works great!
As a test of the Shell function, I opened a .csv file in ...\experts\files with a text editor.
Thanks for the good work.
hap
|

03-22-2006, 12:13 PM
|
 |
Senior Member
|
|
Join Date: Oct 2005
Posts: 1,000
|
|
You're welcome!
Quote:
|
Originally Posted by hapalkos
It is nice to have this capability.
I noticed the download file is named cglib.mq4
I change it to cglib.mqh and placed it in the include file.
Works great!
As a test of the Shell function, I opened a .csv file in ...\experts\files with a text editor.
Thanks for the good work.
hap
|
You're welcome! 
hap, do you have any tools request?
|

03-22-2006, 06:13 PM
|
|
Junior Member
|
|
Join Date: Dec 2005
Posts: 14
|
|
|
scheduling utility
codersguru,
This is in response to your request for tools. Look it over and see if you think that it is reasonable and useful. You may have a ready alternative.
I am currently working on a project using EXCEL. By utilizing the MT4 DDE addressing (=MT4|BID!GBPUSD, etc.) for real time price values, I have created a dynamic display (real time display of price changes, percentages, probabilities, moving bars, highlighted targets, etc.). I also utilize data extracted to a .csv file by means of an MT4 script. The .csv data is read by EXCEL with Database Query. The time frame of interest for this worksheet is daily and the values that I extract from MT4 change very little during the course of a day. So I need to run the script once or twice a day. Currently I just drag and drop the script into any chart. The script is written so that it extracts current values and ArrayCopyRates data with set Symbols and Time Periods so that there is no need for the script to read any values in the chart. This updating procedure is simple and straight forward but I would like it to occur automatically on a scheduled basis. If this were possible then I would consider constructing the display for lower time frames.
I modified the script to run as an EA with a Sleep command. This works fine as long as the Expert Advisors is active and the EA is installed on a chart in the active profile. If I change to a different profile the updating stops. I would rather drag and drop than rely on an EA for this procedure.
I also modifed the script to run as an indicator but burdening the process thread with this type of demand seems unnecesary. Also if the indicator is not in an active profile, no update.
What I would like is a utility that could set a fixed schedule (once a day, once an hour, etc.) for the running of a script automatically without being dependent on an EA or active profile.
This project started with just the desire to automate some of the process of doing some very basic spreadsheet calculations. It has now grow into a dynamic indicator. One of the challenges has been the data transfer. Primarily how to best accomplish this with Excel. Any insight you have in working with Excel would be much appreciated.
hap
|

04-20-2006, 10:15 AM
|
|
Junior Member
|
|
Join Date: Nov 2005
Posts: 6
|
|
|
Amazing Shell()
Real cool, thank u CodersGuru, keep up the good work, take care.
|

04-24-2006, 11:36 PM
|
 |
Senior Member
|
|
Join Date: Oct 2005
Posts: 1,000
|
|
Quote:
|
Originally Posted by sx ted
Real cool, thank u CodersGuru, keep up the good work, take care.
|
sx ted,
You're welcome!
Hope it helps!
|

08-10-2006, 07:34 PM
|
 |
Senior Member
|
|
Join Date: Oct 2005
Posts: 484
|
|
|
Dde
CodersGuru,
Hopefully you can help me with the following task. I would like to capture live or import historical data using DDE. Do you know of the santax to import data from a certain bar. Let's say for example I want the OHLC for August 10, 2006: 14:30 bar, M1 chart?
Thanks in advance,
TimeFreedom
Quote:
|
Originally Posted by codersguru
Hi folks,
Scenario 1:
The EURUSD went up, I want to tell the boss. What if the MetaTrader can open my email client!
Scenario 1:
The EURUSD went down. Could MetaTrader open the notepad to write a piece of note.
If you are a lazy person like me, or you have more useful ideas (scenarios) about running applications from MetaTrader!
Running a program from MetaTrader is not a hard thing anymore.
Just you this library.
And enjoy with the Shell function:
Usage:
use this function to run any program you want from your MQL code.
Parameters:
FullPath (string) the full path and the file name
Parameters (string) any parameters you want to pass to the program
Return vale:
( int) the handle of the program in success and -1 in error
Example:
int res = Shell ("c:\\window\\notepad.exe", "");
http://www.metatrader.info/node/89
|
|

10-30-2006, 03:32 PM
|
|
Member
|
|
Join Date: Aug 2006
Posts: 56
|
|
Quote:
|
Originally Posted by codersguru
You're welcome! 
hap, do you have any tools request?
|
Thanks. I am not hap, but could you add some function that checks if the extern program is still running.
So I can let MT4 save some file. Then I shell a function to read that file and do some weird calculations and save the results. If i can check that my calculations are finished, I can let MT4 read the results and work with them.
An example is BrainMaker.exe, a neural network that can be called in that way from MT4.
|

10-30-2006, 03:38 PM
|
 |
Senior Member
|
|
Join Date: Oct 2005
Posts: 1,000
|
|
Quote:
|
Originally Posted by JosTheelen
Thanks. I am not hap, but could you add some function that checks if the extern program is still running.
So I can let MT4 save some file. Then I shell a function to read that file and do some weird calculations and save the results. If i can check that my calculations are finished, I can let MT4 read the results and work with them.
An example is BrainMaker.exe, a neural network that can be called in that way from MT4.
|
Do you mean you want a tool (dll - function ) that tells you if a specific program is running or not?
|

10-30-2006, 03:41 PM
|
|
Member
|
|
Join Date: Aug 2006
Posts: 56
|
|
Quote:
|
Originally Posted by codersguru
Do you mean you want a tool (dll - function ) that tells you if a specific program is running or not?
|
Yes, that's it.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 07:38 PM.
|