Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools

Metatrader Forum | Forex Expert-Advisor | Broker & Forex Tools (http://www.expert-advisor.com/forum/index.php)
-   Programmierung MQL4 (http://www.expert-advisor.com/forum/forumdisplay.php?f=220)
-   -   event handling function not found?! (http://www.expert-advisor.com/forum/showthread.php?t=5249)

Trader6666 28.10.16 14:11

event handling function not found?!
 
Hey Leute ,

versuch grad an meinen sachen zu arbeiten , aber ich bekomm beim kompilieren immer den Fehler "event handling function not found" .

Hab mal gegoogelt und paar sachen ausprobiert wie start() init() etc. gelöscht und wieder rein gehauen aber ohne erfolg.


Hab mal auf New geklickt und ein Grundgerüst eines Indikators erstellt , siehe da, auch dort wird der gleiche Fehler angezeigt:confused::confused:

Bei aktuellen geschriebenen Indikatorn wird beim kompilieren erst der Fehler "EX4 write error" wiedergegeben und nach dem erneuten speichern im Indicators Ordner, eben wieder das event handling problem.

Weiß einer woran das liegen kann?? Hab den Fehler seit heute, sprich nachdem ich CCleaner laufen lassen hab, aber daran kanns ja ned wirklich liegen, hab das ja auch zuvor gemacht.

LG

traderdoc 28.10.16 15:40

Ja nun? Code senden oder zumindest verraten, welche Events denn aufgerufen werden.
Aber der Code ist immer der erste Schritt!

traderdoc

Trader6666 28.10.16 16:14

Die Fehlermeldung bekomm ich ausnahmslos bei allen Files völlig gleich ob Custom oder MT4-Standart. als Beispiel hier unten der ATR Indikator, dennoch immer wieder die gleiche Fehlermeldung


Code:

//+------------------------------------------------------------------+
//|                                                          ATR.mq4 |
//|                  Copyright 2005-2014, MetaQuotes Software Corp. |
//|                                              http://www.mql4.com |
//+------------------------------------------------------------------+
#property copyright  "2005-2014, MetaQuotes Software Corp."
#property link        "http://www.mql4.com"
#property description "Average True Range"
#property strict

//--- indicator settings
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1  DodgerBlue
//--- input parameter
input int InpAtrPeriod=14; // ATR Period
//--- buffers
double ExtATRBuffer[];
double ExtTRBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                        |
//+------------------------------------------------------------------+
int OnInit(void)
  {
  string short_name;
//--- 1 additional buffer used for counting.
  IndicatorBuffers(2);
  IndicatorDigits(Digits);
//--- indicator line
  SetIndexStyle(0,DRAW_LINE);
  SetIndexBuffer(0,ExtATRBuffer);
  SetIndexBuffer(1,ExtTRBuffer);
//--- name for DataWindow and indicator subwindow label
  short_name="ATR("+IntegerToString(InpAtrPeriod)+")";
  IndicatorShortName(short_name);
  SetIndexLabel(0,short_name);
//--- check for input parameter
  if(InpAtrPeriod<=0)
    {
      Print("Wrong input parameter ATR Period=",InpAtrPeriod);
      return(INIT_FAILED);
    }
//---
  SetIndexDrawBegin(0,InpAtrPeriod);
//---
  return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Average True Range                                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
  int i,limit;
//--- check for bars count and input parameter
  if(rates_total<=InpAtrPeriod || InpAtrPeriod<=0)
      return(0);
//--- counting from 0 to rates_total
  ArraySetAsSeries(ExtATRBuffer,false);
  ArraySetAsSeries(ExtTRBuffer,false);
  ArraySetAsSeries(open,false);
  ArraySetAsSeries(high,false);
  ArraySetAsSeries(low,false);
  ArraySetAsSeries(close,false);
//--- preliminary calculations
  if(prev_calculated==0)
    {
      ExtTRBuffer[0]=0.0;
      ExtATRBuffer[0]=0.0;
      //--- filling out the array of True Range values for each period
      for(i=1; i<rates_total; i++)
        ExtTRBuffer[i]=MathMax(high[i],close[i-1])-MathMin(low[i],close[i-1]);
      //--- first AtrPeriod values of the indicator are not calculated
      double firstValue=0.0;
      for(i=1; i<=InpAtrPeriod; i++)
        {
        ExtATRBuffer[i]=0.0;
        firstValue+=ExtTRBuffer[i];
        }
      //--- calculating the first value of the indicator
      firstValue/=InpAtrPeriod;
      ExtATRBuffer[InpAtrPeriod]=firstValue;
      limit=InpAtrPeriod+1;
    }
  else
      limit=prev_calculated-1;
//--- the main loop of calculations
  for(i=limit; i<rates_total; i++)
    {
      ExtTRBuffer[i]=MathMax(high[i],close[i-1])-MathMin(low[i],close[i-1]);
      ExtATRBuffer[i]=ExtATRBuffer[i-1]+(ExtTRBuffer[i]-ExtTRBuffer[i-InpAtrPeriod])/InpAtrPeriod;
    }
//--- return value of prev_calculated for next call
  return(rates_total);
  }
//+------------------------------------------------------------------+



Alle Zeitangaben in WEZ +2. Es ist jetzt 09:32 Uhr.

Powered by vBulletin® Version 3.8.5 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.1
Powered by vBCMS® 2.7.0 ©2002 - 2024 vbdesigns.de
Copyright ©2009 - 2023 by Expert-Advisor.com - Das Metatrader Forum