Neural networks, how to master them, where to start? - page 17

 
Andrey4-min писал(а) >>

In your example you have w1 on all three lines, is this how it should be?

No, I made a mistake. I'm sorry.

I'm trying to figure out what function w0 will perform, and assumed it's kind of a step in history, you know, like in loops, if not, explain more...

Imagine you need to consider the surface texture of a board nailed on the roof of a house. What would you do? That's right, you climb on the roof and examine everything up close and personal. If such task is given to our NS, it will perform it with responsibility, it will not go under the roof, but will study the board together with the whole house which has the board on its roof!

So, to exclude unnecessary work of the NS (and learning, the process is very resource-intensive), we introduce an "extra" input with a fixed offset. Now look: NS in the learning process itself will select necessary weight to this input (+/-1 or other), it is equivalent to the fact that you will put a ladder to the house in order to rise to your board of interest! Now, the NS will not rummage through the mountain of unnecessary information, but simply, by easy movement, will take a comfortable (in its understanding) position for further comfortable learning.

 
int    w0=1;
double w1=(High[1]-Low[1])/Point*(Close[1]-Open[1])/Point;
double w2=(High[2]-Low[2])/Point*(Close[2]-Open[2])/Point;
double w3=(High[3]-Low[3])/Point*(Close[3]-Open[3])/Point;
double w4=(High[4]-Low[4])/Point*(Close[4]-Open[4])/Point;
double w5=(High[5]-Low[5])/Point*(Close[5]-Open[5])/Point;
double w6=(High[0]-Low[0])/Point*(Close[0]-Open[0])/Point;
If we enter based on the results of bar 1, then
w6=(High[0]-Low[0])/Point*(Close[0]-Open[0])/Point;

will be formed after the trade is opened, i.e. this entry (w6) cannot influence the quality of the open trade in any way.

If I understand correctly, w6 is introduced to detect which way the price moved after opening a trade based on analysis of the previous five bars (w1, w2, w3, w4, w5).

 

We will enter based on the results of the analysis of the five bars formed. Therefore, the zero bar will not be used as an entry bar.

Right:

double w0=1.;
double w1=(High[1]-Low[1])/Point*(Close[1]-Open[1])/Point;
double w2=(High[2]-Low[2])/Point*(Close[2]-Open[2])/Point;
double w3=(High[3]-Low[3])/Point*(Close[3]-Open[3])/Point;
double w4=(High[4]-Low[4])/Point*(Close[4]-Open[4])/Point;
double w5=(High[5]-Low[5])/Point*(Close[5]-Open[5])/Point;

Let's introduce normalization coefficients for High-Low series - HL and for Close-Open series - CO. Let's define them as a standard deviation from the corresponding increments with the averaging window, for example 100.

double HL=0.;

double CO=0.;

for(i=0;i<100;i++) {

HL=HL+(High[i] -Low[i] )*(High[i] -Low[i] );

CO=CO+(Close[i]-Open[i])*(Close[i]-Open[i]);

}

HL=MathSqrt(HL/100);

CO=MathSqrt(CO/100);

Let's run a normalizing function (maps the entire numeric axis into a +/-1 segment):

double th(double x)
{
if(MathAbs(x)<100.)S=(MathExp(x)-MathExp(-x))/(MathExp(x)+MathExp(-x));
else S=MathAbs(x)/x;
return(S);
}

Then the normalised inputs for the NS will be counted as follows:

double d0=1.;
double d1=th((High[1]-Low[1])/HL*(Close[1]-Open[1])/CO);
double d2=th((High[2]-Low[2])/HL*(Close[2]-Open[2])/CO);
double d3=th((High[3]-Low[3])/HL*(Close[3]-Open[3])/CO);
double d4=th((High[4]-Low[4])/HL*(Close[4]-Open[4])/CO);
double d5=th((High[5]-Low[5])/HL*(Close[5]-Open[5])/CO);

One more thing. w1...w5 are not NS inputs, they are weights that can be adjusted during the process of circumcision. Inputs will be denoted as d1, d2... d5
 

entry normalisation = candle in pips

double a;
int CandleMax=20, CandleMin=-20, Diapazon;
Diapazon= CandleMax- CandleMin;

a=(Close[ i]-Open[ i])/Point;
if( a> CandleMax) a= CandleMax;
if( a< CandleMin) a= CandleMin;
a=( a- CandleMin)/ Diapazon;
P.S. древний вариант
 
Korey, we will use "fine" normalisation (where the +/-1 segment will be filled evenly). This is a point of principle.
 

Neutron, thank you again for such a detailed explanation.

I will probably spend 60 minutes on what you just wrote, so if it's not too much trouble look into this topic in an hour.

If i am interested in this, i may send you the charts with EA algorithm description and the description of non-network coefficients.

 

To be honest, I'm not a fan of private communication. If there are no restrictions in principle, it's better to communicate here. Also, I may lose interest in this topic (just in case), so I'm not committed to keeping it mandatory:-)

Deal?

 
Neutron писал(а) >>
Korey, we will use "thin" normalisation (when the segment +/-1 will be filled evenly). This is a point of principle.

this also fills evenly, but there is no curvature at the edges, i.e. the ancient version is not a complete mapping into a segment

 
Korey писал(а) >>

this also fills evenly, but there are no creases at the edges, i.e. the ancient version is not a complete mapping into a section

Yes, but we need everything at once!

 
Neutron >> :

I'm honestly not a fan of private communication. If there are no restrictions in principle, it's better to communicate here. Also, I may lose interest in this topic (just in case), so I'm not committed to keeping it mandatory:-)

Do we have a deal?

>> Deal.

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
//Введём нормировочные коэффициенты для ряда High-Low - HL и для ряда Close-Open - CO. 
//Определим их как стандартное отклонение от соответствующих приращений с окном усреднения, например 100.
double HL=0.;

double CO=0.;

for(int i=0; i<100; i++) {

HL= HL+(High[ i] -Low[ i] )*(High[ i] -Low[ i] ); //Эти значения умножаются друг на друга, 
                                             //чтобы в случае если значение будет отрицательным
CO= CO+(Close[ i]-Open[ i])*(Close[ i]-Open[ i]); //при умножении оно стало положительным?

}
HL=MathSqrt( HL/100);//Получилось среднее значение диапазона 100 последних баров
CO=MathSqrt( CO/100);//Получилось среднее значение диапазона между open b close 100 последних баров

//Ведём нормализующую функцию (отображает всю числовую ось в отрезок +/-1):
double th(double x); // что значит эта строчка?
{
if(MathAbs( x)<100.) S=(MathExp( x)-MathExp(- x))/(MathExp( x)+MathExp(- x));
else S=MathAbs( x)/ x;
return( S); // для чего вычислялась S? 
}

//Тогда нормализованные входа для НС будут считаться следующим образом:
double w0=1.; // что значит точка после числа?
double w1= th((High[1]-Low[1])/ HL*(Close[1]-Open[1])/ CO);
double w2= th((High[2]-Low[2])/ HL*(Close[2]-Open[2])/ CO);
double w3= th((High[3]-Low[3])/ HL*(Close[3]-Open[3])/ CO);
double w4= th((High[4]-Low[4])/ HL*(Close[4]-Open[4])/ CO);
double w5= th((High[5]-Low[5])/ HL*(Close[5]-Open[5])/ CO);

//И ещё. w1...w5 это не входа НС, это настраиваемые в процессе её обцчения веса. Входа будем обозначать как d1, d2... d5

   
//----
   return(0);
  }
//+------------------------------------------------------------------+
Reason: