Download MetaTrader 5

Market is closed

To add comments, please log in or register
ttechnik
256
ttechnik  

How can I get info that the market is closed?

IsTradeAllowed(
)
is return true in time (weekend)
Alain Verleyen
Moderator
33358
Alain Verleyen  
ttechnik:

How can I get info that the market is closed?

IsTradeAllowed(
)
is return true in time (weekend)
When market is closed, your EA/Indicator don't receive tick, so no code is executed. Unless you are using a script ?
ttechnik
256
ttechnik  
angevoyageur:
When market is closed, your EA/Indicator don't receive tick, so no code is executed. Unless you are using a script ?

My code does not work that way.

My code in init(), in a while(true) loop.

onewithzachy
2269
onewithzachy  
ttechnik:

My code does not work that way.

My code in init(), in a while(true) loop.


Just some idea.

1. Send tiny pending order a hundred thousand miles away from current market price, and you'll get market is closed error.

2. Bar Time on M1 does not change at all, but TimeLocal already over a minute.


whroeder1
15930
whroeder1  
ttechnik: My code in init(), in a while(true) loop.
  1. Init is expected to return. While there you can't open the parameter list.
  2. Why are you complicating your code with the while? Means you can't use the tester. Return from start and wait for the next tick.
ttechnik
256
ttechnik  
onewithzachy:

Just some idea.

1. Send tiny pending order a hundred thousand miles away from current market price, and you'll get market is closed error.

2. Bar Time on M1 does not change at all, but TimeLocal already over a minute.



ok, thank you!
ttechnik
256
ttechnik  
WHRoeder:
  1. Init is expected to return. While there you can't open the parameter list.
  2. Why are you complicating your code with the while? Means you can't use the tester. Return from start and wait for the next tick.


I do not want to test. My algoritm too complicating for test.
To add comments, please log in or register