New MetaTrader 4 Platform Build 500: Trading from Chart and Company's Web Site in the Client Terminal - page 13

 

It's not my code. I don't know where did you get this assumption. Probably from bad prediction.

Following: http://www.heatonresearch.com/wiki/Creating_a_MQL4_Indicator_with_Encog, listing below. 


//+------------------------------------------------------------------+
//|                                                 EncogExample.mq4 |
//|                                                  Heaton Research |
//|                              http://www.heatonresearch.com/encog |
//+------------------------------------------------------------------+
#property copyright "Heaton Research"
#property link      "http://www.heatonresearch.com/encog"

#property indicator_separate_window
#property  indicator_buffers 1
#property  indicator_color1  Silver


//--- input parameters
extern bool      Export=false;

//--- buffers
double ExtMapBuffer1[];

int iHandle = -1;
int iErrorCode;

// begin Encog main config
string EXPORT_FILENAME = "MT4.csv";
int _neuronCount = 0;
int _layerCount = 0;
int _contextTargetOffset[] = {-1};
int _contextTargetSize[] = {-1};
bool _hasContext = false;
int _inputCount = 0;
int _layerContextCount[] = {-1};
int _layerCounts[] = {-1};
int _layerFeedCounts[] = {-1};
int _layerIndex[] = {-1};
double _layerOutput[] = {-1};
double _layerSums[] = {-1};
int _outputCount = 0;
int _weightIndex[] = {-1};
double _weights[] = {-1};
int _activation[] = {-1};
double _p[] = {-1};
// end Encog main config


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
  IndicatorBuffers(1);
  SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   
   IndicatorShortName("Encog Generated Indicator" );
   SetIndexLabel(0,"Line1");
   
      if( Export )
      {
         iHandle = FileOpen(EXPORT_FILENAME,FILE_CSV|FILE_WRITE,',');
         if(iHandle < 1)
         {
            iErrorCode = GetLastError();
            Print("Error updating file: ",iErrorCode);
            return(false);
         }
      
FileWrite(iHandle,"time","close","prediction");
      }
      else
      {
         iHandle = -1;
      }

   return(0);
  }

void ActivationTANH(double& x[], int start, int size)
{
   for (int i = start; i < start + size; i++)
   {
      x[i] = 2.0 / (1.0 + MathExp(-2.0 * x[i])) - 1.0;
   }
}
void ActivationSigmoid(double& x[], int start, int size)
{
   for (int i = start; i < start + size; i++)
   {
      x[i] = 1.0/(1.0 + MathExp(-1*x[i]));
   }
}
void ActivationElliottSymmetric(double& x[], int start, int size)
{
   for (int i = start; i < start + size; i++)
   {
      double s = _p[0];
      x[i] = (x[i] * s) / (1 + MathAbs(x[i] * s));
   }
}
void ActivationElliott(double& x[], int start, int size)
{
   for (int i = start; i < start + size; i++)
   {
      double s = _p[0];
      x[i] = ((x[i]*s)/2)/(1 + MathAbs(x[i]*s)) + 0.5;
   }
}

void ComputeLayer(int currentLayer)
{
   int x,y;
   int inputIndex = _layerIndex[currentLayer];
   int outputIndex = _layerIndex[currentLayer - 1];
   int inputSize = _layerCounts[currentLayer];
   int outputSize = _layerFeedCounts[currentLayer - 1];

   int index = _weightIndex[currentLayer - 1];

   int limitX = outputIndex + outputSize;
   int limitY = inputIndex + inputSize;

   // weight values
   for (x = outputIndex; x < limitX; x++)
   {
      double sum = 0;
      for (y = inputIndex; y < limitY; y++)
      {
         sum += _weights[index] *_layerOutput[y];
         index++;  
      }
      
      _layerOutput[x] = sum;
      _layerSums[x] = sum;
   }
      

   switch(_activation[currentLayer - 1] )
   {
      case 0: // linear
         break;
      case 1:
         ActivationTANH(_layerOutput, outputIndex, outputSize);
break;
      case 2:
         ActivationSigmoid(_layerOutput, outputIndex, outputSize);
         break;
      case 3:
         ActivationElliottSymmetric(_layerOutput, outputIndex, outputSize);
         break;
      case 4:
         ActivationElliott(_layerOutput, outputIndex, outputSize);
        break;
   }
   // update context values
   int offset = _contextTargetOffset[currentLayer];

   for (x = 0; x < _contextTargetSize[currentLayer]; x++)
   {
      _layerOutput[offset + x] = _layerOutput[outputIndex + x];
   }
}

void Compute(double input[], double& output[])
{
   int i,x;
   int sourceIndex = _neuronCount
      - _layerCounts[_layerCount - 1];

   ArrayCopy(_layerOutput,input,sourceIndex,0,_inputCount);
   for(i = _layerCount - 1; i > 0; i--)
{
 ComputeLayer(i);
   }

   // update context values
int offset = _contextTargetOffset[0];

   for(x = 0; x < _contextTargetSize[0]; x++)
{
 _layerOutput[offset + x] = _layerOutput[x];
   }

   ArrayCopy(output,_layerOutput,0,0,_outputCount);
}


//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
      if( iHandle>0 ) 
      {
         FileClose(iHandle);
      }
   
//----
   return(0);
  }
  
  string PadInt(int num, int digits)
{
   string result = num;
   while( StringLen(result)<digits )
   {
      result="0" + result;
   }
   return (result);
}

