Discussing the article: "OpenAI's ChatGPT features within the framework of MQL4 and MQL5 development"
Check out the new article: OpenAI's ChatGPT features within the framework of MQL4 and MQL5 development.
Author: Evgeniy Ilin
Thank you very much Evgeniy Ilin
This article perfectly outlines how to effectively use the AI technology in programming while also pointing out what to avoid.
"apply a technology for its intended purpose reduces both the cost of any development and labor costs"
This is also my objective
Certainly! Here's an example of a MetaTrader 5 Expert Advisor (EA) based on Bollinger Bands. This EA buys when the price crosses below the lower Bollinger Band and sells when the price crosses above the upper Bollinger Band:
//+------------------------------------------------------------------+ //| BBExpertAdvisor.mq5 | //| Generated by Bing AI | //+------------------------------------------------------------------+ #property copyright "Your Name" #property version "1.00" #property script_show_inputs // Bollinger Bands settings input int bbPeriod = 20; input double bbDeviation = 2.0; input double lotSize = 0.1; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { Print("BBExpertAdvisor initialized."); return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { // Declare variables for Bollinger Bands double upperBB, middleBB, lowerBB; // Calculate Bollinger Bands if (iBands(_Symbol, _Period, bbPeriod, bbDeviation, 0, 0, upperBB, middleBB, lowerBB) > 0) { // Get the current price double currentPrice = SymbolInfoDouble(_Symbol, SYMBOL_BID); // Buy condition: If the price crosses below the lower Bollinger Band if (currentPrice < lowerBB) { // Check if there are no open orders if (OrdersHistoryTotal() == 0 && OrdersTotal() == 0) { // Open a buy order OrderSend(_Symbol, OP_BUY, lotSize, currentPrice, 3, 0, 0, "Buy Order", 0, 0, Green); } } // Sell condition: If the price crosses above the upper Bollinger Band if (currentPrice > upperBB) { // Check if there are no open orders if (OrdersHistoryTotal() == 0 && OrdersTotal() == 0) { // Open a sell order OrderSend(_Symbol, OP_SELL, lotSize, currentPrice, 3, 0, 0, "Sell Order", 0, 0, Red); } } } } //+------------------------------------------------------------------+
Block thinking which you mentioned is a most important part to make Chat Generative Pre-Trained Transformers work for you
Create a template, break logics in parts, and ask GPT to write e.g. "Write function void findSMA(int index) {} to find sma value" which may be more useful instead asking something like "Build a MA Crossover EA for me with bollinger bands"Block thinking which you mentioned is a most important part to make Chat Generative Pre-Trained Transformers work for you
Create a template, break logics in parts, and ask GPT to write e.g. "Write function void findSMA(int index) {} to find sma value" which may be more useful instead asking something like "Build a MA Crossover EA for me with bollinger bands"Everything is correct. You just need experience working with such models and understanding how they can help in creating code. From the very beginning of using the model, I wasn't even interested in what prompts could be there, I just wrote "do this or that" and eventually understood how to work with this tool. It's a tool that speeds up development by leaps and bounds. It has its drawbacks, but it only seems so at first, while you're thinking in a style like "write me a grail in 2 lines". To this day, I use it and it already seems like I won't be able to do without it. The effect was like with google back in the day..

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Check out the new article: OpenAI's ChatGPT features within the framework of MQL4 and MQL5 development.
In this article, we will fiddle around ChatGPT from OpenAI in order to understand its capabilities in terms of reducing the time and labor intensity of developing Expert Advisors, indicators and scripts. I will quickly navigate you through this technology and try to show you how to use it correctly for programming in MQL4 and MQL5.
I think that when people learn about this kind of technology, they all start to fall into roughly three subgroups:
I began to get acquainted with this technology a long time ago and at the beginning I belonged to the third category. In the first two days of dealing with this AI, I abruptly moved from the third to the first category, after which a more interesting and rather unpleasant process of adjusting my own beliefs began, which is more like a rollback to the "1.5" category, which is already a more realistic assessment of this technology.
This technology is useful, but not as much as you might initially think. In this regard, it is worth paying tribute to the developers and marketers of this technology, if only for the fact that it creates an incredible "wow" effect from use in the first couple of days, which is enough for a chain reaction of self-promotion.
Author: Evgeniy Ilin