Deepseek is being pretty radical and suggestions calculating 'my own' Bollinger bands with possible fault on MT platform. Seems a little like desperation.
The implementation is MetaQuotes (i.e. not even broker with out of date platform). Under the help it states the system is up to date. Details MetaTrader 5 Versions 5.00 build 5200 1st Aug 2025. I have closed and re-open to 'eliminate' local issues.
Just running on EURUSD M1 chart and have same sort of problem(different pair and timeframe)
Please, don't request help for ChatGPT (or other A.I.) generated code. It generates horrible invalid code, often mixing MQL4 and MQL5.
Also,if you don't put in the effort to learn the language properly, then you will not be able to understand any help or advice given to you.
Usually, topics on AI generated code will be removed. So, if you truely want help with your code, please learn to code it yourself without using AI at all.
If not, then you can consider using the Freelance section for such requests.
Sort of accept part of what you say. However I regard myself as reasonably competent with (originally MT4) and now MT5 code (many years) and was looking for HELP. When I have used AI I use it carefully and am specific - often to take the 'grunt' out of repetitive code.[I had my own written code working with 3 indicators - MA20, MA99 & TSI and requested ChatGPT add the extra code for the extra indicators - which was done in seconds]
On this occasion I was 'baffled' by the BB results and figured I might have something that looked obvious to fix.
If you see something obviously wrong with the code that might lead to the problems I am having then I'd appreciate your response.
Thanks for your words of caution.
Biggest problem I have seen with AI is it perhaps, makes one suggestion, I make the change, still get problem then the next suggestion is back to the original - i.e. the proverbial wild goose chase or going round in circles.
Sort of accept part of what you say. However I regard myself as reasonably competent with (originally MT4) and now MT5 code (many years) and was looking for HELP. When I have used AI I use it carefully and am specific - often to take the 'grunt' out of repetitive code.[I had my own written code working with 3 indicators - MA20, MA99 & TSI and requested ChatGPT add the extra code for the extra indicators - which was done in seconds]
On this occasion I was 'baffled' by the BB results and figured I might have something that looked obvious to fix.
If you see something obviously wrong with the code that might lead to the problems I am having then I'd appreciate your response.
Thanks for your words of caution.
Biggest problem I have seen with AI is it perhaps, makes one suggestion, I make the change, still get problem then the next suggestion is back to the original - i.e. the proverbial wild goose chase or going round in circles.
I repeat, if you rely on AI, you will not develop your coding skills properly, and you will definitely not develop your deductive and logic skills nor an ability to debug your own code.
So, please take my advice and stop using AI completely. Use the reference documentation and look at CodeBase examples if necessary, but not AI.
Yes, it will take longer and be "frustrating", but in the long run, you will learn more and be a much more skilled coder.
As for your code, it is very unstructured, you are not checking for valid indicator handles, and you are not checking if CopyBuffer actually copies any data and if it is valid. There are just too many points of failure. You are also copying indicator buffers on every single tick, which is highly inefficient and a drain on computer resources.
There is just too much unstructured complexity for someone still trying to learn MQL5 properly. Start with a smaller task, with only a single indicator and less complexity, so that you can get things working properly. Then slowly build on it in a structure way, otherwise you will just end up with a "stringy" and "kiddy script" EA.
And one more note, when supplying code for advice or help here in the forum, make sure it is self-contained and it compiles without errors (and warnings), so that users may run and test it if they wish.
If users are not able to run and check it, then they will be less willing to read the code line by line, trying to figure out the logic, and where the possible problem may be.
In other words, if you need the help, make it easier for them to be able to help you.
I obviously respect your role in the forum and have received advice from in you in the past which I appreciate and value.
On this occasion I think you are being a little harsh.
1. The code was developed quickly for a one off job (as stated) - i.e. runs once until the interval changes then seeks to output data for use in Python. When the task is performed ONCE then it removes the EA using the
ExpertRemove()
command. Maybe run once a week to provide new training data for python. So hardly over inefficient. [You state:- "You are also copying indicator buffers on every single tick, which is highly inefficient and a drain on computer resources". JUST NOT TRUE is my understanding]
2. The code has compiled on my system and ran as shown with LOG. I do accept the code would not run elsewhere because I use a routine of my own - as in the INCLUDE statement - for my own error log (ReportString......). This is my routine practice - i.e. all my EA work includes the same routine. The only difference here is I included the full EA because it was quite short.
3. Again I repeat as stated elsewhere I started my EA with 3 indicators and it worked fine (i.e. the logic and code worked fine). I requested AI to add the code for the additional indicators - i.e. a bit of heavy lifting. I was not requesting a change of approach or logic. Again the code works fine except for the Bollinger Bands code. The initial 3 indicators just had single buffers but the MACD & BB have 2 & 3 respectively. The MACD appears fine just a problem with the BB
4. I requested HELP - thinking a fresh pair of eyes my see something different
Without trying to be controversial I would deduce that you do NOT use AI and perhaps judging someone else, who has recently found it a useful addition is a little harsh. AI is a tool, which can be useful, but no substitute [I agree] for generating one's own base code / logic
[I have been coding, in perhaps 20+ languages, over close on 60 years from user & machine code, Algol, Cobol, Fortran , Basic ..... etc more recently used VB Excel extensively. Never claimed to be an expert but managed to get by. I have managed to develop 10,000s line of MT code and working solutions. In honesty I suspect age dims the logic a little or more accurately the time to get it correct but I am still here and enjoy 'coding'. Once retired there is little feedback other than reading material , forums etc - so again a fresh pair of eyes can be of help].
Still appreciate any help from anyone can see an obvious mistake
I have written an EA to product training data for a Python forecasting model. Most seems OK but the output from the Bollinger Bands is the same for HI, MID & LO. The folloing is the Terminal LOG
The EA code is as follows (all code maybe an overkill but I suspect something simple is missing). I have used ChatGBT & Deepseek for suggestions.
Any ideas appreciated
As far as the iBands code goes, it looks correct. I'm not sure why you're seeing identical buffers. You could try the MT5 BB from Indicator/Examples, like below, see how it works.
//handle_BB = iBands(_Symbol, PERIOD_M5, 20, 2.0, 0, PRICE_CLOSE); handle_BB = iCustom(_Symbol, PERIOD_M5, "Examples/BB.ex5");
Yes, after reviewing your code again, I do now see that it only runs once. However, if you only expect it to run once, why then have an illogical time-based condition in the first place?
I am actually being very soft about it in this case. But, if it helps you understand why it actually will help you in the long run if I am harsh, then I suggest reading up on the "Dunning-Kruger Effect".
I do not and will not use AI for coding, in any shape or form. I have experimented with AI in other areas, but I will not use it for the "human" aspects, such Art, Writing, Music, or any other area at which we humans excel, and have no need for AI. (A.I. should not be used to replace our "creative" aspects).
A.I. is only able to offer "code" solutions, because they were trained on code produced by humans. If humans stop producing code altogether, A.I.s will no longer have data from which to "learn", and they will stop producing anything new and creative. Think about that for a while!
Wow - just used the above statement and it works. Wonderful and thankyou. This is single line output from terminal window
2025.08.04 21:13:00.275 Create_Training_DataV2_For_LSTM_v2 (XAUUSD,M1) 500050 GetI BB[2] Mid=3375.98000, Upper=3377.09136, Lower=3374.86864
I have added the indicator to the chart and there appear to be slight differences from the chart and the Terminal log - I'll take a look at possible causes
The indicator plot on the chart is identical for both indicators ( I used a solid line and a dotted line to illustrate)
Delighted I now have working solution.
Seriously - thanks for your input - even if we don't quite agree
[PS I remember trying to convince accountants that using computers was a major step forward rather than sharp pencils and reams of paper - i.e. a tool to help. There was a lot of resistance in the 1970's even with the introduction of mini computers - which were huge!]

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have written an EA to product training data for a Python forecasting model. Most seems OK but the output from the Bollinger Bands is the same for HI, MID & LO. The folloing is the Terminal LOG
The EA code is as follows (all code maybe an overkill but I suspect something simple is missing). I have used ChatGBT & Deepseek for suggestions.
Any ideas appreciated