[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 418

 
TarasBY:

Here is one of possible ways to search for N tickets of last closed orders, and you can filter orders by type (BUY, SELL) and profitability (loss-making, profitable):

After fGet_TicketsLastCloseOrd() function is called and it returns the amount of tickets found according to the specified parameters, you can (I would do it) check with the specified amount of tickets (fi_NUM) and the value returned by the function. All collected tickets will be in the array passed to the function by reference.

And in this variant it's not important, how many of these last tickets are searched. :)

And if you need profit by these last closed orders, then it's even easier:


can you teach me how to use this practically?

let's say, i need to get the total profit of 12 last closed positions, where should i enter the number 12 in this code ?

i tried it this way

      Print (fGet_TicketLastClosePos(-2,0,iTime (NULL, PERIOD_D1, 0)),fGet_TicketsLastCloseOrd(12,0),fGet_ProfitLastCloseOrd(12,-2));

it says '0' - incompatible types


 
hoz:

Why would iOpen() pull data from the server? The documentation says it returns a value... So it's returning, not downloading.

So... what can I say, how can I explain what mountains are to those who live in the steppe...
 
hoz:

Zhunko:
Integer
:

In all these discussions and attempts to find out the truth, to put it delicately, I am extremely confused (in actions of seekers) and outraged (in inaction of developers) by the fact that even experienced programmers have to guess something, experiment, spend time and effort on what by definition should be open, transparent and reference material for developers. So that there are no such questions as "maybe...", "maybe not..." in principle. How do you organize your work with users so that even after day and night discussions the truth still remains undefined and unknowable! - I am amazed at the low level of approach to work and the lack of respect for users.

I have nothing positive to say to MetaQuotes in this regard.

I respect those users who try to do their best.

But I cannot call this approach professional - alas. Neither of them, nor others. Why it happens to them and others is another matter. But it is depressing, frankly speaking.

Why is there no source that gives unambiguous and clear answers to such questions? If there is one, where is it, and why are there still experiments rather than statements?
 
lottamer:


will you teach me how to use it practically ?

let's say I need to get the total profit of the last 12 closed positions? where do I enter the number 12 in that code?

I tried it this way

it says '0' - incompatible types


For the last 12 orders closed:
double ld_Profit = fGet_ProfitLastCloseOrd (12);
Print (ld_Profit);
 
Chiripaha:

In all these discussions and attempts....

This is the internet, there will always be people here who will prove that the sun rises in the west and sets in the east, that it is light at night and dark in winter, that 2 x 2 = 5, etc.

Whichever topic, you will find a post on the internet with an opinion completely contrary to the truth and with a heated defence of it.

 
TarasBY:
For the last 12 orders closed:

something is not right there. Shows -0.28 instead of -3.68
 
Integer:

This is the internet, there will always be people here who will prove that the sun rises in the west and sets in the east, that it is light at night and dark in winter, that 2 x 2 = 5, etc.

Whichever topic, you can find a post on the internet with an opinion completely opposite to the truth and with a heated defence of it.

Arguments and discussions, including those on the internet, are fine. As long as they are not about background facts. And where the developer determines - "this is how it is" - there is nothing to argue about.

And you, Dmitry, unfortunately, are right that there are such people. But that is exactly what it says about the lack of professionalism.

It is a developer who can investigate, experiment, make experiments and choose the best variants of implementation. A USER - professional should skillfully and skillfully use what was already created by someone else and not to search and search, otherwise he becomes not a user but a developer, scientist, researcher (which are very different tasks), and with the help of what was created to create other things, to realize other tasks. Otherwise you will get stuck in place.

The fact that you have to do research, and that so far no one in the course of your discussions and arguments has given a link to the official position and source, indicates that this information does not exist. Otherwise intelligent people would not be arguing about obvious things.

 
lottamer:

there's something wrong there. It shows -0.28 instead of -3.68
If you have correctly filtered your orders, which I suggested you do, and if you include commission and swaps in your calculations, then everything works correctly.
 

Hello. How can I overcome memory leakage when calling an indicator with parameters? For example, I call ZigZag(25,5,35) in indicator (or in Expert Advisor on each tick):

double ZigZag(int index){

   return(iCustom(NULL,0,"ZigZag",0,25,5,35,index));

} 

The terminal freezes and slows down. It happens when using any indicator via iCustom with specified input parameters.

It leaks memory very badly. How to fight it?)

 
How can I get the program to output the EMA level as a price? Suppose EMA1 with period (1), EMA2 with period (0), EMA1 equals 1.3321, while EMA2 for the current period is 1.3200. The result of the expression (EMA1 to EMA2) must be 0.0121. When you run the script, the alert shows zero, while we need "0.0121". How to solve this problem?
Reason: