[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 429

 
Somebody help me, please! The question is on the previous page.
 
sss2019:
Help someone, please! The question is on the previous page.

current time is less than expiry time, TimeCurrent() is less than OrderExpiriation, but orders are still deleted
How did you know that TimeCurrent() is less than OrderExpiriatio?
 
sss2019:

Here is the code

In my case, it turns out that the current time is less than the expiry time, TimeCurrent() is less than OrderExpiriation, but the orders are still deleted. What is the error, I've been sitting here all day and can't find it.

One more tip (not related to the original question) - create a variable, assign it to TimeCurrent() and subsequently refer to the variable - it will help to relieve the computer.

 
sergeev:
And how do you know that TimeCurrent() is less than OrderExpiriatio?


I tried to output it via Alert, TimeCurrent() was indeed greater, but WHY? The OrderExpiriation is equal to TimeCurrent + 3600, i.e. it must be greater anyway. Why does this happen?

chief2000:

One additional tip (unrelated to the original question) - create a variable, assign it the value TimeCurrent() and subsequently refer to the variable - this will relieve the load on the computer.

And why, can you explain it in some technical way?

 

Oh, and here's another question. How is OrderProfit() measured, in pips?

If I need it in pips, then

if(OrderProfit > 10 * Point)

will it be taken into account as a profit in pips?

 
sss2019:


I tried to output it with Alert, TimeCurrent() was indeed higher, but WHY? OrderExpiriation is equal to TimeCurrent + 3600, i.e. it should be greater anyway. Why does it happen this way?


Well, you did it in the code and that's why it happens this way.

Output each tick to the log and see where you screwed up.

 
sss2019:

Oh, and here's another question. How is OrderProfit() measured, in pips?


RTFM
 
sss2019:

And why, can you explain it in some technical way?

Because you will access TimeCurrent() only once, and this command is the kind of thing that eats up computer resources (at least that's what I once observed when I also used it a bunch of times).

 
sergeev:

Well, you did it in the code, that's why it happens.

Output every tick to the log and see where you screwed up.


I replaced the TimeCurrent variable type from datetime to int and it all worked, so there you go!

Maybe you can still tell me what OrderProfit is measured in and how to measure it in pips?

 
sss2019:


Can you tell me how OrderProfit is measured?


How about RTFM?
Reason: