no,there is no belonging mqh file any where,and now every indicator (old+new) asking for that include,this is really interesting and strange,it was compiled before and worked....let us wait till things came up in order.
no,there is no belonging mqh file any where,and now every indicator (old+new) asking for that include,this is really interesting and strange,it was compiled before and worked....let us wait till things came up in order.
regards
This is the include file :
//+------------------------------------------------------------------+//| NeuroTrend_Include.mqh |//+------------------------------------------------------------------+#property copyright""#property link""/**************************** Usage *******************************
SetInput(Input);
PropagateNet();
GetOutput(Output);
**********************************************************************/#define LOGISTIC 0#define TANH 1int gmLayers = 0; /* number of layers in the net */int gmUnitsTotal = 0; /* total number of units in the net */int gmConnections = 0; /* total number of connections int the net */int gmGain = 1; /* Gain of the net*/int gmUnits[]; /* number of units in each layer */double gmOutput[]; /* output of ith unit of nth layer*/double gmBias[]; /* bias of ith unit of nth layer*/double gmWeight[]; /* weight of jth connection of ith unit & nth layer *//*------------------------------------------------------------------------*//* Allocate memory for Neural Network of geometry described by layers,
units[]. */void GenerateNetwork(int layers_no, int units[])
{
int l;
gmLayers = layers_no;
Print(ArrayResize(gmUnits, gmLayers)+" network layers:");
for(l=0; l<gmLayers; l++)
{
gmUnits[l] = units[l];
gmUnitsTotal += units[l];
}
Print(ArrayResize(gmOutput, gmUnitsTotal)+" network units");
Print(ArrayResize(gmBias, gmUnitsTotal)+" network units");
for(l=1; l<gmLayers; l++)
{
gmConnections += gmUnits[l]*gmUnits[l-1];
}
Print(ArrayResize(gmWeight, gmConnections)+" network connections");
}
/*------------------------------------------------------------------------*//* Copies Input to the input layer of the net */void SetInput(double inputt[])
{
int i, u;
u = gmUnits[0];
for(i=0; i<u; i++)
{
gmOutput[i] = inputt[i];
}
}
/*------------------------------------------------------------------------*//* Copies the output layer of the net to Output */double GetOutput(int index)
{
int l, oub;
for(l=0; l<gmLayers-1; l++) oub += gmUnits[l];// no. of units before output layer//Print(oub);return (gmOutput[oub+index-1]);
}
/*------------------------------------------------------------------------*//* Produces the network output from input. You need to use SetInput to
insert data into the network, and GetOutput to retrieve the
result. */void PropagateNet()
{
int i,j,k,l, lu =0, uu =0, lub =0, uub=0, wts = 0;
double sum=0;
for(l=0; l<gmLayers-1; l++)
{
//Print(l);
lub = uub;
uub=0;
lu = gmUnits[l];
uu = gmUnits[l+1];
for(k=0; k<l+1; k++) uub += gmUnits[k];// no. of units before upper layer//Print("Propagating from layer "+l +" to "+(l+1));//Print("lu"+lu);//Print("uu"+uu);//Print("lub"+lub);//Print("uub"+uub);for(i=0; i<uu; i++)
{
//if(l==2) Print("cout: "+(uub+i));
sum = 0;
for(j=0; j<lu; j++)
{
sum += gmOutput[lub+j] * gmWeight[wts];
//if(l==2)Print("output: "+(lub+j-1)+" weight: "+wts);//if(l==2)Print((lub+j-1)+"X"+gmWeight[wts]);
wts++;
}
/*for(j=lu; j>0; j--)
{
sum += gmOutput[lub+j-1] * gmWeight[wts];
//if(l==2)Print("output: "+(lub+j-1)+" weight: "+wts);
//if(l==2)Print((lub+j-1)+"X"+gmWeight[wts]);
wts++;
}*/
sum += gmBias[uub+i];
gmOutput[uub+i] = Activation(sum, TANH);
}//for all units of a layer
}// for all layers
}
/*-----------------------------------------------------------------------*/double Activation(double sum, int type)
{
double ret;
switch(type)
{
case0:
ret = 1.0 / (1.0 + MathExp(-gmGain * sum));
break;
case1:
ret = (2.0 / (1.0 + MathExp(-2.0 * sum))) - 1.0;
break;
default:
Print("Undefined activation type\n");
break;
}
return(ret);
}
/*------------------------------------------------------------------------*//* sets the network weights from the input array */bool SetWeights(double weights[])
{
if(ArraySize(weights) != gmConnections)
{
Print("Input weights not equal to connections");
return (0);
}
Print(ArrayCopy(gmWeight, weights,0,0,WHOLE_ARRAY)+" weights initialized");
return(true);
}
/*------------------------------------------------------------------------*//* Copies Input to the input layer of the net */bool SetBias(double bias[])
{
if(ArraySize(bias) != gmUnitsTotal)
{
Print("Input bias not equal to total units");
return (0);
}
Print(ArrayCopy(gmBias, bias,0,0,WHOLE_ARRAY)+" bias initialized");
return(true);
}
/*------------------------------------------------------------------------*/int ReadNetwork(string nfile, string ofile, bool out = false)
{
int handle = -1, ohandle = -1;
handle = FileOpen(nfile, FILE_CSV | FILE_READ);
if(handle < 0)
{
Print("Error reading network file, code:"+ GetLastError());
return (0);
}
if(out)
{
ohandle = FileOpen(ofile, FILE_CSV|FILE_WRITE);
if(ohandle < 0)Print("Error opening file to write, code:"+ GetLastError());
}
string str, substr;
int pos = -1, units = 0, connections = 0, index = 0;
bool bias = false, weights = false;
bool loop = true;
//read no of unitswhile(loop)
{
str = FileReadString(handle);
if(GetLastError() == 4051) break;
if(units <= 0)
{
pos = StringFind(str,"no. of units :",0);
if(pos != -1)
{
units = StrToInteger(StringSubstr(str, 14,StringLen(str)));
str = FileReadString(handle);//read next line
connections = StrToInteger(StringSubstr(str, 20,StringLen(str)));
if((units != gmUnitsTotal) || (connections != gmConnections))
{
Print("read units/connections not equal to network units/connections");
return (0);
}
}
}else
{
if(bias == false)
{
//find bias and write to file
pos = StringFind(str,"| sites",0);
if(pos != -1)
{
if(out && (ohandle > 0)) FileWrite(ohandle, "**********\n BIAS\n**********");
str = FileReadString(handle);
index = 0;
while(index < units)
{
str = FileReadString(handle);
for(int i = 1; i < 5; i++)
{
pos = StringFind(str,"|",0);
if(pos != -1)str = StringSubstr( str, pos+1);
}
pos = StringFind(str,"|",0);
if(pos != -1) substr = StringSubstr( str, 0, pos);
StringTrimLeft(substr);
StringTrimRight(substr);
gmBias[index] = StrToDouble(substr);
index++;
if(out && (ohandle > 0)) FileWrite(ohandle, substr);
}//end while
bias = true;
}//if pos
}elseif(weights == false)
{
//find weights and write to file
pos = StringFind(str,"source:weight",0);
if(pos != -1)
{
if(out && (ohandle > 0)) FileWrite(ohandle, "\n\n**********\n WEIGHTS\n**********");
str = FileReadString(handle);
index = 0;
while(index < connections)
{
str = FileReadString(handle);
while(true)
{
pos = StringFind(str,":",0);
if(pos == -1) break;
substr = StringSubstr(str, pos+1, 8);
StringTrimLeft(substr);
StringTrimRight(substr);
gmWeight[index] = StrToDouble(substr);
index++;
if(out && (ohandle > 0)) FileWrite(ohandle, substr);
str = StringSubstr(str, pos+8,0);
} //end while true
}//end while index < connections
weights = true;
loop = false;
}//end if pos
}else//if not bias or weights
{
loop = false;
}
}// end else if units
} // end while loopif(ohandle > 0) FileClose(ohandle);
if(handle > 0) FileClose(handle);
return (1);
}
/*------------------------------------------------------------------------*/
no,there is no belonging mqh file any where,and now every indicator (old+new) asking for that include,this is really interesting and strange,it was compiled before and worked....let us wait till things came up in order.
regards
And this is the updated indicator (it needed some changes to be compiled) :
thank you man,you are as fast as TSD announced and expected in near future....but i am happy,once again members red digits will be start from 1 except moderators,lol.
so many thanks for all two files,working well now , one question plz,in property window there are two parameters setting for (at the lower end) "short time frame" and "long time frame" ..... short time frame setting working well according to belonging time frame,where as long frame doing nothing,so this long time frame is for what and where to use,if it is inactive inside code ?
so many thanks for all two files,working well now , one question plz,in property window there are two parameters setting for (at the lower end) "short time frame" and "long time frame" ..... short time frame setting working well according to belonging time frame,where as long frame doing nothing,so this long time frame is for what and where to use,if it is inactive inside code ?
regards
mntiwana
That indicator is actually using two time frames. Short time frame is used by the majority of code (14 out of 16 input values) while the long time frame is used by only 2 out of 16 input values. That is why the impact of the "long time frame" is not that much obvious as the impact of the "short time frame"
In order t resolve some doubts : the forum issues solving will be resumed starting from tomorrow (due to holidays) and, as it is planed, the forum will resume its normal functioning very soon
Dearest MLADEN
no,there is no belonging mqh file any where,and now every indicator (old+new) asking for that include,this is really interesting and strange,it was compiled before and worked....let us wait till things came up in order.
regards
Dearest MLADEN
no,there is no belonging mqh file any where,and now every indicator (old+new) asking for that include,this is really interesting and strange,it was compiled before and worked....let us wait till things came up in order.
regards
This is the include file :
Dearest MLADEN
no,there is no belonging mqh file any where,and now every indicator (old+new) asking for that include,this is really interesting and strange,it was compiled before and worked....let us wait till things came up in order.
regards
And this is the updated indicator (it needed some changes to be compiled) :
I have sent you the file via email.
Krelian
thank you man,you are as fast as TSD announced and expected in near future....but i am happy,once again members red digits will be start from 1 except moderators,lol.
regards
Include file can be also downloaded from here : https://www.mql5.com/en/forum/180648/page628
Dearest MLADEN
so many thanks for all two files,working well now , one question plz,in property window there are two parameters setting for (at the lower end) "short time frame" and "long time frame" ..... short time frame setting working well according to belonging time frame,where as long frame doing nothing,so this long time frame is for what and where to use,if it is inactive inside code ?
regards
Dearest MLADEN
so many thanks for all two files,working well now , one question plz,in property window there are two parameters setting for (at the lower end) "short time frame" and "long time frame" ..... short time frame setting working well according to belonging time frame,where as long frame doing nothing,so this long time frame is for what and where to use,if it is inactive inside code ?
regards
mntiwana
That indicator is actually using two time frames. Short time frame is used by the majority of code (14 out of 16 input values) while the long time frame is used by only 2 out of 16 input values. That is why the impact of the "long time frame" is not that much obvious as the impact of the "short time frame"
Almost, cant take it anymore.
My profile (correct link should be) : https://www.forex-tsd.com/trader/Anyway
But now it is : https://www.forex-tsd.com/trader/33nyway
https://www.forex-tsd.com/trader/33nyway/about
https://www.forex-tsd.com/trader/33nyway/...
result :
404
Page not found
Check the URL and try again