[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 210

 
coronel:

Magik will never end, don't worry about that.

Use Magik and it will make your life easier.

Exactly... what if you need to select an order that has been open for two months from the start of a trade from a year's trading history? How would you calculate it? You will pile orders with different magicians and how will you sort out the mess?

 
eddy:


If the whole site is about features, why not group everything by features? and features are ways of solving problems, i.e. the features themselves should be grouped by problems

Classify/group as you see fit, with links to existing articles, use cases, discussion topics and specific codes.

This is a huge and necessary work,further revealing the possibilities of MQL.

 
artmedia70:

Exactly... but what if the trading history for the year requires you to select an order that has been open for two months since you started trading? How would you calculate it? Will you pile up orders with different wizards and how will you sort out the mess?


I do not understand what you see a problem.
 
doon:

Hello again.

The point is, I need to check if the order was closed using the isCloseLastPosByStop() function .I can't use the magik because it will run out sooner or later (2147483647), and I can't erase or modify it. Please advise how to implement this.

It all depends on the structure of your EA. If it opens a large number of orders - then make your own accounting of orders, if the number of simultaneously open positions is limited, then monitor using flags.

It is always possible to check the selected order by its immutable parameter. For example - its open time and magic. It is also possible to check the ticket specifically. If the selected order has a ticket 1 and the order with such a ticket has already been checked, you should not check it again. But we also need to check that it is selected from the list of market orders and not closed. This is checked by its closing time OrderCloseTime() - this function always returns zero if the order has not yet been closed.

 
coronel:
I don't understand what you see as a problem.
I didn't see a problem. I saw a completely irrational and pointless use of a Magician in my opinion. Why should each subsequent order be assigned, let's say, Magik++?

It is my understanding , and I do, that it is better to use magik to distinguish between different strategies working in the same bind in one EA. Then it (EA) will know exactly which position to open/close/delete/modify in accordance with the current strategy. Let me explain - we have several different strategies working in one EA at the same time. Each strategy has its own magic number and the Expert Advisor knows by itself which position corresponds to which strategy and does not deal with positions of a long term strategy upon occurrence of a meaningful criteria for intraday strategies.

I do so, but... IMHO.

You can award each order with a new magician and among several thousand different magicians you can look for the right position to make a trading decision...

Yedom das saine.

 
coronel:

Classify/group as you see fit, with links to available articles, use cases, discussion topics and specific codes.

This is a huge and necessary work, opening up the possibilities of MQL evenmore.

The way I see it:

1) creating a section

2) filling it with all comers, i.e. authors of articles, codes and other stuff. it is also suggested to suggest authors to classify their work in terms of specific subjects. note, it is not divided into groups, but a tagging system, since works may refer to different subjects simultaneously.

3) natural addition, i.e. creation of a question/objective/objective and an answer/solution. The 2nd point will still be there, i.e. questions that have already been answered, as well as problems whose solution is already proposed and/or described - will be answered by an existing work, i.e. code/article/textbook and/or the like.

this structure implies the possibility to develop all sections, i.e. textbook (free offer of variants of explanations), documentation (offer of more detailed descriptions, descriptions of nuances), codebase (optimization) and articles ("live articles", i.e. discussion of possibilities and their nuances and as a result editing/updating/improving articles)

 
eddy:

The way I see it is this:

1) creating a section

2) filling by all comers, i.e. authors of articles, codes and other. it is also proposed to offer authors to classify their work into specific themes. note, that it is not division of material into groups, but system of tags, because works can be related to different themes at the same time.

3) natural addition, i.e. creation of a question/objective/objective and an answer/solution. The 2nd point will still be there, i.e. questions that have already been answered, as well as problems whose solution is already proposed and/or described - will be answered by an existing work, i.e. code/article/textbook and/or the like.

This structure allows for development of all the sections, e.g. tutorial (offering free variants of the explanations), documentation (offering more detailed descriptions, describing nuances), codebase (optimization) and articles ("live articles", i.e. discussion of possibilities and their nuances and as a consequence editing/updating/improving articles).

So do it. You've already been invited to speak to the administration on this issue.

And this branch has a slightly different agenda.

 
artmedia70:
I didn't see a problem. I saw a completely irrational and pointless use of a Magician in my opinion. Why should each subsequent order be assigned, let's say, Magik++?

It is my understanding , and I do, that it is better to use magik to distinguish between different strategies working in the same bind in one EA. Then it (EA) will know exactly which position to open/close/delete/modify in accordance with the current strategy. Let me explain - we have several different strategies working in one EA at the same time. Each strategy is assigned its own magiks and the Expert Advisor knows by itself which position corresponds to which strategy and does not deal with positions of a long term strategy upon occurrence of a meaningful criteria for intraday strategies.

I do so, but... IMHO.

You can place a new magician on every order and look for the needed position among thousands of different magicians to make a trading decision.

Yedom das saine.

In my post I only pointed out the impossibility of exhausting all possible numbers for a magician - not even a hundred lifetimes would be enough for that.

However, that doesn't mean that a new magician should be assigned to each new order.

In any case, one way or another, the magician is only needed by the EA for its "internal business",

and the trader will be interested in the instrument and time of trading and maybe even in a certain EA, but it can be determined by the comment.

So, I do not see any difference in our views of the magician.

 
eddy:

I see it this way:


Don't mess with people's heads. )))

Get started, after all!

 
coronel:

The break statement stops the execution of the nearest subordinateswitch, while or for statement . Control is given to the next operatorafter the one that is ending. One of the purposes ofthis operator is to terminate a loop when a variable is assigneda certain value.

-----

The continue operatorpasses control to the beginning of the nearest externalwhile or for operator, causing the beginning of the next iteration. This operator is the opposite of break.

Funny :) Thanks.
Reason: