› 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
- December 21, 2015 at 9:39 am #10652
Hi all, Came back from the weekend and see great posts
I saw @Lowphat posted in the ‘chat’ thread an indicator that is according to GG53 rules regarding the peak-throughs so I updated the EA. Place the ClearMethod.mq4 inside ‘Indicator’ folder. Thanks @Lowphat for contributing. The entry is still at the bar ‘Close’ and places Stops at the Highest/Lowest price of the area, since I don’t understand yet the logic of placing Limit orders. If we want to place BuyLimit order when through changes to peak, then me can not be placing it on top of the through as it is almost always higher than current price… @GG53, can you shed some more light please? Thanks. V.Thanks VlanFx !!
Remarks to v1.2:
SwingPeriod – Not needed
Missing functions before main logic:
FFCAL -> avoid trading before and after news (default 30 min.)
Max. Spread -> Don’t trade if Spread >max.
Trading Hours -> trade only from StartHr (int) to EndHr (int)
TradeOnMonday -> allow trading on Monday (true/false)
TradeOnFriday -> allow trading on Friday (true/false)
FridayClose -> Don’t trade after FridayClose hour (int)
Auto TP & SL -> if TP & SL = 0
G.
December 21, 2015 at 12:39 pm #10661V.1.2 is WORSE than initial version, when compared to ALL 7 Majors with sames params.
Since the initial version is our base-line, we need to check and modify the cause, before adding more features/filters.
The importance of checking the EA on ALL 7 majors is in the fact that it reflects various market conditions, like different volatility, DD, Correlations, etc.
G.
December 21, 2015 at 2:11 pm #10662General functions:
//Auto TakeProfit
if (TP==0.)
{
tp = SL()/Point*TP_Factor;
}
else
{
tp = TP;}
//Auto StopLoss
if (SL==0.)
{
sl=SL()/Point;
}
else
{
sl = SL;}
//Auto Lot calculation
if (Lot==0.)
{
Lots = CalcLot(sl);
}
else
{
Lots = Lot;
}G.
December 21, 2015 at 2:21 pm #10663
AnonymousHere is my currency strenght in indicator to thoes who wanted to test it.
for later use of this EA .. if you think its good enuff, I have multi instance function that can be used across multiple timeframes simultaneously and does now -correcly creating trade symbols based on ob+os or os+ob conditions and also gives trade direction for each symbol.
December 21, 2015 at 3:07 pm #10668V.1.2 is WORSE than initial version, when compared to ALL 7 Majors with sames params. Since the initial version is our base-line, we need to check and modify the cause, before adding more features/filters. The importance of checking the EA on ALL 7 majors is in the fact that it reflects various market conditions, like different volatility, DD, Correlations, etc. G.
Maybe because the indicator used in v 1.2 isn’t the same as your original algo …
The color candles are your original algo (you know the buggy indicator who doesn’t refresh correctly …). And the line is the clearmethod.
First, we need a reliable indicator ….
Edit : i add the indicator described up.
-
This reply was modified 10 years, 6 months ago by
LittleCaro. -
This reply was modified 10 years, 6 months ago by
LittleCaro.
Attachments:
You must be logged in to view attached files.December 21, 2015 at 4:03 pm #106731.2 is still using the .mqh which is why its not back-testing right for me.
i patched in icustom directly and it looks about the same as the initial version.
“I believe the very best money is made at the market turns. Everyone says you get killed trying to pick tops and bottoms and you make all
your money by playing the trend in the middle. Well for twelve years I have been missing the meat in the middle but I have made a lot of
money at tops and bottoms.”
– Paul Tudor JonesDecember 21, 2015 at 4:10 pm #10674Here is my currency strenght in indicator to thoes who wanted to test it. for later use of this EA .. if you think its good enuff, I have multi instance function that can be used across multiple timeframes simultaneously and does now -correcly creating trade symbols based on ob+os or os+ob conditions and also gives trade direction for each symbol.
We can’t use or evaluate ex4.
Both the “multi instance function” and the CS is more than welcome, if supplied in source code.
The Penguin EA is based on Peaks & Trough areas as main logic, with optional CS and other logic as supporting features.
That main logic is already proven as profitable on all 7 Majors, so we continue to base on that logic.
Both the “multi instance function” and the CS is more than welcome, if supplied in source code.
I do have other profitable EA’s that are based on CS as main logic, but this is not the issue or purpose of this thread.
G.
December 21, 2015 at 4:17 pm #106751.2 is still using the .mqh which is why its not backtesting right for me. i patched in icustom and it looks about the same as the inital version.
I don’t know how many times is needed to request the use of iCustom ….
I already stated that the Peak&Trogh function needs completion before moving on, but instead we get more and more “logic” features and additions.
This is good, and I’m not against it, but lets focus on completing the MAIN logic first !!
G.
December 21, 2015 at 4:22 pm #10676V.1.2 is WORSE than initial version, when compared to ALL 7 Majors with sames params. Since the initial version is our base-line, we need to check and modify the cause, before adding more features/filters. The importance of checking the EA on ALL 7 majors is in the fact that it reflects various market conditions, like different volatility, DD, Correlations, etc. G.
Maybe because the indicator used in v 1.2 isn’t the same as your original algo … The color candles are your original algo (you know the buggy indicator who doesn’t refresh correctly …). And the line is the clearmethod. First, we need a reliable indicator …. Edit : i add the indicator described up.
How does that indicator perform whithin the EA?
G.
December 21, 2015 at 4:55 pm #10679
AnonymousHere is my currency strenght in indicator to thoes who wanted to test it. for later use of this EA .. if you think its good enuff, I have multi instance function that can be used across multiple timeframes simultaneously and does now -correcly creating trade symbols based on ob+os or os+ob conditions and also gives trade direction for each symbol.
We can’t use or evaluate ex4. Both the “multi instance function” and the CS is more than welcome, if supplied in source code. The Penguin EA is based on Peaks & Trough areas as main logic, with optional CS and other logic as supporting features. That main logic is already proven as profitable on all 7 Majors, so we continue to base on that logic. Both the “multi instance function” and the CS is more than welcome, if supplied in source code. I do have other profitable EA’s that are based on CS as main logic, but this is not the issue or purpose of this thread. G.
I will gladly post the multi function for this but first I wanted to show you how it looks on chart as requested so you guys could come to conclusion and tell me if its good enough and suits this project.
December 21, 2015 at 5:30 pm #10682Here is my currency strenght in indicator to thoes who wanted to test it. for later use of this EA .. if you think its good enuff, I have multi instance function that can be used across multiple timeframes simultaneously and does now -correcly creating trade symbols based on ob+os or os+ob conditions and also gives trade direction for each symbol.
We can’t use or evaluate ex4. Both the “multi instance function” and the CS is more than welcome, if supplied in source code. The Penguin EA is based on Peaks & Trough areas as main logic, with optional CS and other logic as supporting features. That main logic is already proven as profitable on all 7 Majors, so we continue to base on that logic. Both the “multi instance function” and the CS is more than welcome, if supplied in source code. I do have other profitable EA’s that are based on CS as main logic, but this is not the issue or purpose of this thread. G.
I will gladly post the multi function for this but first I wanted to show you how it looks on chart as requested so you guys could come to conclusion and tell me if its good enough and suits this project.
What I see on chart is a Relative-Currency-Strength, which can benefit the current EA in several ways.
It can be used as a scanner to select which currency-pairs to trade, and in which direction.
It can also be used as a confirmation to the main logic.
Both of the above features are more than welcome to this thread EA.
G.
December 21, 2015 at 6:05 pm #10683The v.1.2 IS using iCustom(). The fact that is called from the mqh file can not make any difference. See here: http://docs.mql4.com/basis/preprosessor/include The content of the mqh is placed inside the mq4 that referenced it.
Advantage of using header files, besides reusability, is better logical structuring of the code. We hardly have any trading logic in the EA and the main source file is already almost 700 lines long. Now comes the PeakThrough logic, then CS logic, then Volume logic… It’s not healthy to have everything stuffed in one file. Just my opinion. But as this is a community ea, I will do what the members agree upon.
V.December 21, 2015 at 6:31 pm #10684The v.1.2 IS using iCustom(). The fact that is called from the mqh file can not make any difference. See here: http://docs.mql4.com/basis/preprosessor/include The content of the mqh is placed inside the mq4 that referenced it. Advantage of using header files, besides reusability, is better logical structuring of the code. We hardly have any trading logic in the EA and the main source file is already almost 700 lines long. Now comes the PeakThrough logic, then CS logic, then Volume logic… It’s not healthy to have everything stuffed in one file. Just my opinion. But as this is a community ea, I will do what the members agree upon. V.
If you read my posts on the subject: I’m all in favor for MQH file in the FINAL version.
For the timebeeing I prefer iCustom calling of the external indicator, for easy debugging and visualization.
iCustom doesn’t add lines of code, because the indicator is a separate, stand-alone, MQ4 file.
Furthermore, that indicator can be used, monitored, and visually “seen” for correct functionality.
G.
December 21, 2015 at 7:40 pm #10698If you read my posts on the subject: I’m all in favor for MQH file in the FINAL version. For the timebeeing I prefer iCustom calling of the external indicator, for easy debugging and visualization. iCustom doesn’t add lines of code, because the indicator is a separate, stand-alone, MQ4 file. Furthermore, that indicator can be used, monitored, and visually “seen” for correct functionality. G.
I understand and agree with you GG. But all this is possible with v.1.2. The published zip file contains a stand-alone indicator ClearMethod.mq4. It can be attached to a chart and visually see peaks and throughs. One can also check EA behavior against the indicator. For trading decisions EA relys only on this separate indicator.
The reason I decided to keep the mqh file is for reasons explained above. As it is very seldom that just simple, one-line call to iCustom is enough. One always needs some ‘servicing’ functions for any iCustom indicator. In this case, these functions are:
IsPeakThroughChange()
GetPeakThroughHighestHigh()
GetPeakThroughLowestLow()
IsPeak()
Together with function comments they add up to 70 lines of code.But we can leave this discussion. I can publish v.1.3 that will have everything in one file.
V.December 21, 2015 at 7:42 pm #10699V.1.2 is WORSE than initial version, when compared to ALL 7 Majors with sames params. Since the initial version is our base-line, we need to check and modify the cause, before adding more features/filters. The importance of checking the EA on ALL 7 majors is in the fact that it reflects various market conditions, like different volatility, DD, Correlations, etc. G.
Maybe because the indicator used in v 1.2 isn’t the same as your original algo … The color candles are your original algo (you know the buggy indicator who doesn’t refresh correctly …). And the line is the clearmethod. First, we need a reliable indicator …. Edit : i add the indicator described up.
How does that indicator perform whithin the EA? G.
I don’t konw, the presented indi doesn’t work correctly, he doesn’t actualise itself in real time.
But visually your algo is better than clearmethod.
We really need only one official indicator “Peak and Trough” with your algo. So, we’ll all refer to the same indi and we could develop …
I don’t know if someone could correct the one i posted, but it could be great.
December 21, 2015 at 8:15 pm #10703Hi GG53
my review about EA ver 1.1 and ver 1.2..
the version 1.2 use the ClearMethod indicator which give better implementation of Peak and Trough..
the version 1.1 use the old Peak and Trough (lousy idea from me, which have the ‘SwingPeriod’ parameter)..
from my observation.. ver 1.1 may outperform ver 1.2 is because..
ver 1.1 with the ‘SingPeriod’ logic is having some incorrect ‘Peak and Trough’ .. this small matter actually cause the EA open more trades compare to ver 1.2..
with MM lot set to be percentage style and tight trailing stop.. it is possible that ver 1.1 have more profitable trades..
attached is a snapshot to show the different between ver 1.1 and ver 1.2.. the ver 1.1 (with the white box in chart) showing some incorrect entry..
in this case, the incorrect entry is a losing trade.. thus the ver 1.2 is better than ver 1.1 for this example..
On the other hand, if the incorrect entry is a winning trade.. ver 1.1 is better than ver 1.2..
tankhang
-
This reply was modified 10 years, 6 months ago by
tankhang.
Attachments:
You must be logged in to view attached files.December 21, 2015 at 8:16 pm #10705My simplified Clear Method Indicator, as requested. My clear method mqh lib is included in the mq4 file for convenience.
- Buffer 0: output = 1 for bullish, else 0
- Buffer 1: output = 1 for bearish, else 0
No input parameters, so iCustom() should be rather simple:
double iCustom( string symbol, // symbol int timeframe, // timeframe string name, // path/name of the custom indicator compiled program int { 0 | 1 }, // line index: 0 for bullish buffer, 1 for bearish buffer int shift // shift );Any questions 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)
December 21, 2015 at 8:25 pm #10708One more thing..
this EA generated a lot of pending order with no expiration..
which mean if I start the EA last week.. I will get ‘more entry’ on today compare to the one who start the EA this week..
it is because those pending order were created last week..
In this situation.. Let say I start the EA this week.. is it possible to recovery those missing pending order?
tankhang
December 21, 2015 at 8:28 pm #10709

Advantage of using header files, besides reusability, is better logical structuring of the code. We hardly have any trading logic in the EA and the main source file is already almost 700 lines long. Now comes the PeakThrough logic, then CS logic, then Volume logic… It’s not healthy to have everything stuffed in one file. Just my opinion.
Absolutely correct! In the end we will have several mqh-libs, each serving a specific purpose. These will be glued together by the main program. Code maintenance and enhancement will be much easier that way!
When counting code lines, the largest project I was involved was several million lines for an investment bank. We would never have achieved our project goals without a proper code management. Everybody around: please trust V.! I’m sure he knows what he’s doing.
But as this is a community ea, I will do what the members agree upon.
Please trust your own expertise and rational arguments!
Best, 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)
December 21, 2015 at 8:48 pm #10710If you read my posts on the subject: I’m all in favor for MQH file in the FINAL version. For the timebeeing I prefer iCustom calling of the external indicator, for easy debugging and visualization. iCustom doesn’t add lines of code, because the indicator is a separate, stand-alone, MQ4 file. Furthermore, that indicator can be used, monitored, and visually “seen” for correct functionality.
I’m afraid there’s some misunderstanding here. As far as I got it, V. does NOT talk about replacing all iCustom indicator calls by functions calls to mqh libs. It’s all about proper code management. Please trust him.
@VlanFx: please trust yourself and your expertise and do what you know to be right!Re. iCustom() calls pro’s and con’s (we had some discussion about this): Why did nobody state clearly that it’s all about visualizing the indicator output in the backtester? This is a clear functional argument pro using iCustom during EA tests. A bit of clear communication would have avoided a good deal of hot discussion during last weekend.
I posted my simplified Clear Method indicator (or ‘peak and trough’, if you like), including an iCustom() code snippet for test and / or EA integration above. IMO it meets all features as requested on page 1 of the preliminary specification sheet .
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)
December 21, 2015 at 8:51 pm #10711Yep:
ver 1.1 with the ‘SingPeriod’ logic is having some incorrect ‘Peak and Trough’
I stepped in the same (at least similar) trap in my first attempt to code this! My latest version is absolutely simple, with no parameter at all.
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)
December 22, 2015 at 12:37 am #10712You decide which version of the Peak&Trough to use.
Once decided, I prefer the iCustom call to external indicator in initial development, and later on, once stabilized, convert it to MQH.
Make the decision among yourself based on actual results – and ignore my preference.
Let’s move on with a conclusion on this.
G.
December 22, 2015 at 12:56 am #10713Trade Entry point:
Currently we enter pending trade AFTER bar close.
If so, why enter on the High+xx (for LONG) or Low-xx (for SHORT)?
We can enter a Buy-Stop at the Close+xx (Long) or Sell-Stop at Close-xx (Short).
We can also enter Buy-Limit at the Close-xx or Sell-Limit at Close+xx, to get some extra pips.
(or even BOTH, as KIAD suggested…)
On Trailing:
If our tests confirms that 5 pips trailing produce >85% winning trades:
Why not exit 50% of our Lot at 5 pips profit, move SL to BE+1, and trail the rest?
G.
December 22, 2015 at 4:06 am #10717My simplified Clear Method Indicator, as requested. My clear method mqh lib is included in the mq4 file for convenience.
- Buffer 0: output = 1 for bullish, else 0
- Buffer 1: output = 1 for bearish, else 0
No input parameters, so iCustom() should be rather simple:
double iCustom( string symbol, // symbol int timeframe, // timeframe string name, // path/name of the custom indicator compiled program int { 0 | 1 }, // line index: 0 for bullish buffer, 1 for bearish buffer int shift // shift );Any questions welcome! s.
Hi Simplex,
Thanks for the indicator.
Do we really need two output buffers?
As per original requirement by G, can we have one rigid output buffer (1 = Buy / -1 = Sell / 0 = No action)
Thank you!
-
This reply was modified 10 years, 5 months ago by
bharath4x.
December 22, 2015 at 5:19 am #10721Trade Entry point: Currently we enter pending trade AFTER bar close. If so, why enter on the High+xx (for LONG) or Low-xx (for SHORT)? We can enter a Buy-Stop at the Close+xx (Long) or Sell-Stop at Close-xx (Short). We can also enter Buy-Limit at the Close-xx or Sell-Limit at Close+xx, to get some extra pips. (or even BOTH, as KIAD suggested…) On Trailing: If our tests confirms that 5 pips trailing produce >85% winning trades: Why not exit 50% of our Lot at 5 pips profit, move SL to BE+1, and trail the rest? G.
Hi G,
Can the Candle/Bar be of any type (Bull/Bear) to enter trade @ Close+xx (Buy-Stop) / Close-xx (Sell-Stop)?
-
This reply was modified 10 years, 6 months ago by
- AuthorPosts
- You must be logged in to reply to this topic.