NetTrap Metatrader Expert Advisor

This is a discussion on NetTrap Metatrader Expert Advisor within the Forex Net Trap forums, part of the T2W Archive category; Originally Posted by Tanguero Great will try it this weekend. So much to test... Here's a good thread on the ...

Reply
 
LinkBack Thread Tools Search this Thread
Old Oct 23, 2010, 11:03am   #61
Joined Dec 2006
Re: NetTrap Metatrader Expert Advisor

SpindriftUK started this thread
Quote:
Originally Posted by Tanguero View Post
Great will try it this weekend. So much to test...
Here's a good thread on the subject of backtesting data http://www.forexfactory.com/showthread.php?t=241242

On that thread, someone has posted an enhanced period converter script, which calculates all the higher timeframes from the 1-minute data. I've attached the script to this post - I have just downloaded myself and used it successfully.

Cheers,
Spin
Attached Files
File Type: mq4 All period generator from 1 minute chart.mq4 (4.6 KB, 148 views)
SpindriftUK is offline   Reply With Quote
Old Oct 23, 2010, 2:24pm   #62
Joined May 2010
Re: NetTrap Metatrader Expert Advisor

Quote:
Originally Posted by SpindriftUK View Post
Here's a good thread on the subject of backtesting data http://www.forexfactory.com/showthread.php?t=241242

On that thread, someone has posted an enhanced period converter script, which calculates all the higher timeframes from the 1-minute data. I've attached the script to this post - I have just downloaded myself and used it successfully.

Cheers,
Spin
Thanks for sharing, Spin. I have downloaded MT4 from Alpari.ru and indeed their data is better but now there is a gap between 15 to 21 October! Have downloaded their MT5 as well now though having little luck with 1min data...

Last edited by Tanguero; Oct 23, 2010 at 3:10pm. Reason: making some progress
Tanguero is offline   Reply With Quote
Old Oct 23, 2010, 3:48pm   #63
Joined Dec 2006
Re: NetTrap Metatrader Expert Advisor

SpindriftUK started this thread
Quote:
Originally Posted by Tanguero View Post
Thanks for sharing, Spin. I have downloaded MT4 from Alpari.ru and indeed their data is better but now there is a gap between 15 to 21 October! Have downloaded their MT5 as well now though having little luck with 1min data...
Hi Tanquero

I'm surprised as the recent data is usually automatically loaded when you install or MT. Below are a few questions I would ask myself (and have done on numerous occasions )

Is that section missing from the 1-minute data? If so, did you run the period converter from the 1 minute chart?

What happens if you delete the files in the /history/Alpari-Demo folder and then restart MT? Is the recent data all populated? If so, you could try deleting all the files in both sub-folders in the history folder and then going through the History Center, period convert process again.

Another thing that sometimes works to refresh recent gaps is to use the "refresh" option on the Charts menu.

Cheers,
Spin
SpindriftUK is offline   Reply With Quote
Old Oct 23, 2010, 4:50pm   #64
Joined May 2010
Re: NetTrap Metatrader Expert Advisor

Quote:
Originally Posted by SpindriftUK View Post
Hi Tanquero

I'm surprised as the recent data is usually automatically loaded when you install or MT. Below are a few questions I would ask myself (and have done on numerous occasions )

Is that section missing from the 1-minute data? If so, did you run the period converter from the 1 minute chart?

What happens if you delete the files in the /history/Alpari-Demo folder and then restart MT? Is the recent data all populated? If so, you could try deleting all the files in both sub-folders in the history folder and then going through the History Center, period convert process again.

Another thing that sometimes works to refresh recent gaps is to use the "refresh" option on the Charts menu.

Cheers,
Spin
Finally, got there (after trying various options, including "forget it, I am smart enough to convert into MQL5..."). Deleting all history and downloading 1min worked. Phew, no more double-testing, at one place to check the data before 2010, and another for 2010. And 90% modelling quality... I love it!

Many thanks for help, Spin!
Tanguero is offline   Reply With Quote
Old Oct 23, 2010, 5:41pm   #65
Joined Dec 2006
Re: NetTrap Metatrader Expert Advisor

SpindriftUK started this thread
Quote:
Originally Posted by Tanguero View Post
Finally, got there (after trying various options, including "forget it, I am smart enough to convert into MQL5..."). Deleting all history and downloading 1min worked. Phew, no more double-testing, at one place to check the data before 2010, and another for 2010. And 90% modelling quality... I love it!

Many thanks for help, Spin!
I know what you mean about mql5!

I'm glad you got it sorted - I know how frustrating it can be.


Maybe those of us who're interested in backtesting could develop some sort of test strategy - save duplicating effort.

Cheers,
Spin
SpindriftUK is offline   Reply With Quote
Old Oct 23, 2010, 11:34pm   #66
Joined May 2010
Re: NetTrap Metatrader Expert Advisor

Quote:
Originally Posted by SpindriftUK View Post
I know what you mean about mql5!

I'm glad you got it sorted - I know how frustrating it can be.


Maybe those of us who're interested in backtesting could develop some sort of test strategy - save duplicating effort.

Cheers,
Spin
I think I know why I was dreaming snails last night: the backtesting now is even slower now with 'pure' data. Still, it's a good idea, I may commit a few hours a week.
Tanguero is offline   Reply With Quote
Old Oct 24, 2010, 11:57am   #67
Joined Dec 2006
Re: NetTrap Metatrader Expert Advisor

SpindriftUK started this thread
Quote:
Originally Posted by Tanguero View Post
I think I know why I was dreaming snails last night: the backtesting now is even slower now with 'pure' data. Still, it's a good idea, I may commit a few hours a week.
Yeah, I know what you mean! I might be able to speed things up by omitting the program's pre-start time calculations when testing. I'll have a look at the possibilities.
SpindriftUK is offline   Reply With Quote
Old Oct 24, 2010, 8:36pm   #68
Joined May 2010
Re: NetTrap Metatrader Expert Advisor

Quote:
Originally Posted by SpindriftUK View Post
Yeah, I know what you mean! I might be able to speed things up by omitting the program's pre-start time calculations when testing. I'll have a look at the possibilities.
I was actually talking about my own code, am looking into how to speed it up.
Tanguero is offline   Reply With Quote
Old Oct 25, 2010, 11:52am   #69
Joined Oct 2010
Re: NetTrap Metatrader Expert Advisor

Quote:
Originally Posted by Tanguero View Post
I was actually talking about my own code, am looking into how to speed it up.
Hi Spin
Would you mind sending me the source code pls? My husband is a very good programmer and is paranoid about using programmes where he cant see the source code. Also if you need any help with anything due to time restraints etc pls let me know. Thanks
gillybabe is offline   Reply With Quote
Old Oct 25, 2010, 12:59pm   #70
Joined May 2009
Re: NetTrap Metatrader Expert Advisor

Quote:
Originally Posted by gillybabe View Post
Hi Spin
Would you mind sending me the source code pls? My husband is a very good programmer and is paranoid about using programmes where he cant see the source code. Also if you need any help with anything due to time restraints etc pls let me know. Thanks
Pretty sure the reason why he didn't give the ex.4 file is to protect his work.

If your husband is a good programmer, perhaps he could build a similar EA?

PM Spin as posting ex4 files on forums can lead to pirate copies very quickly.
Dubai is offline Trading system vendor   Reply With Quote
Old Oct 25, 2010, 1:20pm   #71
Joined Oct 2010
Re: NetTrap Metatrader Expert Advisor

Quote:
Originally Posted by Dubai View Post
Pretty sure the reason why he didn't give the ex.4 file is to protect his work.

If your husband is a good programmer, perhaps he could build a similar EA?

PM Spin as posting ex4 files on forums can lead to pirate copies very quickly.
Apologies - I did not mean to upset anyone. I just dont believe in dupicating work and wasting time when we are all after the same thing - money. I will PM Spin regarding this.
gillybabe is offline   Reply With Quote
Old Oct 25, 2010, 1:49pm   #72
Joined Dec 2006
Re: NetTrap Metatrader Expert Advisor

SpindriftUK started this thread
Quote:
Originally Posted by gillybabe View Post
Apologies - I did not mean to upset anyone. I just dont believe in dupicating work and wasting time when we are all after the same thing - money. I will PM Spin regarding this.
I did offer to send the source to anyone who's interested and am still happy to do so. The reason I didn't post the source to the forum is that I don't want umpteen versions flying around - it just gets too confusing

Btw, I don't think it's possible to add attachments to PMs (please correct me I'm wrong and tell me how to do it ). If you want to see the source, therefore, please PM me your email address.

Cheers,
Spin
SpindriftUK is offline   Reply With Quote
Old Oct 25, 2010, 1:58pm   #73
Joined Feb 2008
Re: NetTrap Metatrader Expert Advisor

Quote:
Originally Posted by SpindriftUK View Post
Hi

Not silly at all - I still get caught out by MTs various settings when I load a new copy!

The first thing to check are the settings in Metatrader relating to EAs. Go to Tools/Options and select the Expert Advisors tab. I have attached a screenshot of my settings.

Trade amount is calculated if you set the useMoneyManagement parameter to true or set equal to the lots parameter if not.

What I often do to test my settings is to drag the EA onto the chart then set the start and end times to be about an hour ahead. The EA will display the "likely" values for the trade right up until the startHHMM value, at which time will create the trade.

Let me know how you get on...

Cheers,
Spin
Hi Spin,

Thanks so much for your help and this EA. Been testing it on various settings on a demo a SML and it works brilliantly. Plan to go live in a few weeks, very excited.

I hope you don't mind, I have two questions. T

The 'checkSR' option....How does it calculate the support and restistance levels?

The option 'checkPivot'. Have you put this in because you think it could be a good 'entry' filter? I am fascinated by this as I have been monitoring the daily pivot and was thinking it using at as an entry filter myself.

Best regards

Charlie
pimplico is offline   Reply With Quote
Old Oct 25, 2010, 2:44pm   #74
Joined Dec 2006
Re: NetTrap Metatrader Expert Advisor

SpindriftUK started this thread
Quote:
Originally Posted by pimplico View Post
Hi Spin,

Thanks so much for your help and this EA. Been testing it on various settings on a demo a SML and it works brilliantly. Plan to go live in a few weeks, very excited.

I hope you don't mind, I have two questions. T

The 'checkSR' option....How does it calculate the support and restistance levels?

The option 'checkPivot'. Have you put this in because you think it could be a good 'entry' filter? I am fascinated by this as I have been monitoring the daily pivot and was thinking it using at as an entry filter myself.

Best regards

Charlie
Hi Charlie

It firstly counts the number of times the high, low or close of a bar hits each price point (in the range of bars on the current chart calculated from SRLookBackDays). It then looks through all the counts and works out the nearest price point that has had the required number of hits (calculated as SRHitPerc percent of the number of bars in the range.)

If this fails to find any s/r, the program uses the nearest of the standard S/R points, as calculated as part of the Pivot point routine (which I took from an indicator called PivotsDaily, which probably came from the MetaQuotes site. (In this situation, if the price is the "wrong" side of the pivot, the pivot will be used as the first line of s/r.)

Yes, the checkPivot acts as filter and will stop the EA entering a trade if the entry price is the "wrong side" of the pivot.

Here's the pivot calculation the EA is using:

yesterday_close = iClose(Symbol(),PERIOD_D1,1);
yesterday_open = iOpen(Symbol(),PERIOD_D1,1);
today_open = iOpen(Symbol(),PERIOD_D1,0);
yesterday_high = iHigh(Symbol(),PERIOD_D1,1);
yesterday_low = iLow(Symbol(),PERIOD_D1,1);
day_high = iHigh(Symbol(),PERIOD_D1,0);
day_low = iLow(Symbol(),PERIOD_D1,0);

// calculate yesterday's range
checkRange = (yesterday_high - yesterday_low);

// if yesterday's range is very small and today is a Monday,
// treat day before as yesterday
if (DayOfWeek() == 1 && checkRange < 20)
{
yesterday_close = iClose(Symbol(),PERIOD_D1,2);
yesterday_open = iOpen(Symbol(),PERIOD_D1,2);
yesterday_high = iHigh(Symbol(),PERIOD_D1,2);
yesterday_low = iLow(Symbol(),PERIOD_D1,2);
}
//---- Calculate Pivots

D = (day_high - day_low);
Q = (yesterday_high - yesterday_low);
P = NormalizeDouble((yesterday_high + yesterday_low + yesterday_close) / 3,symbolDigits);
R1 = NormalizeDouble((2*P)-yesterday_low,symbolDigits);
S1 = NormalizeDouble((2*P)-yesterday_high,symbolDigits);
R2 = NormalizeDouble(P+(yesterday_high - yesterday_low),symbolDigits);
S2 = NormalizeDouble(P-(yesterday_high - yesterday_low),symbolDigits);

H4 = (Q*0.55)+yesterday_close;
H3 = (Q*0.27)+yesterday_close;
R3 = NormalizeDouble((2*P)+(yesterday_high-(2*yesterday_low)),symbolDigits);
M5 = (R2+R3)/2;
M4 = (R1+R2)/2;
M3 = (P+R1)/2;
M2 = (P+S1)/2;
M1 = (S1+S2)/2;
S3 = NormalizeDouble((2*P)-((2* yesterday_high)-yesterday_low),symbolDigits);
L3 = yesterday_close-(Q*0.27);
L4 = yesterday_close-(Q*0.55);
M0 = (S2+S3)/2;

if (Q > 5)
{
nQ = Q;
}
else
{
nQ = Q*10000;
}

if (D > 5)
{
nD = D;
}
else
{
nD = D*10000;
}


Some of the above is redundant in the Net Trap EA.

Hope this helps!

Cheers,
Greg
SpindriftUK is offline   Reply With Quote
Old Oct 25, 2010, 4:17pm   #75
Joined Feb 2008
Re: NetTrap Metatrader Expert Advisor

Perfect. Many thanks!
pimplico is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Metatrader Expert advisor losses money automatically oildaytrader Trading Software 3 Oct 5, 2009 4:11pm
expert advisor anguel First Steps 0 Apr 10, 2009 10:54am
Expert Advisor Help mozillan Trading Software 0 Mar 1, 2007 5:49pm

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)