Discussing the article: "Automating Trading Strategies in MQL5 (Part 24): London Session Breakout System with Risk Management and Trailing Stops" - page 2

 
Where in the code did you intent to use the variable "MaxOpenTrades"? It's defined but never referenced.
 
Allan Munene Mutiiria #:

As for your second issue, the article explains that, but assuming that your issue emanates from poor testing data and giving a hint, when the range is in calculation, you will always see "Calculating..." status until there is enough data to set the London range session or whichever session you define in the inputs. Assuming you are using the default settings, with prelondon hours being 3, and your time from the shared screenshot is 13, Feb, 2 bars after 22:00 which is 2*15 minutes = 30, hence giving 22:30, is outside the range calculation time, so the data on the panel should be  visible still since the previous set range is still in play unless the first session has not yet been found, and will be cleared as the range calculation is reached from midnight. See below:

You might need to see the logic below for finding the range

And how it is set.

See the image below, though we don't know the year of your testing, we will take the 2025, if it is 2020 as in your case, we don't have quality data for that so either way, we use 2025 and thus range calculation should start at midnight.


From the image, you can see the data at 23:55 is stil intact. However, when it is midnight, we shpuld reset. See below.

You can see that we reset the data at midnight for the other range calculation. Actaully, when the range calculation is done, the visualization can help you know what really went on. For example, in your case using the default settings, we will see the raneg bars from 0300 hrs to 0800 hrs because that is what we defined. See below:

Hope this clarifies things again. You can adjust everything as per your trading style. To avoid the issues you are facing, it is advisable to use reliable testing data. Thanks.

Thanks very much for the comprehensive reply.

Yes, I did read the article, followed along coding my own copy until I ran into the issues I outlined. What I saw was the panel didn't update, even during the default times. My screenshot was meant to show that, even though the box had been drawn on the chart, the data was collected, but the panel had not been updated. Additionally, there was no error messages in logs regarding invalid prices or levels.

I added logging messages to my version; from that I can see that the panel doesn't update when the range is too big or too small; so that may be part of the reason. 

I will double-check the testing data quality. And thank you for pointing out which pair you tested on; I will certainly make adjustments for my chosen pairs.

Many thanks for your help.

 
Kyle Young Sangster #:

Thanks very much for the comprehensive reply.

Yes, I did read the article, followed along coding my own copy until I ran into the issues I outlined. What I saw was the panel didn't update, even during the default times. My screenshot was meant to show that, even though the box had been drawn on the chart, the data was collected, but the panel had not been updated. Additionally, there was no error messages in logs regarding invalid prices or levels.

I added logging messages to my version; from that I can see that the panel doesn't update when the range is too big or too small; so that may be part of the reason. 

I will double-check the testing data quality. And thank you for pointing out which pair you tested on; I will certainly make adjustments for my chosen pairs.

Many thanks for your help.

Sure. Welcome.