Pipcruiser's Pipmashers Bare Bones

Post your derivatives/discussion threads here.
User avatar
Baluda
Trader
Posts: 330
Joined: Mon Feb 06, 2012 2:00 pm
Location: An insignificant village in the Netherlands

Pipcruiser's Pipmashers Bare Bones

Post by Baluda »

The approach we often have to the design and implementation of automated trading systems is to mimic a manual system almost to perfection. While this makes sense it leaves the real strength and power of automated systems underdeveloped or even unused. We seem to forget that, given a specific rule set, an EA can make thousands 'decisions' and open, modify or close hundreds of trades in the proverbially split second.

Another thing is that, more often than not, at least some of the rules In a manual trading system are based on a feeling, hunch or a subconsciously embedded experience. Automating these rules into an EA seems questionable.

Pipmasher is a very simple system with a clear set of rules. The rules of Pipmasher tell us to make use of pending trades.

Pending trades are very useful in a manual system. They open trades when you are not able to be at your workstation. In a automated system pending trades are unnecessary. An EA is always powered on and can open trades itself. There are a lot of advantages to let the EA itself decide when to trade instead of the EA opening pending trades. Pending trades have the nasty property that they need to be nursed, that is moved or deleted in time. Let the EA take care of trades, get rid of pendings.

A rule in Pipmasher is to get the trend for last month and last week. This seems arbitrary, an EA does not care for the notion of 'months' or 'weeks'. LifeSys has already suggested changes to optimize this.

Other rules in Pipmasher are 'Do not trade Mondays', 'Delete pendings on Friday afternoon' and, introduced only recently, 'Do not trade after the 23st of the Month'. These rules also seem arbitrary. It looks like the reason for these rules are either 'I want to have a clean desk once a week', or 'I experienced major retraces towards the end of the month twice, should we ever trade then?'. The benefit of these rules in an automated system has to be proven.

Attached is a 'Pipcruiser's Pipmasher Bare Bones' EA that I coded with all this in mind. It finds and trades trends in the way Pipcruiser developed Pipmasher but transposed into an automated system.

Maybe the reason for this post is my feeling we can do much better at designing, developing and coding EA's.

Please feel free to comment on my remarks here and on the code.
You do not have the required permissions to view the files attached to this post.
Check the MQL4 Market for my best EA's and Indicators.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Pipcruiser's Pipmashers Bare Bones

Post by SteveHopwood »

Thanks Paul. II will add this to my wrup on Sunday.

:xm:
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. [email protected] 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.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Pipcruiser's Pipmashers Bare Bones

Post by SteveHopwood »

One teensy comment Paul. Not trading Monday's was a part of PC's original spec; it is not a recent rule.

:xm:
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. [email protected] 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.
AnotherBrian

Pipcruiser's Pipmashers Bare Bones

Post by AnotherBrian »

Well that's compact!

I'm still migrating my brain from the simplistic Empty4 code to the MT5 type code that we can now use and learning things along the way, such as;

enum ENUM_TREND { UP, DOWN };
ENUM_TREND farTrend = far < close ? UP : DOWN; (replaces if statement?)
I'll have to remember this....

Instead of the OnTick(), could we alternatively use the OnTimer() ?
I can't figure out how to make that happen once per day at a given time, since the EA will execute "EventSetTimer(x)" seconds after the EA is loaded. But it could be used to limit the number of time it executes, for example, et the timer to 3600 and it will execute once per hour. Another problem is it continues to execute on weekends. I'm just thinking out load and learning from your code.

Have you run this for any length of time? Will be interesting to see how this compact version competes with PPoS. Good brain food in your first post as well.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Pipcruiser's Pipmashers Bare Bones

Post by SteveHopwood »

Paul, I see from your code that there are none of the checks and balances that attempt to deal with all the bollocks that Crappertrader throws at us. This appears to leave users open to the platform allowing the EA sending multiple trades that will lead to blowing trading accounts.

Is this wise? Does your code have some hidden checks and balances? Please do say if so. I can not see it. If not, it is dangerous and and members should use it with extreme caution.

:xm:
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. [email protected] 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.
User avatar
basch312
Trader
Posts: 72
Joined: Mon Aug 19, 2013 10:53 pm
Location: Barcelona

