You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Ladies and Gentlemen!
Please answer a question.
How and where in the code should you designate external variables?
It's not clear from the example above.
How can I make external variables in the application's settings not be depersonalized AT_1...AT_32, because you can't remember what each number stands for?
Values of external variables for strategies are specified (as well as any values of external variables) in the Expert Advisor settings.
You cannot change names of external variables in the Expert Advisor, because they are written in the code of the Expert Advisor AG_exp.ex4.
The names of external variables from the Expert Advisor are passed to the attached file of the strategy via the Instrument array.
The names of local variables in the strategy, corresponding to external variables in the Expert Advisor, can be changed in the strategy.
This is the case in this example:
You can specify your own names if you wish.
For example, instead of AT[i] specify Alfa, Beta, etc.
Array Instrument [][][]: http://autograf.dp.ua/Pages/2/26/267/2676.htm
Strategies in AG_AT(): http://autograf.dp.ua/Pages/2/26/267/26711/26711_1.htm
Strategies to attach: http://autograf.dp.ua/Pages/2/26/267/26711/26711_2.htm
Examples of coding strategies:
http://autograf.dp.ua/Pages/2/26/267/26712/26712_1.htm
и http://autograf.dp.ua/Pages/2/26/267/26712/26712_2.htm
Now I understand. Without any programming experience, I don't get it right away. Thank you.
Если программно, то можно воспользоваться функцией ObjectDelete() или ObjectsDeleteAll().
And where should I put it in my strategy? Or the objects will be created and deleted each time a custom function is called?
Now I understand. Without any programming experience, I don't get it right away. Thank you.
And where should I put it in my strategy? Or objects will be created and deleted each time user function is called?
It doesn't need to be prescribed in a user function or in a strategy.
Make a simple separate script. After you turn off the strategy, throw it in the window, it will delete all unnecessary things.
(in AG 5 we will have to make some kind of deinit in the strategy; but solution will depend on possibilities of MQL5)
Thanks for the sound advice. Only you overestimate me. I haven't dealt with scripts yet, but I'll go in that direction. If possible, please give me a link to an analogue.
I've only got acquainted with the indicator so far.
I have taken TD_Points&Line_mgtd1.1.mq4 by Vladislav Goshkov (VG) as an analogue, added log.mq4 Copyright © 2006, komposter for report creation and got more than 2 000 lines of my indicator.
I made its scheme. It has about 500 lines. I may cut it up, but it is ok for now.
By icon
// --- // ---
is the cut out places.
For now I have the structure in mind, so I want to achieve the desired functionality. Then we'll comb everything according to the rules (the cost of quality is geometrically progressive).
Well, the SRC can't insert 521 lines: "text is larger than allowed size". We'll have to attach the file
At this stage you need to become familiar with the special functions and types of applications.
The best way to do this is to take the MQL4 textbook and read from the beginning, one by one. If you have any questions, post them, I'll try to answer them.
At this stage you need to become familiar with the special functions and types of applications.
The best way to do this is to take the MQL4 textbook and read from the beginning, one by one. If you have any questions, post them, I'll try to answer them.
Your manual is my reference book. I downloaded and printed it and use it all the time.
Questions arise if I don't understand the gist of what I'm reading or if some issues are not covered.
There are two samples with writing data into an external file or reading from a news file and this is one call to the Start() function. More than a month of messing around until Andrey Khatimlianskii (komposter) found the example which made what I need. Namely: init() - formation of report's table header (about 30 columns), start() - formation of row with parameters of each deal of session, deinit() - formation of session's result. And I have made three types of reports (table with parameters for each transaction, column with session totals and table with session totals) and I can use them in different configurations for further processing in Excel. By the way, in deinit() ObjectsDeleteAll(). But that was later, but from the beginning I had made a heap of graphs , so that I could see and analyze everything in the tester and in real life. It helps a lot when programming, because MQL-4 has no debugger, and this way it is possible to see on the chart what lines (opening and closing conditions, objectives, deal lines) the program constructs and how it does it. But it is all within the scope of the indicator and it does not trade real time. Therefore, there is a need to attach to the Expert Advisor to enable non-virtual trading, plus the ability to use the tester report data with the possibility of automatic optimization. And all this without losing the existing functionality implemented so far in the indicator.
Unfortunately, 495 pages of the tutorial, 180 pages of the AutoGraf-4manual, 370 pages ofMetaEditor, MT help , it is impossible to show everything, and the life is not enough to read the forum. But it's just for fun.
At I have made a code scheme of strategy functions (based on indicator algorithm) and I am not sure where and how to put script for ObjectsDeleteAll()there , am I right in plugging trading functions (they are highlighted with "zzzzzzzzzz")? >> Please take a look at this stuff:
Strategy function code diagram (based on the indicator algorithm)
But exactly I made a strategy function code scheme (based on indicator algorithm) and I don't know where and how to insert script for ObjectsDeleteAll()? Did I put in the trading functions correctly (they are highlighted with "zzzzzzzz")? Please take a look at this stuff:
I think you're getting a lot ahead of yourself.
In programming, you can't operate by feel.
You must not use anything in your own code that a programmer doesn't quite understand or doesn't understand at all.
That way nothing gets done.
Programming, perhaps more than any other activity, in its essence requires complete clarity and full self-reporting.
Start by writing elementary code. Only move on to more complex ones when you have a full explanation of every letter in your code.
--
There are examples of simple and simple Expert Advisors in the textbook.
Earlier, in the introduction to programming, there is a classification of application programs (signs and differences between Expert Advisors, scripts and indicators).
A script cannot be "plugged" into an Expert Advisor. This is a separate independent programme.
At a glance, I can say that your code is poorly formatted.
Besides, most of the blocks could be designed as functions. That would be more clear (otherwise you won't be able to read your own code in a couple of months)
You are absolutely right. I agree with you on all points. Thank you for taking the time to provide constructive criticism!
By "include" I mean to write code linking the script operation to AG_AT() or its function, which implements the strategy.
In the tutorial, the example of a simple Expert Advisor contains start(), while in the regular one, all special functions are present. There are no problems, but as they say, "the appetite comes with the meal".
The question is how to use all the great featuresof AutoGraf-4. What should I do?