void WriteExportLine(int pos) 
{
   datetime dt = Time[pos];
   string when = 
      PadInt(TimeYear(dt),4) + 
      PadInt(TimeMonth(dt),2) + 
      PadInt(TimeDay(dt),2) + 
      PadInt(TimeHour(dt),2) + 
      PadInt(TimeMinute(dt),2) + 
      PadInt(TimeSeconds(dt),2);
FileWrite(iHandle, when,
Close[pos]
);
}

double Norm(double x,double normalizedHigh, double normalizedLow, double dataHigh, double dataLow)
{
return (((x - dataLow) 
/ (dataHigh - dataLow))
* (normalizedHigh - normalizedLow) + normalizedLow);
}
double DeNorm(double x,double normalizedHigh, double normalizedLow, double dataHigh, double dataLow) {
return (((dataLow - dataHigh) * x - normalizedHigh
* dataLow + dataHigh * normalizedLow)
/ (normalizedLow - normalizedHigh));
}
  
  
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int countedBars = IndicatorCounted();
   //---- check for possible errors
   if (countedBars<0) return(-1);
   //---- last counted bar will be recounted
   if (countedBars>0) countedBars--;
   
   int pos=Bars-countedBars-1;
   
   static datetime Close_Time;
   
   // only do this on a new bar
   if ( Close_Time != Time[0])
   {
      Close_Time = Time[0];
      while(pos>1)
      {
if( _inputCount>0 && Bars>=4 )
{
double input[5];
double output[1];
input[0]=Norm(Close[pos+0],1.0,-1.0,100000.0,-100000.0);
input[1]=Norm(Close[pos+1],1.0,-1.0,100000.0,-100000.0);
input[2]=Norm(Close[pos+2],1.0,-1.0,100000.0,-100000.0);
input[3]=Norm(Close[pos+3],1.0,-1.0,100000.0,-100000.0);
input[4]=Norm(Close[pos+4],1.0,-1.0,100000.0,-100000.0);
Compute(input,output);
ExtMapBuffer1[pos] = DeNorm(output[0],1.0,-1.0,100000.0,-100000.0);
}
         if( Export )
         {
            WriteExportLine(pos);
         }
         pos--;
      }
   }
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

 

 
NightWalker:

It's not my code. I don't know where did you get this assumption. Probably from bad prediction.

Following: http://www.heatonresearch.com/wiki/Creating_a_MQL4_Indicator_with_Encog, listing below. 

Please   edit   your post . . .    please use the   SRC   button to post code: How to use the   SRC   button. 

 

This code compiles fine in my Meta Editor build 500,  do you have it saved in the correct folder ?  experts/indicators  ? 

 

Regarding directories - is it some new restriction? 

I've tried few different directories, also experts/indicators. I've tried other mql files - for example with ZigZag everything works fine. The button for Compilation is disabled if code listed above is selected.



Situation

 
NightWalker:

Regarding directories - is it some new restriction? 

I've tried few different directories, also experts/indicators. I've tried other mql files - for example with ZigZag everything works fine. The button for Compilation is disabled if code listed above is selected.





I hope that renaming your extensions from mql4 to mq4 helps to solve the issue.
 
NightWalker:

Regarding directories - is it some new restriction? 

I've tried few different directories, also experts/indicators. I've tried other mql files - for example with ZigZag everything works fine. The button for Compilation is disabled if code listed above is selected.

Maybe this is a UAC issue.  Install a test MT4 in C:\MT4Installs\broker_name  then copy your indicator to   C:\MT4Installs\broker_name\experts\indicators  open the  indicator  .mq4  file from there and try to compile it.
 

Hi,

 

since i can not find any reliable information via google I hope to get an answer here:

Has anybody made experiences with running MT4 (Version 500 or prior) on Windows Server 2012 (or Windows 8)?

AND has anybody made experiences with using birt's tick data suite on the newest Windows System?  

I plan to upgrade my VPS but wanted to know about compatibility of MT4 and the tick data suite before that.

 

Thanks a lot and regards! 

 

Disable dragging of trade-levels  in Mt4 :


There has been progress in this matter.

My ticket about it for the Service Desk  in mql5 website  disappeared.


Edit:  Just found a button besides my profile. Clicked on it and here it is

Support Team 2013.06.10 13:48
In next build will be added option to drag'n'drop trade levels only with pressed 'Alt' key.



This is great. It took a long time and I apologize for my sarcastic comment.

Now I am happy, I don´t need to modify my Visual Trade Management EA.

 
fxtrad14:

Disable dragging of trade-levels  in Mt4 :


There has been progress in this matter.

My ticket about it for the Service Desk  in mql5 website  disappeared.

Service Desk did not answer, they just deleted my ticket.


I am calling this progress because about 3 weeks nothing happened.

Superior service from metaquotes.  Wow.

My ticket with the Service Desk still exists and hasn't been answered,  I suggest you raise your Service Desk ticket again . . .
 
RaptorUK:
Maybe this is a UAC issue.  Install a test MT4 in C:\MT4Installs\broker_name  then copy your indicator to   C:\MT4Installs\broker_name\experts\indicators  open the  indicator  .mq4  file from there and try to compile it.


Still nothing - UAC is turned off.
 

Why fight it? Just install it outside \program files* problem solved.