- a code shell to enable you to create your own flavours of HGBnD quickly and easily. This is a small file.
- the HGBnD core library.mqh library that holds most of the working functions. This goes in your Include folder. You need either to point people towards it if you distribute your own EA, or include it when you start your thread.
- a user guide for you to adapt to your own EA should you plan to share it with SHF members.
- Rene's controller.
- void UsualOnInit() contains all the stuff from OnInit().
- void UsualOnDeInit() contains all the stuff from OnDeInit().
- bool UsualOnTick() contains all the stuff from OnTick().
- void ReadUsualIndicatorValues() which is the old ReadIndicatorValues().
There are lists of comments or codes to search for the places in the code that you might need to alter, at the bottom of each file. I have stopped writing the line numbers - I found it easier to find the places by doing the search when using the shell to create new EA's.
Do a search in the shell for "#include <HGBnD core library.mqh>". This is line 238 at the time of writing this but may change over time. The #include command is there to make the compiled version show the extern inputs first. extern inputs in the library will be shown after the command, so you adjust the way your own are shown by adjusting the position of the #include command - although you will probably never need to. Users will not notice any difference between EA's created using the new shell and library and those created using the previous one.
Rene's additions to all this
1) It is possible to disable EA's created by this shell in the lead up to a news release - this applies to all of the Dotty family and pretty much everything I have coded for about 3 years. Go to Rene's http://www.stevehopwoodforex.com/phpBB3 ... =97&t=5039 and download the EA. It goes on a single chart on your Empty4 platform and set up the inputs to do whatever it is you want it to do. Rene's EA will talk to all of mine and stop them doing anything in the run up to a news release. You do not have to alter any of the code in the shell for this to happen.
2) Rene's HGBnD - MultiSymbol - Controller.mq4. Rene coded this in response to a request from a member, for an EA that would stop further trading once x numbers of pairs have trades open. This is an added part of our anti over-trading armoury.
Here is Rene's explanation from the PM hse sent me:
The default inputs of -1 effectively disable the controller.The idea is this: The user installs HGBnDnSSnFB (or whichever member of the HGBnD family) on as many pairs they desire (one chart for each pair). I have tested this with 28 pairs, without any problems. Then, they install the HGBnD - MultiSymbol - Controller on another pair (eg. XAUUSD, but it doesn't really matter). There are three parameters to configure:
I think that their names explain their function.
- MagicNumber
- MaxNumberOfOpenSymbols
- MaxNumberOfOpenCurrencies
sinput
This is a useful replacement for extern when using libraries. I discovered that comments following an extern input resulted in the user being shown the comment in the inputs window, instead of the variable. For example:
Code: Select all
extern double RiskPercent = 0;//Over rides lotChange the code in my example to:
Code: Select all
sinput double RiskPercent = 0;//Over rides lotNote that sinput creates a constant and so will not work for, say, the Lot input. The value of this input is checked to confirm that it is allowed by the broker and changed if not to meet the broker's minimum requirements. An mql4 constant cannot be changed in code, so the use of sinput generates an error.
Easiest when writing new code, is to use sinput and change to extern when the compiler throws a hissy fit.
NOTE: sinput appears to have stopped working.
Before questioning my code
Before questioning my code, here are a few thingies to consider:
- I have been around the block a few times. I am quite good at this stuff these days. SHF has not become the force it is because I am Mr Dimwit from Dimwitsville, Dimwitcounty, Dimwitworld.
- Much of the code has been donated over the years by coders whose skills are so far in advance of mine that they show me up as the amateur coder that I really am.
- Said code from these experts has worked flawlessly and seamlessly for years. FOR YEARS.
Suppose you are still forum death-wishingly tempted to post about the non-existent bug, here is what to do:
- bear in mind that I am the forum owner and that my power here is aboslute. I am a forum tyrant and wield that power mercilessly.
- consider posting about the 'bug' you have just found in code that has worked flawlessly and seamlessly FOR YEARS. From there:
- contemplate my reaction to spending a couple of hours hunting down a non-existent 'bug' only to discover that it really was you being a cretin (ask around if new here) - it has happened.
- shudder delicately, change your mind about posting and move on to a different subject.
.