Neural network in the form of a script - page 5

 
Blast:

How do I use this? Put a script on the chart, piles of numbers started to rewrite... What do these numbers say?

The numbers that are overwritten (made for clarity) are the weights of neurons that adjust in the learning process (see above on the branch).

Here's an example of an indicator using the very first version of the grid posted at the beginning of the branch .

Inputs

               if (iMA(NULL,0,13,0,MODE_SMMA,PRICE_MEDIAN,pat + 0 )>iMA(NULL,0,13,0,MODE_SMMA,PRICE_MEDIAN,pat + 2 )) test_pat[0] = 0.1 ; else test_pat[0] = 0.9;
               if (iMA(NULL,0,13,0,MODE_SMMA,PRICE_MEDIAN,pat + 0 )>iMA(NULL,0,13,0,MODE_SMMA,PRICE_MEDIAN,pat + 3 )) test_pat[1] = 0.1 ; else test_pat[1] = 0.9;
               if (iMA(NULL,0,13,0,MODE_SMMA,PRICE_MEDIAN,pat + 0 )>iMA(NULL,0,13,0,MODE_SMMA,PRICE_MEDIAN,pat + 4 )) test_pat[2] = 0.1 ; else test_pat[2] = 0.9;
               if (iMA(NULL,0,13,0,MODE_SMMA,PRICE_MEDIAN,pat + 0 )>iMA(NULL,0,13,0,MODE_SMMA,PRICE_MEDIAN,pat + 5 )) test_pat[3] = 0.1 ; else test_pat[3] = 0.9;

Output

               if (iMA(NULL,0,13,0,MODE_SMMA,PRICE_MEDIAN,pat + 0 )>iMA(NULL,0,13,0,MODE_SMMA,PRICE_MEDIAN,pat + 1 )) desired[0] = 0.1 ; else desired[0] = 0.9;
               if (iMA(NULL,0,13,0,MODE_SMMA,PRICE_MEDIAN,pat + 0 )>iMA(NULL,0,13,0,MODE_SMMA,PRICE_MEDIAN,pat + 1 )) desired[1] = 0.1 ; else desired[1] = 0.9;

The input and output are for example only . As it is not the best option .

The best variant has to be searched and tried .

Files:
 
sprite:

Entry and exit are just an example . As this is not the best option.

The best option must be sought and tried.

Have you tried getting the probability of a predicted direction as an exit, at least in the simple option of up/down ?

 
SK. писал (а):
sprite:

Entry and exit are just an example . As this is not the best option.

The best option must be sought and tried.

Have you tried getting the probability of a predicted direction as an exit, at least in the simple option of up/down ?

How do you code it(probability of predicted direction) ?
 
sprite:
How can it(probability of predicted direction) be coded?

It must be possible somehow. You do get some kind of 0 and 1 in the output.

For example, 01 = 50%, 10 = 50%, 00 = -100%, 11 = +100%.

If you try a little harder, you can prescribe some sort of feedback - to check the actual direction.

 

The target function for grid training is an interesting question!

It is covered in the book by Ezhov, Shumsky "Neurocomputing and its applications in economics and business".

 
Friends, forget about this mql. It is slow. You should write a network in C++, learn it, and then feed the prepared coefficients into the mql programme. People are even trying to load the video card during training, however twisted it may be, to save time, while you are wasting it.
 
Wisard писал (а) >>
My friends, forget about this mql. It is slow. You should write the network in C++, learn it and then paste the prepared coefficients into an mql programme. People are even trying to load a video card during training, any way they twist it to save time, while you are wasting it.

that's obvious... of course it's slow

but that didn't prevent (the good programmer BETTER to implement it in the MQL4 code)

this is not the point

I gave a simple example here, a simple grid: in C, the grid takes a few seconds to train, while in MQL it takes up to several minutes or even hours

and the trained one is working at an acceptable speed - i.e. if you don't retrain it every step

the PNN network is very fast! in C it's either in MQL4 or in the slowest script - in real work it won't show up

because you don't have to make decisions as if you're catching fleas - the speed of the machine is enough

but I would rather create-write the network in C - that allows you to quickly train it, modify it, add new features and run it in tests.

Migration to MQL4 doesn't make any sense... except for the CHAMPIONSHIP.

 
SK. писал (а) >>

Have you tried to get the probability of a predicted direction as an output, at least in a simple up/down version?

Sergei, I think the task here is just to show the current direction and quickly inform when it changes

rather than a prediction of what's coming, it's an indication of what's happening at the moment,

it is an attempt to keep an open position in the right direction without letting it go against the instructions

the opening itself can be done based on different filters and other indicators, for example a divergence for a divergence in a smaller timeframe

may be someone's network is so good that it does not require additional manipulation

 
YuraZ писал (а) >>

that's obvious... of course it's slow

but that didn't prevent (the good programmer BETTER to implement it in the MQL4 code)

this is not the point

I gave a simple example here, a simple grid: in C, the grid takes a few seconds to train, while in MQL it takes up to several minutes or even hours

and the trained one is working at an acceptable speed - i.e. if you don't retrain it every step

the PNN network is very fast! in C it's either in MQL4 or in the slowest script - in real work it won't show up

because you don't have to make decisions as if you're catching fleas - the speed of the machine is enough

but I would rather create-write the network in C - that allows you to quickly train it, modify it, add new features and run it in tests.

Migration to MQL4 doesn't make any sense... except for the CHAMPIONSHIP.

Maybe go the way of connecting a DLL in C++ to speed up MQL. Write some universal templates-functions in C++, although it's kind of the same as NSDT. By the way, BETTER wrote everything in C++ and translated the final result into MQL.
 
YuraZ писал (а) >>

THIS NETWORK

THE SAME NETWORK but written in Microsoft Visual C++ 6.0

Speed is orders of magnitude higher than in MQL4

the algorithm has not been changed, the transfer from MQL4 to C++ is as straightforward as possible, without using objects - classes

I couldn't find a dll file. If you can, please tell me how to create one.