[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 1077

 
merkulov.artem:

Good afternoon,

There are two questions, I can't find a solution, please help:

1. I have an EA which puts 6 pending orders. How should I set "a" value to "Ask" and make it work when placing orders instead of updating at every tick, or delete and modify orders as needed and keep it until the six orders will close again and the function sets them with the new value, then "a" will work with the new Ask value?

2. There is a modification of an order: "OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderTakeProfit());" how should we keep the same parameters, i.e. OrderStopLoss() or OrderOpenPrice(), which were set when placing an order; they should be replaced with zeros, or the same values which were used when placing a pending order?

P.S. I haven't found anything about it in the manuals // Thanks a lot.


Declare a variable (a), in which we will enter the Ask price. We recalculate the orders at the start of the EA. If there are no orders, then null the variable. Then we check if the variable is equal to zero, then we add Ask price to it and place orders from this level. It is clear that on the next tick, the program will see that the orders are in place and will not affect the "A" variable that contains the previous Ask. It is also clear that as long as there are orders in the market the value of variable "a" will not change.

2. If we need to save the order parameters, we need to request them from the server and save them into variables or an array. You have to do it once and leave it until the order is no longer needed.

You didn't find this in the tutorial, because the author was trying to make his vision of the language as clear as possible. But this tutorial doesn't cover the issues of compa's interaction in the Server-Client system. The tutorial, as well as the help in the meta-editor only slightly touches those issues. A beginner simply doesn't think about what is happening on the current tick and what will happen on the next tick. He mistakenly thinks that everything will be the same on the next tick. But it is a serious error - the program will behave quite differently on the next tick, because the values of the variables have changed due to a new price on the previous tick! And this is especially important when building programs that operate on the principles of a cybernetic automaton - that is, that have a memory of what state the automaton is in.

Visitors to the forum can give you ready-made solutions to your problems. But it will not do you any good. The best thing is to help you understand the logic of the work and stimulate you to master the language as a tool. The best thing that you can get here is your personal knowledge which will work for you for years. Knowledge and the ability to apply it.

 
RekkeR:
Good evening and have a good week. Can you please teach me if it is possible to merge and edit tpl. profiles in notepad or in some other way, to be able to change the alternation of additional indicator windows, in the main window and insert additional indicator windows from another profile, between existing ones???

Wouldn't it be easier to spend 10-15 minutes to create a group of used templates, and then call each of them as needed? Create once, save it separately from the terminal and then use it for YEARS?
 
goldtrader:
To sell? To extract last penny from gullible suckers?

I myself was asked to find such an Expert Advisor ... I do not think they would sell it to suckers )))) but for demonstration purposes only

But still ......

Help find an EA for the following testing criteria.

- Testing from 1/4/2005 - to date.

- Average monthly profit should exceed 5% of initial deposit

- Maximum relative drawdown should not exceed 10%.

- The currency pair should be whatever you want it to be
 
itum:

I myself have been asked to find a similar advisor ... I do not think it will be sold to suckers )))) but rather for educational purposes

But still ......

Help me find an EA with the following test criteria.

- testing on 1/4/2005 - up to date.

- Average monthly profit should exceed 5% of initial deposit

- Maximum relative drawdown should not exceed 10%.

- The currency pair should be whatever you want it to be


I have such an EA. I posted it free on Alpari a few years ago. People still send me e-mails, which have a kind of... Some of them praise it, others condemn it, and some ask to show me how to set up this Expert Advisor correctly. I've already showed a screenshot of deposit growth of an independent user on the forum; the deposit that goes well in profits. I will give the adviser - for parameters - write to me personally - I will give you the link to the appropriate thread on the Alpari forum - read there about the parameters. I will not send the settings as my Expert Advisor is multifunctional. Download it :) Maybe fortune will smile on you. But the fact that the expert can be set up so that it will give not five but much more percent and not only in the tester, but also on the real account is a fact.

Files:
 

Greetings! n - variables take one of two values, variants of combinations of which should pass to p variable one of 4 values. Can you tell me how this can be done in the code?

 
drknn:

Wouldn't it be easier to spend 10-15 minutes to create a group of templates to use, and then call each of them as needed? Create once, save it separately from the terminal and then use it for YEARS?

You can take a shotgun, create a group of patterns with dc in 10-15 minutes, save them individually and mow greens as needed. FOR YEARS.

There will be a better chance in a hundred times than farting over the computer into a stool.

But I do wonder about the answer to my elementary question.

 

There is an EA. Uses M1 and M5 indices - if tested on all ticks it works fine. If you set it on open prices not a single trade.

Indices are used as follows

double MA0 = iMA(NULL,1 ... 0);
double MA1 = iMA(NULL,1, ... 1);

MA1 < MA0
What may be the problem?
 
volshebnik:
Alexander, thank you very much! Very detailed and thorough, thank you very much for your work. Don't the MT4 developers answer here?
No answers, I will start my questions again. "Do MT4 developers not reply here? Or do I have to write to them somewhere separately? I read somewhere that MT4 will not change any more, is it true ?
 
RekkeR:

You can take a shotgun, create a group of patterns with dc in 10-15 minutes, save them individually and mow greens as needed. FOR YEARS.

There will be a better chance in a hundred times than farting over the computer into a stool.

But still interested in the answer to my elementary question.



Open the Terminal - templates folder. In this folder you will find ready-made templates (*.tpl-files). Open any of them with notepad. If you understand the syntax, you will be able to edit them.
 
drknn:

Open the Terminal - templates folder. There are ready-made template files (*.tpl-files) in it. Open any of them with notepad. If you understand the syntax, you will be able to edit them.

Thank you.

Reason: