MetaEditor, Open AI and ChatGPT - page 4

 

Currently ChatGPT is useless for mql5 coding. It's mixing mql4 and mql5.

How to calculate a tick value ?

The tick value of a market is the smallest price increment it can move by. To calculate this value, you can use the function MarketInfo() in the MQL5 language.
For example, the syntax for calculating the tick value of the EURUSD pair is:
double tick_value = MarketInfo(Symbol(), MODE_TICKVALUE);

Wrong answer. There is no MarketInfo() in mql5.

It's interesting if you want a wrong answer directly from MetaEditor though, no need to google it.

 
Alain Verleyen #:

Currently ChatGPT is useless for mql5 coding. It's mixing mql4 and mql5.

Wrong answer. There is no MarketInfo() in mql5.

It's interesting if you want a wrong answer directly from MetaEditor though, no need to google it.

Was it v3.5 or v4? I got this answer from v4 (ChatGPT May 12 Version) today:

-- GTP START --

In MQL5, you can use the SymbolInfoDouble() function to retrieve various symbol properties, including the value of a tick. This function has two parameters: the symbol name and the property identifier.

Here's how you can use it to get the tick value:

double tick_value;
if(SymbolInfoDouble(Symbol(), SYMBOL_TRADE_TICK_VALUE, tick_value))
{
    Print("The tick value for ", Symbol(), " is ", tick_value);
}
else
{
    Print("Failed to get the tick value. Error code: ", GetLastError());
}

In this example, Symbol() is used to get the name of the current symbol. The SYMBOL_TRADE_TICK_VALUE constant is used to specify that we want the tick value. The tick_value variable is passed by reference and will contain the tick value if the function call is successful.

If SymbolInfoDouble() returns true, the tick value is printed. If it returns false, an error message is printed, including the error code that can be obtained by calling GetLastError() .

-- GTP END --

I have made some experiments and seems that v4 is pretty decent in MQL4/MQL5, both in writing ready to use functions (I have even managed to get an indicator animating button object on chart) or commenting and explaining existing code. Copilot is worthless IMO at the moment, but Copilot X based on GPT-4 may be interesting.

ChatGPT — Release Notes | OpenAI Help Center
ChatGPT — Release Notes | OpenAI Help Center
  • help.openai.com
If you are a ChatGPT Plus user, enjoy early access to experimental new features, which may change during development. We’ll be making these features accessible via a new beta panel in your settings, which is rolling out to all Plus users over the course of the next week. You can now turn off chat history and export your data from the ChatGPT...
 
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.  

Agreed. I've actually been able to get it to create working Pinescript strategies without a lot of correction. But it's terrible at MQL from scratch. Can't even generate a working expert without a lot of corrections.

I have, however, been able to have it do minor modifications pretty well. For example, I asked it to take an existing EA and add a filter for trading hours, with an input for each hour (i.e., not a range), and it did it pretty well—a compiler error on its first response, but then I input the compiler errors and the second response was correct.

 
Carl Schreiber #:

Hmm, I tried but after signing in I seem to be "stuck in traffic": my page is and remains empty and nothing moves.

This is what I wanted to ask:

A question that almost everyone faces.

Maybe someone else 'on a free way to ChatGPT' can ask and post the result?

What does the almost criminal boss say to his subordinates: Surprise me ;)

I've done this. Here was my prompt:

Based on the following data, what can you tell me about the impact of Signal_ThresholdOpen and Signal_ThresholdClose on Recovery Factor?

[data]

Its first reply:

Based on the data provided, there appears to be no significant impact of the Signal_ThresholdOpen and Signal_ThresholdClose values on the Recovery Factor. The Recovery Factor remains constant at 2.93775 across all combinations of Signal_ThresholdOpen and Signal_ThresholdClose values.

It's important to note that other metrics such as Profit, Expected Payoff, Profit Factor, Sharpe Ratio, Custom, Equity DD %, and Trades also remain constant across all the different combinations. This could indicate that these specific values of Signal_ThresholdOpen and Signal_ThresholdClose may not have a significant impact on the performance of the strategy or that the data provided does not capture the full scope of their influence.

This was inaccurate, which I pointed out:

How many lines of data did you review? Because I see recovery factor values of 0.23459 and even 0

Its reply:

I apologize for the confusion. I must have made an error in my analysis. Upon reviewing the data, I can see there are multiple Recovery Factor values, as you mentioned. Please allow me to correct my previous response.

It appears that I made a mistake while analyzing the data. After reviewing the dataset, I found that there were a total of 99 lines of data provided. As you pointed out, there are Recovery Factor values of 0.23459 and even 0. This indicates that there is a wide range of Recovery Factors in the dataset, which could be due to variations in the Signal_ThresholdOpen and Signal_ThresholdClose values. It's essential to carefully analyze these parameters to understand their impact on the Recovery Factor.

