Jump to content

Megadroid Pro (links first post)


Recommended Posts

Re: Megadroid Pro

 

It is a good idea not to run MD and FAP (or any other EA) on the same pairs if you are using US brokers. Not only they disallow hedging, but from August on they fall under FIFO rule. Orders will have to be closed out in the order they were opened which may not be profitable....

Link to comment
Share on other sites

  • Replies 2.1k
  • Created
  • Last Reply

Top Posters In This Topic

Re: Megadroid Pro

 

What I am really working towards is seeing if a free dll version can be created. I don't care about auto-GMT, it looks to me like the system rules are still in the mq4 file not the dll but can anyone confirm if this is true?? I am not sure yet how to modify the rule calls for no dll mode.

Hi,

 

Here are the trading check functions and auto utc time:

 

#import "kernel32.dll"

int GetCurrentProcessId();

void GetLocalTime(int& TimeArray[]);

int GetTimeZoneInformation(int& TZInfoArray[]);

#import

 

 

datetime UtcTime() {

int TimeArray[4];

int TZInfoArray[43];

GetLocalTime(TimeArray);

int nYear=TimeArray[0]&0x0000FFFF;

int nMonth=TimeArray[0]>>16;

int nDay=TimeArray[1]>>16;

int nHour=TimeArray[2]&0x0000FFFF;

int nMin=TimeArray[2]>>16;

int nSec=TimeArray[3]&0x0000FFFF;

int nMilliSec=TimeArray[3]>>16;

string sMilliSec=1000+nMilliSec;

sMilliSec=StringSubstr(sMilliSec,1);

string time_string=FormatDateTime(nYear,nMonth,nDay,nHour,nMin,nSec);

int gmt_shift=0;

int ret=GetTimeZoneInformation(TZInfoArray);

if(ret!=0) gmt_shift=TZInfoArray[0];

if(ret==2) gmt_shift+=TZInfoArray[42];

datetime local_time=StrToTime(time_string);

return(local_time+gmt_shift*60);

}

 

string FormatDateTime(int nYear,int nMonth,int nDay,int nHour,int nMin,int nSec)

{

string sMonth,sDay,sHour,sMin,sSec;

sMonth=100+nMonth;

sMonth=StringSubstr(sMonth,1);

sDay=100+nDay;

sDay=StringSubstr(sDay,1);

sHour=100+nHour;

sHour=StringSubstr(sHour,1);

sMin=100+nMin;

sMin=StringSubstr(sMin,1);

sSec=100+nSec;

sSec=StringSubstr(sSec,1);

return(StringConcatenate(nYear,".",sMonth,".",sDay," ",sHour,":",sMin,":",sSec));

}

 

bool s1_Buy(double ask, double icci1, double irsi1, double irsi2, double ima1, double gd284, double gd300, double minpips, bool useIMA, bool useRSI)

{

if (icci1 < 0)

{

if ( useIMA )

if (ima1 - ask < minpips) return(0);

 

if ( gd284 > irsi1 ) return(1);

 

if ( useRSI )

if (gd300 > irsi2 && irsi1 < 50 ) return(1);

}

return (0);

}

 

bool s1_Sell(double bid, double icci1, double irsi1, double irsi2, double ima1, double gd276, double gd292, double minpip, bool useIMA, bool useRSI)

{

if (icci1 > 0)

{

if ( useIMA )

if (bid - ima1 < minpip ) return(0);

 

if ( gd276 < irsi1 ) return(1);

 

if (useRSI)

if (gd292 < irsi2 && irsi1 > 50 ) return(1);

}

return(0);

}

 

bool s2_Buy(double ask, double bid, double icci1, double icci2, double ilow, double ihigh, bool useICI1, bool useICI2)

{

if (ilow < ask ) return(0);

 

if (useICI1)

if (icci1 >= 0) return(0);

 

if (useICI2)

if (icci2 < icci1) return(0);

 

if (ihigh - ilow > ask - bid) return(1);

 

return(0);

}

 

bool s2_Sell(double ask, double bid, double icci1, double icci2, double ilow, double ihigh, bool useICI1, bool useICI2)

{

if (ihigh > bid) return(0);

 

if (useICI1)

if (icci1 <= 0) return(0);

 

if (useICI2)

if (icci2 > icci1) return(0);

 

if (ihigh - ilow > ask - bid) return(1);

 

return(0);

}

 

 

 

-----------------END------------------

 

If any variable missing just add it.

 

This logic are the same as the MDv1.11

 

Have fun!

Link to comment
Share on other sites

Re: solution to the crashing

 

Don, great work, especially in discovering the cause of the crash. Intermittent/random crashes are difficult to pin down because you don't really know when they'll happen.

 

But I think running multiple instances is a messy solution. There must be a cleaner solution. e.g. Have you tried simply disabling (commenting out) these calls to the DLL functions:

Increment()

Decrement()

Quantity()

 

These are the new DLL functions that handle risk-based position sizing when trading multiple symbols using the same DLL. Please try it, as I am fairly confident that commenting these out would work.

 

I checked the DLL and it is playing with a global variable only:

 

int GCounter

 

void Increment()

{

Gcounter++;

}

 

void Decrement()

{

Gcounter--;

if (Gcounter < 0 ) Gcoutner = 0;

}

 

int Quantity()

{

return(Gcounter);

}

 

-------------END-----------

 

Thats all.

 

Br.

Link to comment
Share on other sites

Re: Megadroid Pro

 

Dear friends,

 

We all know that backtesting is not 100% certain for neither good nor bad results.

 

But I think that Megadroid is having some trouble since july,2008, at least in eurusd pair.

 

And since this new pro version can be suitable for other pairs usdcad is having some trouble too.

 

Are you having the same results?

 

The eurgbp backtest is ok, and looks profitable in this period. The same occurs with eurchf.

 

I´d like you to test these too eurusd and usdcad, since july,2008.

 

Thanks a lot.

 

PS: I testing with ee2x.

Link to comment
Share on other sites

Re: Megadroid Pro

 

Hi everybody,

 

I feel the reason for poor performance of EURUSD in Backtesting in recent weeks might be in the GMT setting.

Actually, I feel very confused with GMT settings on the PRO version anyway :

 

In my case, as I am on Alpari, the correct setting (for the period from April this year until now)

should be GMT=2, as we are at DST. On forward testing this is also the setting which the EA will take ,

if AUTOGMT is activated.

 

However the manual of MDPRO is advising to use GMT=1 for backtesting at Alpari,

and in fact , on the 3 NEW pairs, GMT=1 results in better backtest results than GMT=2

(even through this period from April until now, in which Alpari actually is at GMT =2)

 

However on EURUSD it is exactly the other way round, GMT=2 results in much better results than GMT=1:

GMT=2 had No loosing trade in July at all (which also mirrors the results I had using MD Live forward at Alpari during this time)

whereas GMT=1 had 3 loosing trades.

 

See backtest in attached file for comparisson for EURUSD (better at GMT 2)

and as an example for the new pairs: EURCHF which is better at GMT 1

 

www*filefactory*com/file/ahed9b6/n/Statements_rar

 

So, I am right to assume, to replicate these good backtest results in forward / live trading on all pairs,

in the case of Alpari, on EURUSD we should set GMT=2 (or leave it at autogmt),

whereas on the other 3 new pairs (and probably also on any other additional pair which would be added) ,

autogmt should be disabled and GMT=1 should be set ?

 

Then, the question is still , how should we proceed with GMT setting when going back to standard time

in late October ? EURUSD = GMT=1 and all other pairs GMT = 0 ?

 

Hope anybody could shed some light into this...

 

 

 

Cheers,

 

Michael

Link to comment
Share on other sites

Re: Megadroid Pro

 

When I try to backtest with the pro version that yellowfish posted that lets you change the trading window, the robot still places trades 21.00-23.00 GMT like the original

 

Has anyone else noticed this?

 

Well, I got it to where I can move around the S1 time window.. But the S2 (agressive) still trades around 00:00 time.. I've almost got it.. Turns out the dll can change the trade time.. Which is cool.. Like I said I got S1 to move where I want it.. But if you turn agressive (S2) on its always around 0 time.. I have a diner to go to but I'll look at it more tomorrow.. My hope it to add three seperate time windows to this.. And not have to play with the gmt offset thing..

 

edit:: oh you know what.. i was sitting here thinking i should always make the agressive trade happen at the same time as the normal time by default.. and then setup 3 different time windows available.. the agressive then could be turned on/off for each of three windows, but if it was enabled it would be traded within the same tick as the normal trade, if triggered...

 

ok cool... be back..

 

one more edit::: I want to make sure everyone knows that I have been monitoring my firewall on the internet and I can tell you FOR SURE that this version that Don posted last; DOES NOT Phone Home... The only traffic I have coming from that test laptop is to my broker and the mt4stat page...

