Create your own MetaTrader extension (dll) - page 8

 
forexmargin:
Hello no body help? Any body can make tutorial for C++2008 please?

The MFC option is only there in the full version, express edition does not have it.

However, you can still use it to compile existing projects that were created with MFC option, like the one provided by Mistigri

 

I want to show a webpage on chart window

hi everybody,

I want to show a webpage on chart window, how can I do that?

When I trade with meta trader4, I think it would be very nice if we can add a webpage into chartwindow, so we can trade and get some information from other page in the same time.

Thanks in advance.

 

How to hide indicators used in DLL

Dear programmers,

This challenge has bothered me for quite some time.

Could someone please share with me how to hide the indicator functions used in ex4, for instance iMA() and iStochastic() in DLL? The main purpose is not to disclose the indicators in the .ex4 file after decompilation.

If it's possible, kindly attach an example, many thanks.

 

Need Help

Hello Traders,

I've been trying for some months now to get/create different TF on my chart e.g 3hr, 5hr, 12hr e.tc but i cannot.. Please, i will be very grateful if you guyz can help me out. I used MT4 broker.

Thank in advance.

 

Thanks.

Thanks man,

This is a very great video. all we need is to practice and see how things go.

Thanks again,

Best wishes,

SF

 
 

Video - Write a DLL for MT4

Just finished a video on how to write a DLL for MT4 ... I tried to make an example that returns an array since it's really what I though was missing when I first started to look into the sample provided by MetaQuotes.

Watch Video

If you are only interested in the code and VS 2008 project, these can be downloaded Here.

Hope you like it

Patrick

 

Are there any updated files or whatnot for this thread?

All of Patrick's links here are dead, his video only plays for a few seconds then stops, and the DLL download on his site is a corrupted archive ...

I'm struggling to learn this stuff and there are literally no tutorials out there anywhere.

Thanks.

V

 

Problem with DLL

Hi all,

After following a video tutorial I was able to create my own simple DLL to compute a simple moving average of the close, the relevant part of the code being

MT4_EXPFUNC void _stdcall GetSMAArray( RateInfo* Rates, int MaximumRecords, int Period, double Result[] )

{

for( int ii = 0; ii < MaximumRecords; ii++)

{

double Sum = 0.0;

for( int kk = 0; kk < Period ; kk++ )

{

Sum += Rates[MaximumRecords-ii-1-kk].close;

}

Result[MaximumRecords-ii-1] = Sum / Period ;

}

}

which worked exactly as expected.

However changing the code to

Sum += ( Rates[MaximumRecords-ii-1-kk].high + Rates[MaximumRecords-ii-1-kk].low + Rates[MaximumRecords-ii-1-kk].close ) / 3;

didn't work, so I changed it back to the original, but now the originally coded DLL doesn't seem to work either. Why? Everything compiles without warnings or errors ( the DLL, the .mqh and .mq4 files ) so I am now at a loss as to what to do. Why should working code cease to work in this situation?

Technical specs - the DLL was compiled using Dev-C++ 4.9.9.2 running on Windows XP SP3 installed as guest OS on Oracle VM Virtualbox in turn running on Ubuntu 10.10 on an AMD64 box.

 

DLL not updating with new ticks

As a follow up to my previous DLL post (#81), I now have an additional problem; when the DLL is called thus:

int start()

{

double Rates[][6];

int MaximumRecords = ArrayCopyRates( Rates, Symbol(), 0 );

for( int zz = MaximumRecords; zz >= 0; zz-- ) { OutPut[zz] = EMPTY; }

GetSMAArray( Rates, MaximumRecords, Periods, OutPut );

return(0);

}

it works fine in that it plots as expected on the chart, but unfortunately it does not update with new, incoming ticks - it just plots on its initial call. What further code can I add to make the DLL update with incoming ticks? Almost all my searches have come up with variations on the use of

ExtCountedBars = IndicatorCounted();

to force a while loop to calculate, but these all apply to calculations contained in the .mq4 file itself. I want to force the DLL to recalculate. Secondly, I would like this recalculation to occur only on the completion of a bar and not on the arrival of all and every tick.