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.
I saw a thread some were that showed different secrets of the MQ platform that were not documented or poorly documented. But can not find it again, so I started this thread. ND you can move it if you like.
This has to do with the code wizard templates not the chart templates. MT gives you a few general ones and some custom to build indicators. What I have done was to create my own general templates. One for experts, one for scripts, one for indicators, etc.. (see the screen shot). The trick is to create your own and name them as the ones that MQ will use. MQ doesnot know its different. It only knows it by the name. Be sure to make a backup copies of your work, as each time you up date to a new build MT will replace them with the original ones again, deleting yours.
Whats the benefit of this? It lets you start with your own code format and style. You can include links to your include files and libraries or any thing else you use with most of your work. Any MQ4 code or dlls can be used. The first code below is the MQ's template expert.mqt file. All one has to do is to remove the code as shown below and add any code block with comments etc. that you like. A very simple way.
Code:
<expert>
type=EXPERT_ADVISOR
</expert>
#header#
#property copyright "#copyright#"
#property link "#link#"
#extern_variables#
<<<<<<<<<<<<<< REMOVE LINES BELOW AND ADD YOUR CODE >>>>>>>>>>>>>>>>>
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
The second code block is part of my expert.mqt file. As you can see there is a lot more you can do that MQ documentation shows. Remember this is only part of my file. You should create one that fits you.
My template may be a little more advance then one needs but it points out other things that can be done. This expert.mqt file has #define statments which the wizard fills in for me. If you notice there are no #property statements as they are included in to my main library file. Which gets feed the information from the wizard as well. The define statments now can be called or used any were in your code.
Theres a lot more to this then I am showing you but mine may be to complicated for most. If you start with the simple example above, then try adding some other things of your own. Just remember to save a back up copy of your work because MQ will replace it with their code each time you update MQ.
I was looking for way to include many indicators/EA/servers in one setup.
This indeed to extract a MT setup, include what you want and create a new setup with maybe 100 indicators or more.
Main problem is, as you showed in the picture, after setup is running a temp folder (presetup) is created but the file inside are delivered in a way I can't understand.
I believe the next step after you've clicked everything the setup will unpack the default files.
Theres a lot more to this then I am showing you but mine may be to complicated for most. If you start with the simple example above, then try adding some other things of your own. Just remember to save a back up copy of your work because MQ will replace it with their code each time you update MQ.
Keit
Hell, it's too complicated as it is!
Could you give a specific example of where altering these template files would prove useful? I see references to your scripting language included in the examples (I first recall seeing this in a Hans123 EA you posted on StrategyBuilderFX years ago..). What added functionality does this provide, above and beyond what one could achieve with MQL?
Personally, I'd be all for delving deeper into the innards on MT if I thought I had well and truly cracked the 'HolyGrail' problem - until then, it just seems like a solution that is looking for a problem...
Could you give a specific example of where altering these template files would prove useful? I see references to your scripting language included in the examples (I first recall seeing this in a Hans123 EA you posted on StrategyBuilderFX years ago..). What added functionality does this provide, above and beyond what one could achieve with MQL?
Personally, I'd be all for delving deeper into the innards on MT if I thought I had well and truly cracked the 'HolyGrail' problem - until then, it just seems like a solution that is looking for a problem...
You are right my version of the Hans123 EA was created using this setup as a starting point. If you remember that then you will remember that alot of people wanted me to give them my libraries which I refused. May be I should show people how to create multi purpose libraries of there own.
Any ways, this is not about libraries and its in no way going to help you break the mystery of the HolyGrail. I use this to set up a begaining file the way I start a code project which includes my external libraries. When you start a new code project the file that mq creates looks like whats in the screen shot attached. You can however, have mq create the file containing anything you want by altering the existing files. The file can be made to your preferance and style of coding. You do not have to use the default mq format. Once you change the file, mq will start with your file after that not the MQ file you see below.
Keit
Last edited by cockeyedcowboy; 04-01-2008 at 04:10 AM.
If I'am understanding you right your talking about something different. You can use a setup program to install either a complete MT platform with all your other files or have it install over an existion MT directory. Theres one problem most install packages will write to the windows registry keys. These entries is how windows knows were the files are located. Most people using MT tend to move files around and delete file manually when no longer need. this will cause registry enteries not to be cleared, if one doesnot use the uninstall to remove the programs. Once the files are deleted manually you may not be abile to use the uninstall after that to clear the registry keys. What you are asking can be done but you need to do it without writing to the registries.
If I'am understanding you right your talking about something different. You can use a setup program to install either a complete MT platform with all your other files or have it install over an existion MT directory. Theres one problem most install packages will write to the windows registry keys. These entries is how windows knows were the files are located. Most people using MT tend to move files around and delete file manually when no longer need. this will cause registry enteries not to be cleared, if one doesnot use the uninstall to remove the programs. Once the files are deleted manually you may not be abile to use the uninstall after that to clear the registry keys. What you are asking can be done but you need to do it without writing to the registries.
Keit
Hi,
I re-read the first post carefully and I saw something different first time. Sometimes you see what you want .
Problem is not the registry because MT works clean in presetup. Just after last click some values are write into the registry, the problem is no easy to solve. In fact you can edit some files previous installation as cockeyedcowboy is editing templates to set directory, name, whatever, it's very funny.
You are right my version of the Hans123 EA was created using this setup as a starting point. If you remember that then you will remember that alot of people wanted me to give them my libraries which I refused. May be I should show people how to create multi purpose libraries of there own.
.....
Yes, I do remember that also - but this was not an indirect way of asking you for them now either, I was just genuinely curious!
Thanks for pointing out exactly what templates you were referring to, I wasn't at all sure, but have now seen the light. I still think though that although it's useful to be able to 'arrange' your code-space to your own requirements, it is a little above-and-beyond what most still struggling with MQL itself (myself included) will devote much time to - just my opinion obviously!
Yes, I do remember that also - but this was not an indirect way of asking you for them now either, I was just genuinely curious!
Thanks for pointing out exactly what templates you were referring to, I wasn't at all sure, but have now seen the light. I still think though that although it's useful to be able to 'arrange' your code-space to your own requirements, it is a little above-and-beyond what most still struggling with MQL itself (myself included) will devote much time to - just my opinion obviously!
Yes Omelette,
As I said in the first post, that what I use is, in most cases, too advance then what most will need. People here came because of Forex not programing, however a lot have picked up on the programing end too. Just though to give some idears.
In case some are still a little confussion as to which templates and wizard I am talking about ...