I have created a custom symbol using CustomSymbolCreate(). The sole purpose of this symbol is to create a chart that will be used for displaying data, so I am not interested in any tick data.
When I run my EA, I switch to the new symbol using...
ChartSetSymbolPeriod(0, "MySymbol", PERIOD_M1);
My custom chart is then reloaded, but none of the information that I want to display on the chart is displayed.
I figured the problem may be caused by a lack of data, so as a test I added the following code to a timer event in my EA (just to generate some data)...
I put a break point in the OnTick() function, but the break point was never hit. I ran the EA multiple times over a period of time (15-20 minutes), but with the same result. I then stopped and restarted MT5 and tried again, but still no luck. I then checked the MT5\Bases\Custom\ticks folder but could not see a folder for my custom symbol. I restarted MT5 3-4 more times and eventually the break point in the OnTick() function was hit and the chart displayed the contents as expected. I then checked the
MT5\Bases\Custom\ticks folder again, and this time a folder for my custom symbol was present.
So my code is now doing what I expect, but I would like to get a better understanding of the sequence of events that led to it working.
So if I was to delete everything and start again, can anyone enlighten me with regards to the minimum steps that I need to take to ensure the successful creation of a chart that gets updated correctly?
Currently my observations, which are not correct, are...
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I have created a custom symbol using CustomSymbolCreate(). The sole purpose of this symbol is to create a chart that will be used for displaying data, so I am not interested in any tick data.
When I run my EA, I switch to the new symbol using...
My custom chart is then reloaded, but none of the information that I want to display on the chart is displayed.
I figured the problem may be caused by a lack of data, so as a test I added the following code to a timer event in my EA (just to generate some data)...
I put a break point in the OnTick() function, but the break point was never hit. I ran the EA multiple times over a period of time (15-20 minutes), but with the same result. I then stopped and restarted MT5 and tried again, but still no luck. I then checked the MT5\Bases\Custom\ticks folder but could not see a folder for my custom symbol. I restarted MT5 3-4 more times and eventually the break point in the OnTick() function was hit and the chart displayed the contents as expected. I then checked the
MT5\Bases\Custom\ticks folder again, and this time a folder for my custom symbol was present.
So my code is now doing what I expect, but I would like to get a better understanding of the sequence of events that led to it working.
So if I was to delete everything and start again, can anyone enlighten me with regards to the minimum steps that I need to take to ensure the successful creation of a chart that gets updated correctly?
Currently my observations, which are not correct, are...