Machine learning in trading: theory, models, practice and algo-trading - page 2233

 
Aleksey Nikolayev:

For the real experts - phyton)

:D did not pay attention

my stomach hurts from laughing these days)
 
welimorn:
Hello all. Can you advise, guide, push in the right direction, on how to run .py file from mql5. Maybe someone has some kind of scriptulina or function. Let the long, let the communication through the file. I will be very grateful if you have any)

in the meta editor of mt5 in the folder include, there are examples for win api

I don't remember what exactly through what, something like process create or shell execute.

you can also use scripts

Работа с Python - Разработка программ - Справка по MetaEditor
Работа с Python - Разработка программ - Справка по MetaEditor
  • www.metatrader5.com
Для языка Python существует множество библиотек для машинного обучения, автоматизации процессов, анализа и визуализации данных. Все его возможности можно легко применять и в торговой платформе, благодаря модулю для интеграции с Python. Быстро и удобно получайте биржевую информацию из торговой платформы для последующего анализа средствами Python...
 
Maxim Dmitrievsky:

in the meta-editor of mt5 in the folder include there are examples for win api

I do not remember what exactly, something like process create or shell execute.

You can also use scripts, but i have not tried them.

Thank you! In the mql script we saw a loop that is waiting for an opportunity to open the file:

   while(1)
     {
      string time  = TimeToString(TimeCurrent());
      int h=FileOpen("TimeCurrent.txt",FILE_WRITE|FILE_ANSI|FILE_TXT|FILE_COMMON);
      if(h==INVALID_HANDLE)
        {
         Print("Файл занят другой программой!");
        }
      if(h!=INVALID_HANDLE)
        {
         FileWrite(h,time);
         FileClose(h);
         break;
        }
     }

And in python, we saw a loop with an exception that performs the same function.

while True:

    try:
        myfile = open(data_dir+'TimeCurrent.txt', 'r')
    except IOError:
        continue

    with myfile as f:
        rez = f.read()
        if rez != old_rez:
            print(rez)
        old_rez = rez

Everything works even in the tester.

 
welimorn:

Thank you! In the mql script we saw a loop that is waiting for an opportunity to open the file:

And in python, we saw a loop with an exception that performs the same function.

All works, even in the tester.

If you need to transfer information - python api allows you to get different things from the terminal and you can open trades

By the way, yes... for the Strategy Tester an interesting option is through a file, the main thing is not to kill the SSD)

 

I tried to train a neural network in R using the neuralnet library.

There are two questions:

  1. How to save/load the trained network?
  2. How can I evaluate influence of input neurons on network performance?(on page 5 of this thread there is a picture with similar evaluation of inputs, I don't understand how to display it).
 
Igor_Gagarin:

I tried to train a neural network in R using the neuralnet library.

There are two questions:

  1. How to save/load the trained network?
  2. How can I evaluate the influence of input neurons on network performance? (on page 5 of this thread there is a picture with similar evaluation of inputs, I don't understand how to display it).

1.

model.rds or write the path

saveRDS(model, "model.rds")      # сохранить
my_model <- readRDS("model.rds") # загрузить  
source


2.

If you mean how to evaluate the significance of the features, take a look at the NeuralNetTools package, where everything is clearly written in the examples.

 

Active learning in its pure form did not work. My idea turned out to be more robust. I discarded active learning for now. The idea is interesting, but it does not drag on the quotes. It seems to work with the pips.

I was poking around in this package.

modAL: A modular active learning framework for Python3 — modAL documentation
  • modal-python.readthedocs.io
Welcome to the documentation for modAL! modAL is an active learning framework for Python3, designed with modularity, flexibility and extensibility in mind. Built on top of scikit-learn, it allows you to rapidly create active learning workflows with nearly complete freedom. What is more, you can easily replace parts with your custom built...
 
Maxim Dmitrievsky:

If you need to transfer information - python api allows you to get different things from the terminal, and you can open trades

By the way, yes... for the tester it is interesting via a file, the main thing is not to kill the SSD)

I am aware of python. Here is the idea of running models in the tester. I made a few simple testers, they are ok, but now I need to run them in a tester for MT, to get my hopes up)))

 
welimorn:

I know about the pitot. There is an idea to run models in the tester. I've made a bunch of testers, they are ok, now I need to run them in a tester for MT to get my hopes up))).

any other models, not the busts? what's the problem with mql sparring?

 
Maxim Dmitrievsky:

some other models, not boosts? what is the difficulty in sparring in mql

I have a classifier on two-dimensional ultra-precise keras networks. The input is a graphical representation of the quote which is sawed with matplotlib. In my tester which takes into account the spread on each position everything is fine. Test for 2020.

I tried to pair it with mql using keras2cpp but it did not work. So I decided to use file. Everything is slow anyway)) and talking through file will not make any difference.

Reason: