Market is closed

 

How can I get info that the market is closed?

IsTradeAllowed(
)
is return true in time (weekend)
 
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 ?
 
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.

 
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.


 
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.
 
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!
 
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.