Link to comment
Share on other sites

Re: Megadroid Pro

 

#import "kernel32.dll"

int GetCurrentProcessId();

void GetLocalTime(int& TimeArray[]);

int GetTimeZoneInformation(int& TZInfoArray[]);

#import

 

In the new MegaDroid Pro version I don't see any import of kernel32.dll from the expert advisor code and no functions UTCTime() and FormatDateTime().

Are you actually looking at an older version?

 

I only see a new DLL function GetGmtOffset() that is in MegaDroidPro.dll. This function loads the web page http://forex-megadroid.com/timetest.php to get the current UTC time from the MegaDroid web server. Though I can also see that this function calls another function that calls GetSystemTimeAsFileTime from Kernel32 (in case it can't load the web page?).

Link to comment
Share on other sites

Re: Megadroid Pro

 

Hi everybody,

I feel very confused with GMT settings on the PRO version anyway :

 

I've wrestled with the UTC offset issue myself.

 

I advise not to use Alpari data as it has thousands of holes as well as different UTC offsets at different times of each year. If you want to use such data, you'd have to handle the UTC switching in your code. It's better instead to just use good quality data from somewhere else that has a constant UTC offset. That means looking somewhere other than the MetaTrader History Center.

 

If anyone has high quality historical data (e.g. Oanda's tick data: https://fxtrade.oanda.com/your_account/historical_tick_by_tick_data.shtml) please share it.

Link to comment
Share on other sites

Re: solution to the crashing

 

I think another possible cause of the crashing is that the DLL file was not patched properly, and part of it became corrupted.

I'm starting to think that this may actually be the real cause, because when examining the code and the DLL I can't see any other more likely cause.

 

How exactly was it patched?

Link to comment
Share on other sites

Re: Megadroid Pro

 

Hi, bbrain,

 

Can you find out what s1_Init() and s2_Init() do?

 

From what I can see, the s1_init functions check the correct currency & relay back the correct variables for each currency or an error if its not the correct currency. To free this from the dll you need to find out the variables for each pair & set them up directly in the mq4 code instead of making the s1_init call to the dll. (hence why I put in the code to show these on the screen, if you look at the screen shots I posted previously you can see the different variable values).

 

So that one is easy to get around, its just taking a lot of time to work thru the other functions...probably run out of time before going back to work!. I actually found the previous version v1.11 easier to work with, they have changed all the print & comment functions now.

Link to comment
Share on other sites

Re: Megadroid Pro

 

Can you find out what s1_Init() and s2_Init() do?

They simply set values for sets of parameters for strategy 1 and strategy 2. They'd be values that the MegaDroid team found to be optimal. I believe they put all the actual values in the DLL file in order to hide them. They can easily be found by writing MQL code to print the values out. You guys should try it yourself as a programming exercise.

Link to comment
Share on other sites

Re: Megadroid Pro

 

#import "kernel32.dll"

int GetCurrentProcessId();

void GetLocalTime(int& TimeArray[]);

int GetTimeZoneInformation(int& TZInfoArray[]);

#import

 

In the new MegaDroid Pro version I don't see any import of kernel32.dll from the expert advisor code and no functions UTCTime() and FormatDateTime().

Are you actually looking at an older version?

 

I only see a new DLL function GetGmtOffset() that is in MegaDroidPro.dll. This function loads the web page http://forex-megadroid.com/timetest.php to get the current UTC time from the MegaDroid web server. Though I can also see that this function calls another function that calls GetSystemTimeAsFileTime from Kernel32 (in case it can't load the web page?).

 

Well i have mine set to no auto and I get NO traffic to any site except broker and mt4stat..

 

I would sure recommend you turn auto gmt OFF if its calling home as they say...

 

depending on what type of firewall you have go out and get your self wallwatcher.. you can monitor most traffic leaving your system... And for best build yourself your own firewall using software ipcop.org..

Link to comment
Share on other sites

Re: Megadroid Pro

 

Hi, bbrain,

 

Can you find out what s1_Init() and s2_Init() do?

 

Hi,

 

Yes, it is fills the initaila parameters depending on the pair:

S1

EURUSD

260: 10 | 268: 150 | 272: 40 | 276: 0 | 288: 6 | 292: 20 | 296: 8| 300: 70.00000000 |308: 30.00000000| 316: 70.00000000| 324: 30.00000000| 372: 12.00000000| 384: 1.00000000 | 392: 1.00000000 |404: 4 |416: 21 |420: 23 |424: 21 |428: 23 | 256:15

EURGBP

260: 6 | 268: 120 | 272: 40 | 276: 0 | 288: 6 | 292: 20 | 296: 16| 300: 70.00000000 | 308: 30.00000000| 316: 64.00000000| 324: 36.00000000| 372: 3.00000000| 384: 1.00000000 | 392: 1.00000000 |404: 6 |416: 21 |420: 0 |424: 21 |428: 23 | 256: 5

EURCHF

260: 10 | 268: 120 | 272: 40 | 276: 0 | 288: 6 | 292: 20 | 296: 8| 300: 70.00000000 | 308: 30.00000000| 316: 64.00000000| 324: 36.00000000| 372: 4.00000000| 384: 1.00000000 | 392: 1.00000000 |404: 6 |416: 21 |420: 0 |424: 21 |428: 23 | 256: 5

USDCHF

260: 10 | 268: 150 | 272: 30 | 276: 0 | 288: 6 | 292: 20 | 296: 8| 300: 70.00000000 | 308: 30.00000000| 316: 70.00000000| 324: 30.00000000| 372: 12.00000000| 384: 1.00000000 | 392: 1.00000000 |404: 6 |416: 21 |420: 23 |424: 21 |428: 23 | 256: 5

 

 

S2

EURUSD

432: 5 | 436: 15 | 444: 150 | 448: 30 | 452: 2.00000000 | 460: 0 | 472: 36 | 476: 168 | 480: 275 | 496: 1.00000000 | 504: 10.00000000 | 512: 12.00000000 | 528: 4 | 540: 22 | 544: 23 | 548: 22 | 552: 23

EURGBP

432: 5 | 436: 6 | 444: 120 | 448: 60 | 452: 1.00000000 | 460: 0 | 472: 12 | 476: 168 | 480: 275 | 496: 1.00000000 | 504: 10.00000000 | 512: 12.00000000 | 528: 5 | 540: 22 | 544: 23 | 548: 22 | 552: 23

EURCHF

432: 5 | 436: 15 | 444: 150 | 448: 40 | 452: 2.00000000 | 460: 0 | 472: 12 | 476: 46 | 480: 275 | 496: 1.00000000 | 504: 2.00000000 | 512: 5.00000000 | 528: 6 | 540: 22 | 544: 0 | 548: 22 | 552: 0

USDCHF

432: 5 | 436: 10 | 444: 100 | 448: 60 | 452: 3.00000000 | 460: 0 | 472: 12 | 476: 70 | 480: 275 | 496: 1.00000000 | 504: 4.00000000 | 512: 18.00000000 | 528: 5 | 540: 22 | 544: 23 | 548: 22 | 552: 23

 

The numbers: 260 = gi_260 , 288 = g_period_288 etc...

 

Br.

Link to comment
Share on other sites

Re: Megadroid Pro

 

#import "kernel32.dll"

int GetCurrentProcessId();

void GetLocalTime(int& TimeArray[]);

int GetTimeZoneInformation(int& TZInfoArray[]);

#import

 

In the new MegaDroid Pro version I don't see any import of kernel32.dll from the expert advisor code and no functions UTCTime() and FormatDateTime().

Are you actually looking at an older version?

 

I only see a new DLL function GetGmtOffset() that is in MegaDroidPro.dll. This function loads the web page http://forex-megadroid.com/timetest.php to get the current UTC time from the MegaDroid web server. Though I can also see that this function calls another function that calls GetSystemTimeAsFileTime from Kernel32 (in case it can't load the web page?).

 

 

Hi,

 

No, this is the workaround. The md dll does the same thing.

 

Br.

Link to comment
Share on other sites

Re: Megadroid Pro

 

hope we can have a dll free version

 

I managed to make a DLL-free version of the previous MegaDroid, though without some features and only for Strategy 1. They've added a few more things to this new version which makes it a bit more work to set it free of the DLL, but it's not impossible.

 

 

Attached the fully functioning MD v1.11 both S1 and S2 works as the original.

 

Br.

Link to comment
Share on other sites

Re: Megadroid Pro

 

Attached the fully functioning MD v1.11 both S1 and S2 works as the original.

 

 

Brilliant work, bbrain ! ^:)^ It makes possible to create a Dll free MDPro educated edition if the S1_Buy/Sell S2_Buy/Sell logic are the same in both versions. My guess is that you probably already working on that ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...