Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1055

 
artmedia70:
iTime() to help you
Thank you very much Dear! I don't understand where and how to substitute this function, please guide me if you don't mind.
 

Can you tell me if the condition triggers an order at 13:00, which closes at 19:00. However, at 16:00 the same condition is triggered again, but the order is not opened because the condition stipulates Total==0 (where Total=OrdersTotal(), in order to avoid constantly opening orders). What function, if any, should be used to make the second order also open?

Similarly, at 13:00, Condition_1 triggers Buy_1 order at 13:00, which will close at 19:00. At 17:00, Condition_2 is triggered to open another Sell_2 order, but the second order is not opened again due to condition Total==0 (where Total=OrdersTotal()).

 

Hello!

How to reset all Buy_OpenNr[50] variables ? Just by looping, or is there an easier way?

for( int cnt =0; cnt<50; cnt++)
{
Buy_OpenNr[cnt]=0;
}
 
abeiks:

Hello!

How to reset all Buy_OpenNr[50] variables ? Just by looping, or is there an easier way?

ArrayInitialize
 
AlexeyVik:
ArrayInitialize
Thank you!
 
Abdus_Ali:

Can you tell me if the condition triggers an order at 13:00, which closes at 19:00. However, at 16:00 the same condition is triggered again, but the order is not opened because the condition stipulates Total==0 (where Total=OrdersTotal(), in order to avoid constantly opening orders). What function, if any, should be used to make the second order also open?

Similarly, at 13:00, Condition_1 triggers Buy_1 order at 13:00, which will close at 19:00. At 17:00, Condition_2 is triggered to open another Sell_2 order, but the second order is not opened again due to condition Total==0 (where Total=OrdersTotal()).

And who prevents you from setting condition Total<=1 for the 2nd order?
 

Please help me, I can't find an answer to a simple question.

intTimeSeconds(,,,,,)Returns the number of seconds elapsed since the start of the minute of the specified time.

If I insert the bar open time into the function

TimeSeconds(iTime(NULL,PERIOD_M5,0))

how can I know that there is 10 seconds left before the bar closes?

 
AlexeyVik:
ArrayInitialize
abeiks:

Hello!

How to reset all Buy_OpenNr[50] variables ? Just with a loop, or is there an easier way?

Why does it say "array required"?

ArrayInitialize(Buy_OpenNr[50],EMPTY_VALUE);
 
abeiks:

Why does it say "array required"?

Because you have to read the documentation all the way through. And there's an example

ArrayInitialize(array, EMPTY_VALUE);
 
ara66676:

Please help me, I can't find an answer to a simple question.

intTimeSeconds(,,,,,)Returns the number of seconds elapsed since the beginning of the minute of the specified time.

If I insert the bar open time into the function

TimeSeconds(iTime(NULL,PERIOD_M5,0))

how can I know that there is 10 seconds left before the bar closes?

Well, subtract the elapsed time from the number of seconds in the period...

PeriodSeconds(PERIOD_M5) - TimeSeconds(iTime(_Symbol, PERIOD_M5, 0));



Reason: