Download MetaTrader 5

reduction/variation of MT5 default expert

To add comments, please log in or register
fxnew5
72
fxnew5  

Hello,I have been programming with MT4 and I'm  at the beginning  re: MT5, which seems to a great step forward by the MT programmer team.



Now, There is this basic "MACD Sample" expert installed by default (MT5)


And I'd just like to modify this EA (to be simpler) to use the interesting MT5 testing features for some of my customer indicators.

So I'd appreciate, if some could inform me how to do the following 


a) deleting all default indicatos like MACD etc. which are visible in the chart when/after testing

(without compromising the compiling status)

b) including a custom indicator

style: line, like a MA, which should the only indicator visible in the chart and be the (primary) buy and sell trigger

example:

buy

if ( iCustom(NULL, 0, "indicator name",parameter1,parameter2, 3etc. ,1,0)== 1)

sell

if (iCustom(NULL, 0, "indicator name",parameter1,parameter2, 3etc. ,1,0) == -1)


c) possibly including up to 2 other iCustom indicators (similar to b)), only to be added as an additional buy sell condition, but - not being visible - in the chart


d) and maybe an additional fixed (initial) stop loss. The default trailing which works fine should stay



if anybody has an idea for the issue thanks in advance

Marco vd Heijden
Moderator
5536
Marco vd Heijden  

So it might be a good idea to read the documentation or a good book on MQL so that you get to know what each of the functions do.

You can also set the cursor on a function in the compiler and press F1 this will open the index and point to the function you want to examine.

THen you can start to comment out several elements by using two backslashes //

And recompile the code to see the effects.

The beginning is usually always the hardest part but it does get easier along the way.

The code base is also a good source of material to study just use the search function to find good snippets of drop in code to use as trailing stop or dynamic lotsizing and many others it's like a goody bag with all sorts of excellent examples to use and learn from.

Many times you get an idea and write the code, just to find someone else has already done it so you dont have to reinvent the wheel just look around.

To add comments, please log in or register