Another important question is whether the model will get information about the trading environment - what positions are open, what is there in the history....
Another important question is whether the model will receive information about the trading environment - what positions are open, what is there in the history.....
The testing system will consist of three components:
1) our single robot template
2) your wrapper model.mq5 in source code to provide input/output of data to ONNX model, interpretation of results and generation of trades
Up for discussion is the robot template for Tester.
// Торговый сигнал.double SignalONNX( constMqlTick &Tick ) { return(0); }
#define MT4ORDERS_AUTO_VALIDATION // Торговые приказы отправляются только в случае успешной проверки на корректность#include <MT4Orders.mqh> // https://www.mql5.com/ru/code/16006voidOnTick()
{
MqlTick Tick;
if (SymbolInfoTick(_Symbol, Tick))
{
constdouble Signal = SignalONNX(Tick);
constint Type = (MathAbs(Signal) < 1) ? -1 : (Signal < 0);
if (Type != -1)
{
int Count = 0;
for (uint i = OrdersTotal(); (bool)i--;)
if (OrderSelect(i, SELECT_BY_POS))
{
if (OrderType() == Type)
Count++;
else
OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 0);
}
if (!Count)
OrderSend(_Symbol, Type, 1, Type ? Tick.bid : Tick.ask, 0, 0, 0);
}
}
}
The code is concise, so it's immediately readable. It has three states: buy, sell, do nothing.
I don't see the point in complicating it, adding MM, etc. Then with MO you have to try harder.
The element of randomness is eliminated if you require that the frequency of transactions (one per day, for example) corresponds to the previous values. In general, we can discuss something at the code level.
And it says that you can't convert any model, the model itself must support this format.
--------------------------------
So, the conclusion is that ONNH is python, no way out.
There is a list of model preparations recommended for use. All 3 boosts support both saving in c++ or json and onnx. Any others are impractical to use. With neural networks it's probably more complicated, maybe only in python.
Any preprocessing, at the level of execution of an already trained model, is usually quite simple and can be rewritten to another language.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Another important question is whether the model will get information about the trading environment - what positions are open, what is there in the history....
Question to developers, ONNX models in MT are executed on processor or video card?
Another important question is whether the model will receive information about the trading environment - what positions are open, what is there in the history.....
Renat Fatkhullin #:
GPUs are critical precisely at the learning stage.
ONNX could be an alternative for OpenCL. But this is just an idea for now.
Up for discussion is the robot template for Tester.
The code is concise, so it's immediately readable. It has three states: buy, sell, do nothing.
I don't see the point in complicating it, adding MM, etc. Then with MO you have to try harder.
The element of randomness is eliminated if you require that the frequency of transactions (one per day, for example) corresponds to the previous values. In general, we can discuss something at the code level.
There is a huge amount of information on ONNX on our website.
Will zipmap support be added? Not all models have it disabled when converting.
convenience for
ONNX: output parameter has unsuppotred type 'ONNX_TYPE_SEQUENCE'
Now if they go there, almost everyone will hit it, but they will not have the desire and ability to edit ONNX files.The testing system will consist of three components:
Thanks, this is already better!
Will the trading class be standard or can I use my own, with a more convenient wrapper?
That's if you mean just the neural network model, not just any model like Forest.
Although hgboost is probably okay too.
---------------------------------
And it says that you can't convert any model, the model itself must support this format.
--------------------------------
So, the conclusion is that ONNH is python, no way out.
There is a list of model preparations recommended for use. All 3 boosts support both saving in c++ or json and onnx. Any others are impractical to use. With neural networks it's probably more complicated, maybe only in python.
Any preprocessing, at the level of execution of an already trained model, is usually quite simple and can be rewritten to another language.