TimeTradeServer analogue for MT4 - page 8

 
Alexandr Gavrilin:

Well on a currency it works on a trading day, will it work on a non-trading day?

If you take as working something that in principle cannot work, then it makes no difference whether it works on a trading day or on a weekend))

 
Алексей Тарабанов:

Well, you men are a giver.

Some men and some give))

 
Alexandr Gavrilin:

The idea could certainly help, I would like to know about market closures without too many mistakes. We need to think about it.

It's a battle for one error, with dozens of mistakes a day in copying.

 

Why exactly -3? Because in one place it just so happens to be a coincidence? Yes?

 
Dmitry Fedoseev:

Why exactly -3? Because in one place it just so happens to be a coincidence? Yes?

If I remember correctly, forex symbols are quoted exactly until midnight from Friday to Saturday GMT+3 in summer (+2 in winter).

 
Alexandr Gavrilin:

OK, I'll ask a silly question.

How do I know that it's Saturday on the broker's server? Not Friday or Sunday, but Saturday. I try to use all available instruments and different crutches like "let's buy the time and compare it later" - time doesn't tick when it is Saturday on the broker's server. However, on Sunday the market may open earlier and no trading session settings at the broker will help you determine this because the time is not ticking.


If you have a sensible solution it will be interesting.

Broker time may not always coincide with gmt time :-)

You are thinking too narrowly now, not everyone has gold to be tied to his time and know the gmt for example as you suggested. You need a more universal solution.

If you need to know when - then take anything from TimeLocal().

If you need to know that the market is closed, then ---

if(IsTradeAllowed(Symbol(),TimeCurrent()+10)==false)Print("Рынок закрыт!");

You may use both of them in OnTimer().

---

Exactly Saturday won't help you because, for example, ruble is not traded at night, but bitcoin is still traded today.

So instead of Symbol(), substitute the pair being traded, in the case of multicurrency.

Do not try to calculate the start/finish of trading, it is useless

Do not try to calculate start/finish time for trading, it is useless because sometimes there are temporary changes in trading schedule and it works differently in different brokerage companies.

----

Although...

As you wish:

TimeDayOfWeek(TimeLocal())==6 is Saturday

;)

 
Renat Akhtyamov:

If you need to know when - take anything from TimeLocal().

If you need to know if the market is closed, then:

if(IsTradeAllowed(Symbol(),TimeCurrent()+10)==false)Print("Рынок закрыт!");

Put both in OnTimer().

---

Exactly Saturday will not help you, because, for example, ruble is not traded at night, but bitcoin is traded today.

So instead of Symbol(), substitute the pair being traded, in the case of multicurrency.

Do not try to calculate the start/finish of trading, it is useless

There are temporary changes in trading schedules and this is not the way it is set up in your brokerage company.

----

Although...

As you wish:

TimeDayOfWeek(TimeLocal())==6 is Saturday

;)

TimeDayOfWeek(TimeLocal())==6 is Saturday.

Yep, and also Friday at the broker ... and that's it.

All these solutions are not suitable for copywriters , arbitrageurs.

 
Alexandr Gavrilin:

you should check the function on Saturday and on Sunday. It will not fail on weekdays.

Have you checked?

 
fxsaber:

Did you check?

I forgot to check.