Author's - page 4

 
I have sorted out the synchronization. Please advise if there is a way to freeze the terminal (so it does not accept quotes) for the time of the script or Expert Advisor.
 
ivandurak:
I have sorted out the synchronization. Please advise if there is a way to freeze the terminal (so it will not accept quotes) while the script or Expert Advisor is working.

This is nonsense.

What's that for?

 
her.human:

This is nonsense.

Why is it necessary?

The multicurrency tester which can be crammed inside an EA indicator or script is practically finished, I hope. There was the main problem with synchronization of different trading tools in the presence of holes in the history. For example, we analyze Euro and Gazprom shares, it is clear that the trading time is different, and therefore there are many gaps in Gazprom compared to Euro, including weekends and holidays. Out of the position came out - an exemplary array of opening times at a selected timeframe without gaps in the selected part of history. Then the open time of an exemplary array is compared to the time of opening a trading instrument, and when the time coincides, the bar number of the trading instrument is memorized, and this number is transmitted to the TS. Now we have a few trading instruments and during their recalculation the next bar may start at the last one, as a result the bar that was returned for calculations turns out to be shifted with all that implies. The solution is the possibility to correct the bar number permanently, but this is a large complication of the code. We can return the open time of a bar instead of its number, like you suggested, but in that case it would complicate the code for a user (I lean towards this variant so far). So I thought, the built-in tester will not give a new price value until the Deinit does not work, maybe there is a way to slow down the terminal until the program works.
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства позиций
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства позиций
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства позиций - Документация по MQL5
 
ivandurak:
To return to the TS not the bar number, but the opening time of the bar, but then it is a complication for the user
CopyTime("EURUSD",0,Время,Количество_Баров,Time);
CopyOpen("EURUSD",0,Время,Количество_Баров,OpenEU);
There seems to be no complication.
 

Well here is the first swallow of the multicurrency . I should warn you right away, it's not even a release, the code is not optimized and not fully debugged and there are bound to be bugs in it. If it is not difficult to look at and express your wishes, spit yet too early.

The tester is designed for multicurrency testing of a selected piece of history . All trading functions are taken from 4 . Detailed instructions after completion .

I forgot to add should be open all charts of interest on the same timeframes

Files:
Tester.mqh  61 kb
 

First release

Good day to you a class for writing a multicurrency tester inside scripts, indicators or Expert Advisors .The testing is done by opening prices .

Class methods

void Initialization() ;// This method performs zeroization of variables.

void AddSymbol(string Symb) ;// method adding a symbol under test to the tester symbol must be loaded and the terminal must display a chart on the period under test .

bool SetBeginEnd( int Begined, int Ended) ;// set beginning and end of the history under test . Indexation starts from the end according to the standard. That's why the start bar of the history under test is larger than the end bar.

void Visualisation(true); // Enabling visualization of trades .

voidPrinting(true) ;//the output of trade results to the journal is disabled by default.

bool Start(datetime &IndexInstrum[]) this method checks end of the period being tested, and returns the array of bar start times for the instruments being tested . This is necessary to synchronize the testing of different instruments if there are gaps .

int GetBarsNambe(string GSimb,datetime TimeOpen);//returns the bar number by the selected symbol and bar open time.

void Vedenie_v() is the main method where we check all set orders for triggering, closing at stop or profit.

Testing is based on Mql4 rules, i.e. every order has its own life, so we can lock and open opposite orders.

All trading functions are also taken from Mql4. This was done to allow easy adaptation of EAs written in this language.

Please note that method OrderClose_v closes the selected position completely .

OrderCloseBy missing .

double OrderProfit_v( ) calculates profit without leverage, leverage may be different for different tested symbols .

The rest of the code remains unchanged, see documentation.

Order of application

First comes initialization . Then we select history under test . Then we add the instruments under test . Enable visualization if necessary . Enable report output if necessary .

Testing itself takes place inside the loopDo -While .

First comes the mandatory method

aaa=Test.Start(timeopen) ; Returns the end of testing and the array of bar open times for the instruments under test . The dimension of timeopen should coincide with the number of instruments under test . If for example timeopen[0] < 0, then this is a sign of missing in the history, see example .

After that the trading system itself has an unlimited number of bars. nambebars=Test.GetBarsNambe(Symbol(),timeopen[0]) ; where is the symbol of the trading symbol and bar open time. According to this number, you can calculate the values of indicators and set the trading signal according to the logic of TS.

At the very end must go method Vedenie_v .

After the end of testing (exiting the cycle) all trading history is available for all orders . See the description and forum of Mql4

You also need the HeadTester.mqh file to fully overlap the format of the Mql4 trading functions .

Good luck and prosperity .

Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства сделок
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства сделок
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства сделок - Документация по MQL5
Files:
Tester.mqh  69 kb
 
ivandurak:

First release

...

Good luck and prosperity .

Thank you. Maybe you could write an article? Immortalise it, so to speak. )))
 

Gentlemen PLZ. Somewhere I am slowing down very intensely. The question concerns SOM. If it is possible on a concrete example .

Suppose we have a map consisting of 50X60 neurons (rectangular cells). Let's take a random training vector, its dimension x1={x1,x2,x3,x4,x5}, let's assume the total length of training sample is 5000 vectors. Suppose that the neuron closest to the input vector has index 25,30 - I found it and my child is already studying geometry at school. And then my neural network is not optimized anymore. Actually further a bunch of questions.

1 How to calculate the indices of neurons to be trained at step 1.

2 How to calculate the indices of neurons to be trained at the 2nd step.

3 How many total training steps should there be for input vector X1.

4 If I am stuck with Kohonen's learning rule, I will ask more.

PS Read the article, read the supplementary literature, looked at the codes, the conclusion requires a pendel.

 

I think I have sorted out the vicinity of the winning neuron within which the learning takes place. Now the next question is.

Is there a criterion of how many times to train neurons in the vicinity? This question is poorly described, I cannot understand if we teach it once and then take the next vector. Or train until the average error is reduced to, say, 5%.

 

An algorithm for colouring the Kohonen map is needed. There is a great desire not to paint all the maps, but to do with one, respectively, each cluster should assign its own colour. How to do it mind is not.In the figure shows the map I have. The principle of coloring is that a vector with greater length is painted in the lightest colour. Although it is not correct vectors X1 = (1,1) and X2 = (-1,-1) have the same length but belong to different areas.

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Стили рисования
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Стили рисования
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы индикаторов / Стили рисования - Документация по MQL5