Pipcruiser's Pipmashers Bare Bones

Post by basch312 »

Thanks Paul!

I really love the simplicity of this code! I'm adding it to my EA's portfolio right now.
We'll see how this workssss.

Regards!
User avatar
Baluda
Trader
Posts: 330
Joined: Mon Feb 06, 2012 2:00 pm
Location: An insignificant village in the Netherlands

Pipcruiser's Pipmashers Bare Bones

Post by Baluda »

@Brian:
It looks like MQL4 is finally ready to leave the dark ages of programming languages. That ' ?:' combination is called the ternary operator because and indeed translates to a simple if-then-else.

Don't try to use OnTimer for datetime related operations. OnTimer is just that, a timer.

@Steve:
There are (almost) no checks in my code. It is meant to be an experiment to show how one could transpose a manual system into an automated one.

Besides that I could argue it is perhaps time to evaluate all those checks and balances we build into our code by default for years now. Are they really still necessary? Empty4/MQL4 have progressed considerably over the years.

@Basch:
Test this how you want. But keep in mind that for me this code is an experiment. No more, no less.
Check the MQL4 Market for my best EA's and Indicators.
garyfritz

Pipcruiser's Pipmashers Bare Bones

Post by garyfritz »

Baluda » Mon Jul 27, 2015 3:43 am wrote:@Brian:
It looks like MQL4 is finally ready to leave the dark ages of programming languages. That ' ?:' combination is called the ternary operator because and indeed translates to a simple if-then-else.
And it's not exactly a new concept. C has had the '?:' operator for decades. Supposedly '?:' originally comes from CPL -- in the 1960's. :D
Lifesys
Trader
Posts: 126
Joined: Wed Apr 25, 2012 2:05 am
Location: Echuca Victoria. Australia

Pipcruiser's Pipmashers Bare Bones

Post by Lifesys »

Hi Paul
Worth noting for any PPoS system, my experience is that the "S" is the key. Overlapping (greatly reducing risk) 'Multi' trades with a 100pip jumping stop, trickling in 30pip TPs. Vast majority expire each week but that is fine.
The basic PPoS idea is very sound but needs good management as Steve has pointed out.
I use little MQL routine to create CSV log files then analyse results in Excel & VBA, hence now pursue PPoS with some confidence. Summary of pivot table summaries over a few weeks-
PPoS2-2015-08-02_112327.jpg
This affirmed replacing Longer with Tradingx20 & Medium with Tradingx5 as well worthwhile. I did also use 'Main' as Market for a week or so rather than pending, raised 'Main' count but not necc. profitability as it hit SL more often. I also use 1% trade risk, based on SL which makes 'Main' lotsize 1.5x (200 cf 300) that of 'Multi.
[PPoS2 added 4.86% to account 28th-31st July (Days 2-5) when PPoS would be inactive - not bad for an EA, but since all were 'green', closed all at 1300hrs (server) Day 5. Using added WinningTradeClosureHour = 18; would have been just after large USD drop. Just blessed I guess. ;-) ]
You do not have the required permissions to view the files attached to this post.
User avatar
Baluda
Trader
Posts: 330
Joined: Mon Feb 06, 2012 2:00 pm
Location: An insignificant village in the Netherlands

Pipcruiser's Pipmashers Bare Bones

Post by Baluda »

@Paul and all interested,

Here is v1.1 of my Pipcruiser's Pipmasher Bare Bones.

Changes:
* Close all trades at Weekend Lead-In, defaults to Fridays at 16:00 server time.
* Open an extra trade at every 20 pips level.

Keep in mind that:
* This is an exercise, please do not mistake it for anything else.
* 5-digit brokers only, or change the code yourself.

For developers:
* Take note of the while command which is used without an operator except for the auto-increment. I had to test this to make sure it works, and it does.

Cheers,

Paul

(Edit 8/3/15: Code updated with minor fix)
(Edit 8/6/15: Bugfix to v1.2)
You do not have the required permissions to view the files attached to this post.
Check the MQL4 Market for my best EA's and Indicators.
Post Reply

Return to “Pipcruiser's Pipmasher forum”