I think it might be confusing what I'm looking for,
During the execution of the tester and the expert provides some values I would like to get these values from outside the tester and then use them, my intention is to use them in the optimization example before starting the execution of each frame of the optimization a variable has to start with different values every frame and is this possible?
- [WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you.
- [ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5.
- Errors, bugs, questions
Lip Ramos:
I think it might be confusing what I'm looking for,
I think it might be confusing what I'm looking for,
During the execution of the tester and the expert provides some values I would like to get these values from outside the tester and then use them, my intention is to use them in the optimization example before starting the execution of each frame of the optimization a variable has to start with different values every frame and is this possible?
Are you looking for a way to bridge the values from MT5 Tester to a separate optimization, not necessarily within the same EA code?
Oleksandr Medviediev #:
"Thank you for responding, I am looking for a way to capture within the same code example: at the end of the period during which the robot is running, I wanted to somehow record a value and in a new test use that value and so on. I tried using the external global variable in the terminal but it didn't update, I tried writing to a txt file and it also didn't work."
Are you looking for a way to bridge the values from MT5 Tester to a separate optimization, not necessarily within the same EA code?
Within the same code try this:
- Declare a custom variable to store the value to capture.
- At the end of the EA/tester execution, update the value of this custom variable with the desired value.
- In the next test/execution access the value of this custom variable and use it as needed.
Example:
// Declare a custom variable to store the value double captured_value = 0.0; // EA/Tester code void OnTick() { // Perform trading logic, calculations, etc. // At the end of the execution, update the captured_value captured_value = someValueCalculatedDuringExecution; } // In the next test/execution void OnInit() { // Access the previously captured value and use it double previous_value = captured_value; // Use previous_value in your logic }
Just curious, what's your strategy and what are you aiming to achieve.
Alexandre Medviediev # :
Só por curiosidade, qual é a sua estratégia e o que você pretende alcançar.
“Upon further consideration, I think my idea is irrelevant because I was wanting to use it in the optimization of the tester, foregoing the use of input selection to optimize parameters and modify the initial values of variables within the code during optimizations."
Dentro do mesmo código tente isto:
- Declare uma variável personalizada para armazenar ou valor a ser capturado.
- Ao final da execução do EA/testador, atualize o valor desta variável personalizada com o valor desejado.
- No próximo teste/execução acesse o valor desta variável customizada e utilize-a conforme necessário.
Exemplo:
Só por curiosidade, qual é a sua estratégia e o que você pretende alcançar.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register