This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community
Critical Error in 164 and DLL'sBack to topics list |
|
reh052965
2005.04.12 09:37
First, how can I submit a very simple example of how to use a DLL in MT4? The example is written in assembly and displays the T3 moving average using a simple moving average filter.
I believe another individual stated having the same problem, but I would like to make sure the issue is addressed in the next release of MT4 (165). The MQ4 code below loads properly initially, but changing the time frame causes a critical error rapidly closing the critical error window and the MT4 Client. The example below is using a DLL; however, this DLL worked fine in MT4 163 and started the aberrant behavior after allowing the update to 164. #property copyright ""
#property link ""
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Yellow
#include <UniTest.mqh>
extern int T3Period = 5;
extern double T3Ring = 0.25;
//---- indicator buffers
double aLine[];
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(1);
IndicatorDigits( MarketInfo( Symbol(), MODE_DIGITS ));
SetIndexStyle(0, DRAW_LINE);
//---- indicator buffers mapping
if( !SetIndexBuffer( 0, aLine ))
Print( "cannot set indicator buffers!" );
//----
SetIndexDrawBegin( 0, 12 );
//----
IndicatorShortName( "UniTest" );
//----
return(0);
}
//+------------------------------------------------------------------+
//| array functions call |
//+------------------------------------------------------------------+
int start()
{
int limit, i, j;
int cntBars = IndicatorCounted();
double lvl00, nArray00[50];
limit = Bars - cntBars;
for( i = 0; i < limit; i++ )
{
for(j = 0; j < 50; j++)
{
nArray00[j] = Close[i + j];
}
lvl00 = T3(T3Period, T3Ring, nArray00);
aLine[i] = lvl00;
}
return(0);
}
//+------------------------------------------------------------------+ |
|
Slawa
2005.04.12 11:22
thanx. this bug is found and will be fixed in the next build.
|
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets
