› Forums › Development › Trading made REALLY Simple
This topic has been reported for inappropriate content
Tagged: Peak EA
- This topic has 455 replies, 41 voices, and was last updated 8 years, 10 months ago by
Anti.
- AuthorPosts
- January 9, 2016 at 2:08 am #11040
Hi together, I searched for more information from chart and ClearMethod-Indicator. I implemented a filter which should help to find better entries and exits. For entrys I only use ClearMethod… Please find two screenshots one without filter and antoher one incl. a special MA. This is only an example… In screenshot no 1 you can see all entries and exits made in Daily EURUSD from may till november 2015 (without filter). 1. Entry Short is a loss. 2. Entry Long is a loss. 3. Entry Short is a loss. 4. Entry Long is a loss. In screenshot no 2 you can see all entries and exits made in Daily EURUSD from may till november 2015 (with filter). 1. line…no entry…MA and CM are not in line. 2. line entry and exit when MA turns red (exit is much earlier and limits losses). 4. line Entry Short with smaller loss when MA turns green (keep in mind that entry happens on a sunday candle..check your broker…) 6. line entry long (sunday Candle) and exit with 15 pips win when MA turns red. Line 8 entry in direction of CM and exit in line 9 with loss… I know that this test is very bad, but I searched for an extreme condition and found out that this MA is a good filter…it’s called ‘NonLag ma nrp & mtf + alerts 2.01’. Please do not pay attention on these small arrows…this is another indie which i check… BR Marc
Thanks for your contribution.
As already stated several times in this forum, Our baseline for Logic changes/Additions/Contributions are H4 TF’s.
G.
January 9, 2016 at 2:09 pm #11046I’m currently debugging my Dynamic Take Profit function, which is based on the Trailing Stop function @VlanFx provided in v 1.3 of the EA. My DynTP still has an issue, but I think we’re also having issues with the current logic of partial close and moving the SL to BE (functions CloseOrdersPartialAndMoveSlToBE and MoveStopLossToBreakEven) which interferes with DynTP, so this can’t work effectively.
Backtest conditions: EURUSD, H4, time interval 2015-10-05 – 2015-10-31, EA all OOTB.
Looking at the pic attached:
- Blue circle: On Oct 6th one SellStop and one BuyStop are set at 16:00. The BuyStop becomes a Buy immediately at 16:00. At 16:03 the SL of this Buy is moved to one point above BE, and it is partially closed (50%). The remaining 50% lot is closed at 16:23 when hitting SL.
- Red circle: The SellStop from Oct 6th is still open on Oct 22nd and becomes a SELL at 15:49, which is partially closed immediately.
- Green circles: On Oct 8th a typical situation for our DynTP to get active. BuyStop and SellStop are set at 12:00. It becomes a Buy at 12:02, and ADX Main is rising. At 12:04, this trade is being partially closed, SL is moved to BE, and the remaining 50 % of our lotsize are in SL at 12:11. So the DynTP has no chance to get active.
Questions for discussion:
- Does it make sense to leave the opposing BuyStop / SellStop open once one of them has been triggered?
- Isn’t the default BE logic triggered too early, so after this the trade has a high probability to hit his new SL? IMO, the current logic makes sense if we don’t trust our entries to have a high probability of winning.
- In a situation with rising ADX Main (green circle), wouldn’t it make sense to loosen the BE logic so the trade has more ‘space to breathe’, so DynTP can work effectively?
- We’re setting our initial TP & SL based on ATR multiples. Wouldn’t it make sense to do so for BE and Trailing Stop also? Doing so might add some space for the trade to develop.
- Re. program architecture: at the moment, func MoveStopLossToBreakEven() is being called by func CloseOrdersPartialAndMoveSlToBE(). Does this really make sense? In case you wanted a BE logic, but no partial close, you would have to call the partial close function anyway. This is error prone, IMO. I would suggest to call MoveStopLossToBreakEven from event handler OnInit() directly. Would also flatten program hierarchy, which is always easier to modify.
- Additional question: at green circle, when ADX is rising for a long trade, why set a SellStop at all?
I have a Dynamic TP prototype basically working by now, but it needs some more debugging before posting it. I’ll try to modify v. 1.3 of the EA in a way that further debugging works.
@VlanFx: please drop me a line re. your current WIP status of BE, Partial Close, and Trailing Stops, so we don’t work in contradictory directions. Any changes by now as compared to v. 1.3 already published?s.
-
This reply was modified 10 years, 5 months ago by
simplex. Reason: additional question
Attachments:
You must be logged in to view attached files.A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)
January 10, 2016 at 6:07 pm #11063My Dynamic Take Profit function is working now – see attachment. It was necessary to apply some changes to your EA version in order to make DynTP work.
So the zip file contains the following:
- sx_dynamic_tp.mq4: all new functions and some code snippets that show how to use them
- Penguin_v_1_3_sx.mq4: a modified EA based on Version 1.3. I had to modify it because the break even function interfered with the Dynamic TP. This could not get active because trades were closed too early.
- Penguin_PeakThrough_v.1.3.mqh: not changed
Changes in my EA mod as compared to v1.3 original:
- Event handler OnInit() replaces init()
- Event handler OnDeinit() added
- SYMBOL, digits, and point are set in OnInit() now for debugging
- function sx_TrailOrderSL replaces TrailOrders (no functional change). This was done to remove some code redundancy and make modding easier. Feel free to ignore!
- function sx_ShiftOrderTP added
- several input defaults changed to enable backtesting sx_ShiftOrderTP() (partial close disabled)
- function getDeinitReason added
- several #define added
- several Print() commands were added for debugging
@VlanFx: Either use the code snippet file to integrate them in your current version, or use the modded EA. There are no functional changes despite changed input defaults to enable Dynamic TP. With your BE method used OOTB, it won’t work!Any questions / comments welcome!
s.
Attachments:
You must be logged in to view attached files.A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)
January 10, 2016 at 10:26 pm #11066Hi Simplex
I am trying to back test your stuff
There is an extra bracket (to be removed ) inside the Penguin_v1..
you wrote : Penguin_v_1_3_sx.mq4: a modified EA based on Version 1.3.
where is located the ClearMethod_EA_1_3 called by the lib Penguin_PeakThrough_v.1.3.mqh ?
#define CLEAR_INDI_NAME “ClearMethod\\ClearMethod_EA_1_3”

-
This reply was modified 10 years, 5 months ago by
john baag.
January 10, 2016 at 10:59 pm #11068Hi Simplex I am trying to back test , you wrote : Penguin_v_1_3_sx.mq4: a modified EA based on Version 1.3. where is located the ClearMethod_EA_1_3 called by the lib Penguin_PeakThrough_v.1.3.mqh ? #define CLEAR_INDI_NAME “ClearMethod\\ClearMethod_EA_1_3”
*edit* just saw that you are referring to something else *edit*
but maybe it could help other people:
Put the mqh file into the expert folder.
i ´ve found a mistyping not allowing the function “isPeakThroughChange” to be called.
I´ve edited the EA. Now it compiles correctly. Hope that helps
-
This reply was modified 10 years, 5 months ago by
Bartleby. Reason: *not reading above post well*
Attachments:
You must be logged in to view attached files."A dream you dream alone is only a dream. A dream you dream together is a reality." (John Lennon)
January 10, 2016 at 11:04 pm #11071I am trying to back test your stuff
If you do that to test Dynamic TP, Trailing Stop, BE, and partial close on a detailed level (logfile line by line), it’s ok and much appreciated.
Backtesting for trading performance does not make sense at the moment – as posted several times by G.
s.
A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)
January 10, 2016 at 11:07 pm #11072Thanks @Bartleby:
i ´ve found a mistyping not allowing the function “isPeakThroughChange” to be called.
Ohh yes: sorry, I forgot that detail in my change log.
I couldn’t resist correcting the mistyped ‘isPeakThroughChange’ to ‘isPeakTroughChange’ in my version. I forgot to mention that.
s.
A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)
January 13, 2016 at 9:25 pm #11108Hi together, please find attached information of a Screenshot which shows EURUSD H4 with Base-Trigger ClearMethod and Filter DMI Indicator
Attachments:
You must be logged in to view attached files.January 13, 2016 at 9:46 pm #11110Backtest EURUSD 4H with standard settings…I used only “open price-settign” for backtest…
Attachments:
You must be logged in to view attached files.January 13, 2016 at 10:00 pm #11112January 14, 2016 at 1:07 am #11114Hi together, please find attached information of a Screenshot which shows EURUSD H4 with Base-Trigger ClearMethod and Filter DMI Indicator
That’s NOT the way to trade ClearMethod !!
G.
January 14, 2016 at 7:43 am #11115Please tell me the way how to trade Clear Method. This method shows trend changes…and as I can see my chart show change of trend direction doesn’t it?
Problem of this trendfollowing strategy are “whipsaws”…Refering to that I tried to find an other mothod to filter this situations…
Nevertheless…If you think, that “my way” of trading or understanding this method is wrong please tell me or link to the article in which you exactly describe how to use it. MMaybe my point of view will change…
BR Marc
January 14, 2016 at 7:49 am #11116<h3 style=”color: #000000; font-family: ‘Times New Roman’; line-height: normal;”>Enter Noise</h3>
The “Clear Method” is used to determine when noise occurs. If, in an uptrend, price makes higher lows, it is trending upward. When it stops making higher lows and before a “clear” trend change occurs, noise takes the place of the trend.
In a downtrend, price makes lower highs. When that stops happening and before a trend change from down to up occurs, noise sets in.
In the above figure, the three bars on each panel with a green line drawn through them are the noise bars. I show them in magenta.
On the left panel, the three magenta bars have highs above the clear bar, but they are not yet clear of the lowest high, so they are noise. When the highest low happens, the trend changes from down to up and noise ends.
On the right panel, the three magenta bars have lower lows than the clear bar, but they are not clear of the lowest high. They are noise bars. When the lowest high occurs, a new trend begins and noise ends.
The Clear Method works best on the weekly scale.
January 14, 2016 at 9:51 am #11117Interesting link to Bulkowski’s site. Ok, when Clear LL’s in upswing or HH’s in downswing are going flat the swing is considered over and noise rules for a certain time. Now the point is, you will get the first sign of such a ‘noise’ phase two bars after the latest move of HH / LL. At that moment in time, most of those ‘noise’ phases are nearly over.
This is too late to switch from trend following to a sideways strategy. But it might be interesting to watch in which direction PA / Volume breaks this noisy time interval to decide where the next swing will probably go and seek an entry.
s.
A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)
January 14, 2016 at 11:42 am #11118fact is that a trend needs time to evaluate…we have to clear when there are whipsaw-movements which could get us out of the market
January 14, 2016 at 12:25 pm #11119Please tell me the way how to trade Clear Method. This method shows trend changes…and as I can see my chart show change of trend direction doesn’t it? Problem of this trendfollowing strategy are “whipsaws”…Refering to that I tried to find an other mothod to filter this situations… Nevertheless…If you think, that “my way” of trading or understanding this method is wrong please tell me or link to the article in which you exactly describe how to use it. MMaybe my point of view will change… BR Marc
THIS thread is about building an EA, based on sound & logic market behaviour.
Peaks & Troughs are traded according to general market TREND.
Building a successful EA requires:
1. Trade pre-conditions (not yet finished)
2. Money-Management (Risk, Lots, TP, SL, Trailing profit – not yet finished)
3. Trade Logic – defining Entry and Exit. This will be based on SEVERAL params, and NOT just variations on Price-Action (mostly Currency-Strength, Volume, Price-action, market Sentiment and TREND definition and its strength – which will ALL gives same signal). Peaks & Troughs are just price-action, and that’s the only part that is finished.
4. TREND & market sentiment are not yet defined, other params are already “hinted” in several of my other threads posts.
5. This is NOT a thread about Peak & Troughs alone, but on building a community EA, based on sound logic.
Guidelines for Trend, Currency-Strength, Market Sentiment, etc. will be given after the prior tasks will be finished.
G.
January 18, 2016 at 10:19 pm #11129Hmmm, this thread is pretty quiet for a couple of days now! Since I posted my thougths about a detailed backtesting of Dynamic TP and SL, hardly anything happened here. Did I scare everybody to death when indicating that serious backtesting might be more than looking at balance lines going up or down and posting a
or
?Ok, an update from my side: I’ve been working on a strategy combining Clear Method and VZO Oscillator, and I think I’m getting closer. I’ve worked over v. 1.3 of the EA VlanFx posted, coded several modifications. When time has come we should consolidate our versions.
I’ve also added a function that tightens TP after dynamic progression when consolidation (OB / OS) appears. The function works, but it’s hard to define the conditions that will trigger this function effectively. My basic thought is that I would like it better if a trade hit dynamic TP instead of latest TS level.
I would be interested to learn about the status of everybody else contributing.
s.
A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)
January 19, 2016 at 1:09 am #11130Hi all
I’ve been following this project and thought I should pipe up and make my presence known. Whilst I’m competent enough throw some code together, some of you guys appear to be far more professional than I. I’m not sure where I can be of assistance but I’m willing. For the moment I’m about to make a start on reading through the code and to become familiar with it. I’m quite slow and fuzzy these days so you’ll probably keep speeding past me.
BTW that Clear swing indicator is a little ripper

Cheers
January 19, 2016 at 1:25 am #11131…Did I scare everybody to death ……
Thanks a lot bro, i got eyes problem, so can not contribute since end of dec. Last week were my eyes better, than got small pain again, so i decided to give my eyes rest for a while. I will read from beginning again today, want to make sure that i do not miss some important posts (after a long time absent). At a glance i see that there are many improvements here.
will try my best …Thanks to @Gg53, the post #11119 is a good conclusion about the EA development, which part has been done, and which parts still need attention and improvements.

And thanks to all of you guys/gals who has contributed, given advices … and ideas …
January 19, 2016 at 1:29 am #11132Hmmm, this thread is pretty quiet for a couple of days now! Since I posted my thougths about a detailed backtesting of Dynamic TP and SL, hardly anything happened here. Did I scare everybody to death when indicating that serious backtesting might be more than looking at balance lines going up or down and posting a
or
? Ok, an update from my side: I’ve been working on a strategy combining Clear Method and VZO Oscillator, and I think I’m getting closer. I’ve worked over v. 1.3 of the EA VlanFx posted, coded several modifications. When time has come we should consolidate our versions. I’ve also added a function that tightens TP after dynamic progression when consolidation (OB / OS) appears. The function works, but it’s hard to define the conditions that will trigger this function effectively. My basic thought is that I would like it better if a trade hit dynamic TP instead of latest TS level. I would be interested to learn about the status of everybody else contributing. s.My side is “quiet” because I’m waiting for trade pre-conditions to be finished (mainly news/announcements integration).
After that completion I’ll post my take on Market Sentiment/Trend direction, and we can continue step by step.
The dynamic TP implementation isn’t a show stopper.
G.
January 19, 2016 at 8:12 am #11134Thanks a lot bro, i got eyes problem, so can not contribute since end of dec. Last week were my eyes better, than got small pain again, so i decided to give my eyes rest for a while.
smallcat, I know you would contribute if you could. Your health is most precious, so take your time! Hope you’ll be back soon.
My side is “quiet” because I’m waiting for trade pre-conditions to be finished
Yes, I guessed that.
The dynamic TP implementation isn’t a show stopper.
Ok, it’s a simple algorithm and I’m open for any suggestion to enhance it. I think I already suggested to implement dynamic TP and SL based on variable ATR instead of fixed pips, but can’t remember about a reply.
s.
A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)
January 19, 2016 at 8:29 am #11135…Did I scare everybody to death ……
Thanks a lot bro, i got eyes problem, so can not contribute since end of dec. Last week were my eyes better, than got small pain again, so i decided to give my eyes rest for a while. I will read from beginning again today, want to make sure that i do not miss some important posts (after a long time absent). At a glance i see that there are many improvements here.
will try my best … Thanks to @Gg53, the post #11119 is a good conclusion about the EA development, which part has been done, and which parts still need attention and improvements.
And thanks to all of you guys/gals who has contributed, given advices … and ideas …Your Health first, pips later…
G.
January 19, 2016 at 9:13 am #11136January 19, 2016 at 9:14 am #11137Hi guys,
sorry for the absence. We are finishing a project at work that is already overdue so I haven’t had time for anything else these days.
Currently Missing functions from the EA are:
– partial orders closing management function (this is keeping us from using simplex’s DynTP)
– news filter – @Emonts is/was working on this, but lately has not been replying to PMs. Hope everything is ok and he is just busy.
GG53 said, the main stopper now is the news filter. So if somebody would like to help out, I think @Emonts wouldn’t mind.
The latest version from Emonts is here and here are simplex’s suggestions.
Thanks in advance.
V.
January 19, 2016 at 9:31 am #11139Righteo
I’ll put my hand up for the news filter – (if no-one more capable will beat me to it). If I don’t have any problems I’ll have it ready in the morning.
- AuthorPosts
- You must be logged in to reply to this topic.