[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 461

 
demlin:
One more question. The !OrderSelect(orderIndex, SELECT_BY_POS) - what does it mean? I cannot understand the !


This is a negation

If OrderSelect(orderIndex, SELECT_BY_POS) = true, !OrderSelect(orderIndex, SELECT_BY_POS)=false

 
sergeev:

! - is a Boolean operation NOT

! false = true

! true = false

Then the whole expression: order NOT selected ?
 
Maximov7:

double C1;
// в старте
C1 = Ask;

it is not possible to start because with every new tick a new Ask.... value will be assigned and it has to be reserved for further operation


Would that work?

int start()
{
static double C1=Ask;
 
demlin:
Then the whole expression: order NOT selected ???

Expression: if an order is not selected, then we proceed to the next iteration of the cycle... in search of the right order for its trawl... we only approach the trawl when exactly "our" order is selected for the required instrument... :-))) Just go figure it out - there is nothing complicated there. :-)))
 
Roman.:

Expression: If no order is selected, we proceed to the next iteration of the cycle... in search of the right order for its trawl... we only approach the trawl when exactly "our" order is selected for the required instrument... :-))) Just go figure it out - there is nothing complicated about it. :-)))
Thank you very much, extremely useful information
 
demlin:
Thank you very much, extremely useful information

Get busy... :-)))
 

I have noticed that open or closed orders get crossed in two ways. Here is an example of closed ones.

First:

for(pos = 0; pos < OrdersHistoryTotal(); pos++)
    {  OrderSelect(pos,SELECT_BY_POS,MODE_HISTORY);
        ... работа с ордером ...  }
 

The second one:

for(pos = OrdersHistoryTotal()-1; pos >= 0; pos--)
    {  OrderSelect(pos,SELECT_BY_POS,MODE_HISTORY);
        ... работа с ордером ...  }

Basically everything is clear (I only use the first option, though), but there are questions.

Why, in the second case, do we subtract 1(OrdersHistoryTotal()-1) from the total number of orders?

I correctly understand, that both first and second options do the same thing, but they differ only in that the first starts the search from the first to the last, and the second starts from the last to the first in the list?

 
tol64:

I have noticed that open or closed orders get crossed in two ways. Here is an example of closed ones.

First:

The second one:

It's all clear in principle (I only use the first variant), but I have some questions.

Why, in the second case, do we subtract 1(OrdersHistoryTotal()-1) from the total number of orders?

I correctly understand that the first and second options do the same thing, but they only differ in that the first starts the search from the first to the last, and the second from the last to the first in the list?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

And in the first variant, you need to subtract one, since the counter of orders starts from zero, and this means that the last order will be just OrdersHistoryTotal()-1.
int OrdersHistoryTotal() - returns the number of closed positions and deleted orders in the account history, in the client terminal.
Let's say, OrdersHistoryTotal() returned number 10 - "closed positions and deleted orders in the history of the current account", and we have the following picture of closed and deleted orders - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 - a total of 10 orders in the history, but the loop is not organized before number 10, but before number 9, starting from "0", i.e. we start from the first line of the code.In other words, we get the SELECT_BY_POS flag - the index parameter passes the index number of the position in the list, and it is at ( OrdersHistoryTotal()-1 ) that we go through all 10 orders in the history of the terminal.

- Do I correctly understand that the first and second variants perform the same thing, but they only differ in that the first one starts the search from the first to the last one, and the second one starts from the last to the first in the list?
- Yes.

P.S. I hope I explained it clearly... :-)))

 
Roman.:


(Thank you. I understand it very clearly. Anyone can understand if you explain it like that.)))

One more question. I found a lot of similar questions in the search, but I have a slightly different question.)

The chart mismatch. In order to see a "valid ???" result I have to constantly recalculate timeframes. That is, if I see that there are errors in the log, I go to quote archive and recalculate all timeframes. In the tester, for example, I run a test on control points. Everything is OK. Then I, for example, form bars. Everything is OK. But if we again perform a test using control points, I will again see discrepancy of charts in the journal. What is it? ))) Is there anything against this nastiness?

 
tol64:


(Thank you. I understand it very clearly. Anyone can understand if you explain it like that.)))

One more question. I found a lot of similar questions in the search, but I have a slightly different question.)

The chart mismatch. In order to see a "valid ???" result I have to constantly recalculate timeframes. That is, if I see that there are errors in the log, I go to quote archive and recalculate all timeframes. In the tester, for example, I run a test on control points. Everything is OK. Then I, for example, form bars. Everything is OK. But if we again perform a test using control points, I will again see discrepancy between charts in the journal. What the ...? ))) Is there anything against this nastiness?


Of course it does. To help sort out and eliminate these errors.:-)))