So I tried being more specific:

Is there a correlation between signal threshold open or close and recovery factor, within a particular range?

ChatGPT:

I'm sorry for any confusion, but as an AI language model, I don't have the ability to perform actual data analysis or calculations on a dataset, as I don't have direct access to external databases or the ability to process data in real-time.

However, I can explain how you might investigate this yourself.

To determine if there's a correlation between the signal threshold (open or close) and the recovery factor, you would typically use a statistical method such as Pearson's correlation coefficient. This will give you a measure of the strength and direction of association that exists between two continuous variables.

Here's a simple example of how you might do this in Python using the pandas and scipy libraries:

[Python code]

So no, no real data analysis.
 

Forum on trading, automated trading systems and testing trading strategies

MetaTrader 5 platform beta build 3770: Book or Cancel orders, AI coding assistant, and enhanced ONNX support

MetaQuotes, 2023.05.25 16:11

The beta version of the updated MetaTrader 5 platform will be released on Friday, May 26, 2023.

...

22. MetaEditor: Added integration with the advanced automatic coding assistant Copilot. Its operation is based on OpenAI models. Enter a comment or part of a function and send a prompt. The neural network will analyze the prompt and will offer coding options to implement the idea.


Copilot coding assistant


Depending on the file type, the string "MQL5 language", "Python language" or "C++ language" is automatically inserted at each prompt beginning. Thus, the neural network will provide the result in the required language.

Copilot is currently free and is already enabled in the editor. There are several options available under Tools \ Options \ Copilot:


Copilot settings


Payment settings:

  • Use your MQL5 account: this option is currently available for free. Later, you will be able to pay for the subscription directly from your MQL5 account balance.
  • Use an OpenAI key, if you have purchased a subscription and have the relevant key.

Prompt settings:

  • Model — a neural network which will process your requests. text-davinci-003 and gpt-3.5-turbo are currently available. Support for gpt-4 will be added soon.
  • Maximum tokens — the number of text units which the model can return in response to a prompt.
  • Variability — affects how strictly the neural network will follow the prompt. The smaller the value, the greater the result randomness. This option corresponds to the temperature parameter in OpenAI models.

...

 
 

OpenAI's ChatGPT features within the framework of MQL4 and MQL5 development

OpenAI's ChatGPT features within the framework of MQL4 and MQL5 development

I think that when people learn about this kind of technology, they all start to fall into roughly three subgroups:

  1. "Now we will make a super algorithm"
  2. Those who are wary of AI and questioning its usefulness
  3. Machine cannot be better than a human. It's all just another hype
OpenAI's ChatGPT features within the framework of MQL4 and MQL5 development
OpenAI's ChatGPT features within the framework of MQL4 and MQL5 development
  • www.mql5.com
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.
 

Forum on trading, automated trading systems and testing trading strategies

Machine learning in trading: theory, models, practice and algorithmic trading

Renat Fatkhullin , 2023.09.10 10:44

We plan to launch another championship aimed at promoting neural networks:
1) we will provide a single MQL5 robot template with downloadable model.onnx
2) within 5 months participants will upload their modules as model.onnx
3) daily they will be automatically run on history from 2023.01.01 to the current day at 4 main exchange rates
4) the daily rating of participants will be published
5) at the end of the preliminary period of accumulation of participants within 5 months, the real trading period will begin within 1 month
6) based on the results of work within 1 month, the winners will be determined
7) the prize fund from our company 30,000 dollars will be divided into three winners as 15,000, 10,000 and 5,000 dollars
8) we guarantee that at the end of the championship all model files will be deleted to preserve the intellectual property of the developers

The purpose of the championship is solely to stimulate the development of machine learning in trading. Programs only in the form of a single unchangeable MQL5 template + model.onnx

Some more information:

Forum on trading, automated trading systems and testing trading strategies

Machine learning in trading: theory, models, practice and algorithmic trading

Renat Fatkhullin , 2023.09.13 19:17

The testing system will consist of three components:
1) our single robot template
2) your model.mq5 wrapper in the source code to provide data input/output into the ONNX model, interpretation of results and generation of transactions
3) model.onnx - your neuro model

 

I am currently using VS Code with Genie extension and gpt4 api (temperature 0.3). My observations:

  1. makes frequent errors if it has to use native MQL functions - a waste of time
  2. comes in handy if we need a more generic function, e.g. CRC32 generation etc., can write them flawlessly from the first approach based on C++
  3. can translate the code and add meaningful comments

Copilot still sucks.

 

The problem with AI is that people believe it will solve problems they themselves cannot solve. AI is not an intelligence in itself; it is an automation tool that learns what it is taught.

To use AI effectively, we must teach it to solve a problem in order to harness its capabilities and enhance its processes. AI will not create a magical solution unless someone has previously taught it to do so.

Reason: