how can i stop the program??

 
hii guys----only a suggest- i am trying my ea but i am thinking to insert a new possibility. i need to stop the program after a particular time .....for example......55 sec. how can i do?? i have tried with " timeseconds(orderopentime() ) == 55 ......but it doesnt go u have an idea?????? thankssssssssssssssssssssssssssssssssssssssss
 
giulioron:
hii guys----only a suggest- i am trying my ea but i am thinking to insert a new possibility. i need to stop the program after a particular time .....for example......55 sec. how can i do?? i have tried with " timeseconds(orderopentime() ) == 55 ......but it doesnt go u have an idea?????? thankssssssssssssssssssssssssssssssssssssssss

This has been discussed many times. Try searching for 'disable expert'.

 
ok i try :-)) thanks
 
SORRY GUYS BUT I HAVE NOT SOLVED MY DOUBTS. IF I OPEN AN ORDER AT 10.00 AM ....FOR EXAMPLE..... HOW CAN I CLOSE IT AT 10.05 ???? OR IF EASIER AFTER A BAR OF 5 MINUTES ?? I HAVE TRIED IN SOME WAYS BUT IT DOESNT GO. I THOUGHT TO COUNT THE BARS....BUT I DONT KNOW HOW CAN I COMPAIR THE NUMBERS OF BARS AT 10.00 WITH .....BARS+1 ......UNDERSTAND???
 

.

extern int ExpirationOfOpenOrderInMinutes = 5;


if((ExpirationOfOpenOrderInMinutes>0) && (TimeCurrent() > OrderOpenTime()+ExpirationOfOpenOrderInMinutes*60)) {

  OrderClose(....

}
 
CurTime()
 
giulioron:
SORRY GUYS BUT I HAVE NOT SOLVED MY DOUBTS. IF I OPEN AN ORDER AT 10.00 AM ....FOR EXAMPLE..... HOW CAN I CLOSE IT AT 10.05 ???? OR IF EASIER AFTER A BAR OF 5 MINUTES ?? I HAVE TRIED IN SOME WAYS BUT IT DOESNT GO. I THOUGHT TO COUNT THE BARS....BUT I DONT KNOW HOW CAN I COMPAIR THE NUMBERS OF BARS AT 10.00 WITH .....BARS+1 ......UNDERSTAND???

If you cannot figure out how to find and read and understand the documentation about the available date and time functions and don't have a clue what a UNIX timestamp might be, then you are not a programmer.

If you are not a programmer you should not be writing programs that deal with dangerous things like for example navigation systems for nuclear missiles or forex trading bots.

Reason: