MetaEditor, Open AI and ChatGPT

 

Forum on trading, automated trading systems and testing trading strategies

Test version of MQL5 Copilot in beta 3647

Renat Fatkhullin , 2023.03.23 23:11

In today's beta version 3647, we've included the first version of Copilot, a feature to enhance the editor's ability to write code.

The settings are here:

To activate it, you need to register on the site https://platform.openai.com/account/api-keys , get an API key and pay for the subscription. Since not everyone is given trial budgets (it looks like the holiday is over), you need to explicitly check the available balance on the page https://platform.openai.com/account/usage and provide credit card details.

To activate in the *.MQ5 file, you need to type the desired question and press Ctrl + Alt + \

 // Add OnTick function with new bar detection <Ctrl+Alt+\>

After a couple of seconds, you will get something like this:

 // Add OnTick function with new bar detection.
// This code will detect a new bar and execute myFunction() when it's detected.
//

void OnTick ()
{   
   // Get the time of the latest bar
   datetime lastBarTime = iBarShift ( NULL , 0 , 0 );
   
   // Get the time of the previous bar
   datetime previousBarTime = iBarShift ( NULL , 1 , 0 );
   
   // Check if the previous bar has already been checked
   if (lastBarTime != previousBarTime)
   {
       //Run myFunction()
      myFunction();
   }
}

void myFunction()
{
   // Your code here
   Print ( "New bar detected!" );
}

So far, this is a fairly simple version in terms of promting and not very easy to manage. We will continue to improve, automatically supplementing prompting (request methods to AI) with the features of the content under the cursor (functions, class, external scope, etc.).

Write about your comments and suggestions, please.


 

Tried it, 4 times in a row, I got 4 different results (one with all code commented, I edited nothing).


 
Even the most powerful programming AI (Google's AlphaCode) is considered to be an add-on for human developers in the future.

If we haven't yet been able to implement AI in simple things, wanting to implement it today for coding is like building a house through the roof.

Besides, let's be honest, Copilot is the poorest of all the candidates.

I can understand that MQ feels the need to join this new trend, but in my opinion they should put more emphasis on improving what they already have and the services they provide. AI today is not an improvement, it is an experiment.

I know MQ is embarking on as Renat said on maybe 30 projects and we only see 3. But maybe it would be better to be only on 5.
 
Miguel Angel Vico Alba #:
Even the most powerful programming AI (Google's AlphaCode) is considered to be an add-on for human developers in the future.

If we haven't yet been able to implement AI in simple things, wanting to implement it today for coding is like building a house through the roof.

Besides, let's be honest, Copilot is the poorest of all the candidates.

I can understand that MQ feels the need to join this new trend, but in my opinion they should put more emphasis on improving what they already have and the services they provide. AI today is not an improvement, it is an experiment.

I know MQ is embarking on as Renat said on maybe 30 projects and we only see 3. But maybe it would be better to be only on 5.
Unfortunately I don't think improving MetaEditor is one of the 30 projects. They should open it to Add-ons, this way we could improve it ourselves.
 
   datetime lastBarTime = iBarShift ( NULL , 0 , 0 );

   datetime previousBarTime = iBarShift ( NULL , 1 , 0 );
iBarShift does not return a time. And you are reading the current chart's timeframe with M1's
 
Alain Verleyen #Unfortunately I don't think improving MetaEditor is one of the 30 projects. They should open it to Add-ons, this way we could improve it ourselves.

Totally agree, ME and MT do not seem to be a priority, only the part of jumping on the bandwagon of the fashion of the moment.

An example of something very simple; That in the XXI century both the terminal and the editor do not have a dark mode seems unacceptable to me. And it is not just my opinion, in ALL forums there are comments of this type for several years. We are still waiting...

The priority should be to keep the vast majority happy, and the vast majority don't care about AI in the ME. Most users are retail traders who simply don't want to, for example, go blind in front of MT/ME.

My opinion, and I will say no more about this, I am outraged that they waste a single hour of work on this.

 
I'm professionally working with mql4/5 for a long time. I tried lots of things in ChatGpt for mql but almost all solutions were wrong! For other commonly used languages AI is great but for mql it is good for nothing! Sometimes you can get the ideas from AI nothing else.  
 
Mahadi Hasan Razu #:
I'm professionally working with mql4/5 for a long time. I tried lots of things in ChatGpt for mql but almost all solutions were wrong! For other commonly used languages AI is great but for mql it is good for nothing! Sometimes you can get the ideas from AI nothing else.  
Can you give an example where it's "great" with a "commonly used languages" ?
 
Alain Verleyen #:
Can you give an example where it's "great" with a "commonly used languages" ?

Python comes to mind

 
Jan4654 #:

Python comes to mind

Whatever, what I would like to see is an example where it's "great". Do you have one ?

 
Jan4654 #: Python comes to mind

Even it says do not use it for coding.*

Reason: