MetaTrader 5 Python User Group - how to use Python in Metatrader - page 5

 
Maxim Dmitrievsky:

I did it on ticks, filtered all sorts and then on opening prices - didn't notice a big difference in the fitting. On the minutes the average rand is small as it is. And the system crashes more often, because it takes a long time to fit on a long period, yes. As a result optimum 15 (sometimes 5) minutes haunts me. I haven't done faster algo due to lack of theoretical background in tethering and signal processing (at low levels it rules), but I may try it soon.

Everything will be slower to test on python. If all unnecessary things are removed then it might be ok.
I also use close prices, but on m1 to save resources. Tics do not mean anything on forex anyway. I would like to use ticks and analysis of performed deals on exchange data, but I have not got time to do it yet. But sometimes I need to run it in the tester using real ticks in order to compare how the algorithm works in real data in conjunction with the tester.
 
Renat Fatkhullin:

This is one way integration.

That is, from Python/R you can request data from MetaTrader 5 terminal. The terminal itself knows nothing about external users and does not transmit anything to them. All the more so from the tester.

Integration packages are designed to allow analysts to use market data in their environment.

Thank you! That's what I wanted to find out.
 
Maxim Romanov:
I also use closing prices, but on m1 to save resources. Tics do not mean anything on forex anyway. I wanted to use ticks and analysis of performed deals in exchange data, but I have not got time to do it yet. But sometimes I need to run it in the tester using real ticks in order to compare how the algorithm works in real data in conjunction with the tester.

my imma is that ticks are hft with all the implications, i.e. a different approach. Working with tick flows from multiple sources\symbols. In forex it is almost unrealistic in the long term, too toxic. In exchange market it is not very good either, there are already some skilled traders sitting on the colocation table and killing your strategies with their order flow. In the end something in between, half-full of noise, but thanks to MO you can take it out. Well, the medium / long MO is also OK, but the profit will fall proportionally.

 
Maxim Dmitrievsky:

my imma is that ticks are hft with all the implications, i.e. a different approach. Working with tick flows from multiple sources\symbols. In forex it is almost unrealistic in the long term, too toxic. In exchange market it is not very good either, there are already some skilled traders sitting on the colocation table and killing your strategies with their order flow. In the end something in between, half-full of noise, but thanks to MO you can take it out. Well, a medium-long MO is OK too, but profits will fall proportionally.

The link between ticks and HFT is a myth. Ticks are a way to increase the maturity expectation of the TS. Nothing more. If the MO increase by 5 pips is successful, all other things being equal, this is an excellent result. Of course, we are talking about hundreds of trades per month.

 
That's a good point. A tick chart, not a caprice, not HFT dreams, and so on, but just accuracy.
 
fxsaber:

The link between ticks and HFT is a myth. Ticks are a way to raise the maturity expectation of the TS. Nothing more. If it is possible to increase the MO by 5 pips, all other things being equal, it is an excellent result. Of course, we are talking about hundreds of trades per month.

Otherwise 5 pips would not have such an effect. In terms of DT trading (not counting that you have some special one), this is a statistical error

but come on, the topic is about python
 
fxsaber:

Will byte array to structure array (and back) casting in Python be there?

Where can I find out about such casting in MQL? I see that POD of structures to byte array and back is possible. I don't understand much about the structure array.

If you copy them sequentially from the array but need to figure out the protocol, how to process the byte stream on the other side. I don't know how to do this intelligently.

 
Maxim Dmitrievsky:

Where can I find out about such casting in MQL? I see that POD structures to byte array and vice versa are possible. I don't understand much about the structure array.

If you copy them sequentially from the array but need to figure out the protocol on the other side to process the byte stream. I don't know how to do this intelligently.

as usual byte-by-byte, the Python library has a package that represents the fundamental types in a pure form, for example, read the received byte array at the correct offset on the data structure, and the read section converted to the desired format

 
Maxim Dmitrievsky:

Where can I find out about such casting in MQL? I see that POD structures to byte array and vice versa are possible. I do not understand much about the structure array.

Forum on trading, automated trading systems and strategy testing

Libraries: TradeTransactions

fxsaber, 2019.03.15 07:36

// Быстрый кастинг массивов.
#include <fxsaber\TradeTransactions\Convert.mqh> // https://www.mql5.com/ru/code/22166

void OnStart()
{
  MqlTick Ticks[];

  MqlRates Rates[];  
  CopyRates(_Symbol, PERIOD_CURRENT, 0, 10, Rates); // Получили котировки.
  CONVERT::ArrayToArray(Rates, Ticks);              // Кастинг MqlRates[] -> MqlTick[].

  MqlRates Rates2[];    
  CONVERT::ArrayToArray(Ticks, Rates2);             // Кастинг MqlTick[] -> MqlRates[].
  ArrayPrint(Rates2);                               // Убедились, что все корректно.
}
 
fxsaber:

i.e. it's possible to convert a structure array to a byte array to pass to a socket? then it's strange why the standard structToChar doesn't do that.


Reason: