Custom Symbols Trading Times

 

Hi


I'm creating a custom symbol from BTCUSD.

In the custom symbol, it doesn't trade on day 2017.12.30 (It says markets are closed), whereas in the original BTCUSD symbol, it does trade on this day.


I don't understand how the custom symbol can me more restrictive regarding trading times if I copy all the datas from BTCUSD to the custom one ?


Am I missing something ?


thanks


JEff

 
Jean Francois Le Bas:

Hi


I'm creating a custom symbol from BTCUSD.

In the custom symbol, it doesn't trade on day 2017.12.30 (It says markets are closed), whereas in the original BTCUSD symbol, it does trade on this day.


I don't understand how the custom symbol can me more restrictive regarding trading times if I copy all the datas from BTCUSD to the custom one ?

Who knows what you did except you ?


Am I missing something ?

Obviously yes :-D
 
Alain Verleyen:
Who knows what you did except you ?
Obviously yes :-D

haha

yeah it's tricky to put any code (I know that's what you want) because of the length

bu I realized I didn't copy the Session times

but it would be nice to have a sample using "CustomSymbolSetSessionTrade" and "SymbolInfoSessionTrade"

because it's not very clear in the docs, specially Index of the session and I could not find ONE code online using those functions

thanks

Jeff

Documentation on MQL5: Market Info / SymbolInfoSessionTrade
Documentation on MQL5: Market Info / SymbolInfoSessionTrade
  • www.mql5.com
SymbolInfoSessionTrade - Market Info - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

ok so I copied Session Trades and Quotes and it didn't change anything.

SO I reiterate my question (if someone has an idea)

Why, when I trade on BTCUSD, I can trade on the 2017.12.30, but on the newly created Custom Symbol (based on  BTC), it says "market closed" on that day when I try to open a sell order ?

it resumes on the Secondth of January.

is there something obvious i'm missing ? Or is there no solution ?

2021.04.13 14:55:09.633 Core 1  2017.12.29 14:01:21   order performed sell 2.81 at 14336.03 [#1773 sell 2.81 BTCUSD_Ask_BTC Profit 01j bs10 at 14336.03]
2021.04.13 14:55:09.633 Core 1  2017.12.29 14:01:21   CTrade::OrderSend: market sell 2.81 position #1772 BTCUSD_Ask_BTC Profit 01j bs10 [done at 14336.03]

2021.04.13 14:55:09.633 Core 1  2017.12.30 02:31:14   failed market sell 3.08 BTCUSD_Bid_BTC Profit 01j bs10 [Market closed]
2021.04.13 14:55:09.633 Core 1  2017.12.30 02:31:14   CTrade::OrderSend: market sell 3.08 BTCUSD_Bid_BTC Profit 01j bs10 [market closed]
2021.04.13 14:55:09.633 Core 1  2017.12.30 06:50:08   failed market sell 2.04 BTCUSD_Bid_BTC Profit 01j bs10 [Market closed]
2021.04.13 14:55:09.633 Core 1  2017.12.30 06:50:08   CTrade::OrderSend: market sell 2.04 BTCUSD_Bid_BTC Profit 01j bs10 [market closed]
2021.04.13 14:55:09.633 Core 1  2017.12.30 14:40:14   failed market sell 1.61 BTCUSD_Bid_BTC Profit 01j bs10 [Market closed]
2021.04.13 14:55:09.633 Core 1  2017.12.30 14:40:14   CTrade::OrderSend: market sell 1.61 BTCUSD_Bid_BTC Profit 01j bs10 [market closed]
2021.04.13 14:55:09.633 Core 1  2017.12.30 18:37:07   failed market sell 1.65 BTCUSD_Bid_BTC Profit 01j bs10 [Market closed]
2021.04.13 14:55:09.633 Core 1  2017.12.30 18:37:07   CTrade::OrderSend: market sell 1.65 BTCUSD_Bid_BTC Profit 01j bs10 [market closed]

2021.04.13 14:55:09.633 Core 1  2018.01.02 15:06:17   TradingConditionsOK true
2021.04.13 14:55:09.633 Core 1  2018.01.02 15:06:17   market buy 4.2 BTCUSD_Ask_BTC Profit 01j bs10 (13684.92 / 13684.94 / 13684.92)
2021.04.13 14:55:09.633 Core 1  2018.01.02 15:06:17   deal #1774 buy 4.2 BTCUSD_Ask_BTC Profit 01j bs10 at 13684.94 done (based on order #1774)

please help

i'm ready to do what's needed to find out the answer
 

What broker is your BTCUSD symbol ?

Please post a json file with the custom symbol specifications.
 
Alain Verleyen:

What broker is your BTCUSD symbol ?

Please post a json file with the custom symbol specifications.

broker is IC Markets

here is the json


thanks so much for helping me

 

ok so I figured out that MT5 thinks it's the week-end, thus it doesn't allow trading.

But on BTCUSD one can trade the week-end right ? (sorry if this is a dumb question)

On one of my custom symbols, it does the same thing (saying Markets are closed on the 2018.01.06 and  2018.01.07) so I gotta find out why


EDIT : ok it works now. I wasn't assigning the Trading and Quotes hours from the right txt file

by the way, the way I do it is first running an Expert Advisor that creates a TXT file with the trading hours like that :


then I import the TXT file from the script that copies the trading hours to the custom Symbol

it would be so much easier to be able to transfer everything from the EA, rather than limiting it to scripts only.

This applies for creating custom symbols as well, we have to write data to a txt file, then import it

this is not very easy and straightforward. Just my 2 cents. And my error wouldn't have existed in the first place

This is the problem, it creates unnecessary potential mistakes that could be avoided.


Jeff

Reason: