POOLER/SAN Stunning generosity
-
garyfritz
Re: POOLER/SAN Stunning generosity
It would be nice if such a pricey EA included a few more comments, too.
- Baluda
- Trader
- Posts: 330
- Joined: Mon Feb 06, 2012 2:00 pm
- Location: An insignificant village in the Netherlands
Re: POOLER/SAN Stunning generosity
You are right, for a coder this EA looks like a spaghetti western. Keep in mind though that we are talking to non coders too. It is easier to just intialize the global variables locally. If this EA is any good someone should do a serious rewrite, I'm sure more issues, dare I say bugs, will surface.dlewisfl wrote:There are other variables defined globally that should be defined locally, as well as other inefficiencies (e.g. not using arrays and copy/pasting code unnecessarily, the number of times he reads through the order pool each tick, using the error message function in the source instead of using an include, needlessly defining variables). The source file for this EA could easily be ~500 lines instead of the 1400+ and be much more efficient.
Paul
Check the MQL4 Market for my best EA's and Indicators.
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Re: POOLER/SAN Stunning generosity
I have started to clean it up - replacing Point with factor, adding CloseEnough etc, as well as removing all those Print() statements that were gumming up the log files. I will put it up later and you guys can have another look.Baluda wrote:You are right, for a coder this EA looks like a spaghetti western. Keep in mind though that we are talking to non coders too. It is easier to just intialize the global variables locally. If this EA is any good someone should do a serious rewrite, I'm sure more issues, dare I say bugs, will surface.dlewisfl wrote:There are other variables defined globally that should be defined locally, as well as other inefficiencies (e.g. not using arrays and copy/pasting code unnecessarily, the number of times he reads through the order pool each tick, using the error message function in the source instead of using an include, needlessly defining variables). The source file for this EA could easily be ~500 lines instead of the 1400+ and be much more efficient.
Paul
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
-
maxpain
- Posts: 4
- Joined: Wed Sep 26, 2012 2:24 am
Re: POOLER/SAN Stunning generosity
I was watching the market reaction after NFP and as usual it moved in one direction v.quick to retrace back. This gave me an idea, dont know if its codeable into this EA, but it may gain more pips. In the event of any Major News event would it make sense to reverse your strategy i.e before the news, we change the Buy Limit/Sell Limit to Buy Stop/Sell Stop, and when it retraces back could end up making more pips using Sell Stops?Pooler wrote:Thanks all,
Here's that last GU trade after NFP. See what I mean re OR levels acting as S/R levels. Which kinda makes sense as they are derived from the Average Daily Range.
Just per info. For three months (April, May June) I demo-traded a $ 1000 account with 25 pairs with the aim of making $15 per day. My goal was 10 pairs to fill each day starting at .01 lots making an av of $ 1.50 per day (per pair) x av. of 20 trading days = $ 300 per month which is 30% growth per month. I ended on $1921 after the 3 months then upped my starting lot size to .02 and promptly *Eish* blew my account.
Therein I suppose is the lesson...what is the correct money management discipline here.
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Re: POOLER/SAN Stunning generosity
I have done some code-cleaning. Please see 'Two versions' in post one - should cause some of you a sardonic grin.

Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Re: POOLER/SAN Stunning generosity
I only just read this, Paul. I have added the initialisation to V1.Baluda wrote:I found this code issue:
Variables R5, R10 and R20 are NOT initialized. Please change to this:Code: Select all
void CalculateADR() { int i=0; R1 = (iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1))/Point; for(i=1;i<=5;i++) R5 = R5 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point; for(i=1;i<=10;i++) R10 = R10 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point; for(i=1;i<=20;i++) R20 = R20 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point; ...
and recompile.Code: Select all
void CalculateADR() { int i=0; R1 = 0; R5 = 0; R10 = 0; R20 = 0; R1 = (iHigh(NULL,PERIOD_D1,1)-iLow(NULL,PERIOD_D1,1))/Point; for(i=1;i<=5;i++) R5 = R5 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point; for(i=1;i<=10;i++) R10 = R10 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point; for(i=1;i<=20;i++) R20 = R20 + (iHigh(NULL,PERIOD_D1,i)-iLow(NULL,PERIOD_D1,i))/Point; ...
Paul
Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Re: POOLER/SAN Stunning generosity
I see that 5 of you downloaded the new file before I added Paul's variables initialisation. Bear that in mind those 5, and add the mod or re-download.

Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.
-
dlewisfl
Re: POOLER/SAN Stunning generosity
There looks to be a bug where he saves info to the global varables. He copy/pasted a line and forgot to change two of the names (in function subSaveValues). He executes the same statement twice.Baluda wrote:You are right, for a coder this EA looks like a spaghetti western. Keep in mind though that we are talking to non coders too. It is easier to just intialize the global variables locally. If this EA is any good someone should do a serious rewrite, I'm sure more issues, dare I say bugs, will surface.dlewisfl wrote:There are other variables defined globally that should be defined locally, as well as other inefficiencies (e.g. not using arrays and copy/pasting code unnecessarily, the number of times he reads through the order pool each tick, using the error message function in the source instead of using an include, needlessly defining variables). The source file for this EA could easily be ~500 lines instead of the 1400+ and be much more efficient.
Paul
void subSaveValues()
{
CalculateADR();
double op = iOpen(Symbol(),0,0);
//Buy limit line and TP
double spread = MarketInfo(Symbol(), MODE_SPREAD);
double Bdistance = BUY_OR;
double Sdistance = SELL_OR;
double Bprice = NormalizeDouble(op - (Bdistance * Point), Digits);
double Sprice = NormalizeDouble(op - (Sdistance * Point), Digits);
double Btp = Bdistance*(BTP_Percent*0.01);
double Stp = Sdistance*(STP_Percent*0.01);
GlobalVariableSet(OP,op);
GlobalVariableSet(BDIST,Sdistance);
GlobalVariableSet(BDIST,Sdistance);
GlobalVariableSet(BTP,Btp);
GlobalVariableSet(STP,Btp);
}
The function should look like this once you get rid of all the un-necessary stuff.
Code: Select all
void subSaveValues() {
CalculateADR();
double Bdistance = BUY_OR,
Sdistance = SELL_OR,
Btp = Bdistance * (BTP_Percent * 0.01),
Stp = Sdistance * (STP_Percent * 0.01);
GlobalVariableSet(OP,NormalizeDouble(iOpen(Symbol(),0,0),Digits));
GlobalVariableSet(BDIST,NormalizeDouble(Bdistance,0));
GlobalVariableSet(SDIST,NormalizeDouble(Sdistance,0));
GlobalVariableSet(BTP,Btp);
GlobalVariableSet(STP,Btp);
return;
}-
Fx93
- Trader
- Posts: 83
- Joined: Mon Apr 09, 2012 6:32 pm
Re: POOLER/SAN Stunning generosity
This is the most ingenious martingale/grid type strategy I've seen (its better than Gertje+), thanks for sharing it. I backtested it on the 5M chart on the Euro from 1/1/2005-5/31/2012 and it survives! I also watched how it trades for a year or so visually: what makes it successful is that it moves the TP accordingly. I used a 50:1 broker with starting 10k at first trading the default lots starting with .1 and this got margin called in 2008, so I switched to 20k and this survives.
20k grew to 51,298k, which is a bit over +150% in 7.5 years = 20%/year without money management using a 50:1 broker. So all it needs is money management: using a 50:1 broker increasing the lot size by .01 lot per 2k works, using a 100:1 increasing it by .02 per 2k (or .01 lot per 1k) would work. This is the only feature that I think should be added first to see it's real gains.
By comparison during the same period:
Black Belt EA grew from 100k to 413,872k, a 400% gain, the best I know.
Dlewis's TrendOSOB grew from 100k to 160,392 using 2 delay, 16 TP, 70 SL, a 60% gain.
However, due to their money management both made very big gains. Unfortunately with a martingale/grid, money management works much more slowly because one only increases lot size by say .01 lot per $1k gained.
I don't see the usefulness in trading more than one pair, using the one with the best spread that backtests the best would seem the way to go. Two pairs may work though to avoid each's lengthy trades.
My questions are:
1. How reliable is the EA: if the computer shuts down will it lose the buy/sell grid?
2. What happens when the grid is bypassed from a weekend gap?
3. During all the period I backtested it, the highest lot trade it opened was .8. Will it open higher lots if necessary? I think I figured out that it starts over with a .1 lot after it opens .1-.8 lots. Does the TP keep averaging with this, from the trade I saw it didn't look like it did, which may be a problem if that is the case.
I'll check out if I can increase profitability at all by fooling with the lot size structure next.
20k grew to 51,298k, which is a bit over +150% in 7.5 years = 20%/year without money management using a 50:1 broker. So all it needs is money management: using a 50:1 broker increasing the lot size by .01 lot per 2k works, using a 100:1 increasing it by .02 per 2k (or .01 lot per 1k) would work. This is the only feature that I think should be added first to see it's real gains.
By comparison during the same period:
Black Belt EA grew from 100k to 413,872k, a 400% gain, the best I know.
Dlewis's TrendOSOB grew from 100k to 160,392 using 2 delay, 16 TP, 70 SL, a 60% gain.
However, due to their money management both made very big gains. Unfortunately with a martingale/grid, money management works much more slowly because one only increases lot size by say .01 lot per $1k gained.
I don't see the usefulness in trading more than one pair, using the one with the best spread that backtests the best would seem the way to go. Two pairs may work though to avoid each's lengthy trades.
My questions are:
1. How reliable is the EA: if the computer shuts down will it lose the buy/sell grid?
2. What happens when the grid is bypassed from a weekend gap?
3. During all the period I backtested it, the highest lot trade it opened was .8. Will it open higher lots if necessary? I think I figured out that it starts over with a .1 lot after it opens .1-.8 lots. Does the TP keep averaging with this, from the trade I saw it didn't look like it did, which may be a problem if that is the case.
I'll check out if I can increase profitability at all by fooling with the lot size structure next.
-
bazze
Re: POOLER/SAN Stunning generosity
Yes,this is the place to be:)...Thank you very much for sharing,Philip...