› Forums › Development › Trading made REALLY Simple: Coder's Chat
Tagged: Penguin Community EA
- This topic has 169 replies, 16 voices, and was last updated 9 years, 9 months ago by
pipatronic.
- AuthorPosts
- December 21, 2015 at 2:22 am #10637
Just did a back test on EA penguin 1.2 by VlanFx. Tested on EU H4 from 2010-06-30 to 2015-12-11 with spread of 1.5 pips, result is great
Thanks to GG53 and all of you guys ….
Attachments:
You must be logged in to view attached files.December 21, 2015 at 5:13 am #10643My Peak and Trough indicator to test and check.
nice. historic looks really good. when i run it forward in the history tester your indy gets some anomalies but i don’t know if that is on my end. going to let it run forward on a chart
Attachments:
You must be logged in to view attached files.“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 5:59 am #10646@simplex nice. historic looks really good. when i run it forward in the history tester your indy gets some anomalies but i don’t know if that is on my end. going to let it run forward on a chart
@Lowphat : May i know what do you mean with “anomalies” ? Could you please explain it ? Did you test the indicator via strategy tester, and check the “visual” option to see how the indicator works on history data (and in realtime too) ? ThanksDecember 21, 2015 at 6:45 am #10647@simplex nice. historic looks really good. when i run it forward in the history tester your indy gets some anomalies but i don’t know if that is on my end. going to let it run forward on a chart
@Lowphat : May i know what do you mean with “anomalies” ? Could you please explain it ? Did you test the indicator via strategy tester, and check the “visual” option to see how the indicator works on history data (and in realtime too) ? Thanks
@smallcat yes. on dropping sx_ClearMethod on the history tester with the “visual” option and running forward the bars are not colored correctly but the history is perfect when you first drop the indicator on the visual mode.
in real-time (not history tester) it runs perfect so far.
could be a problem on my end though
“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 7:47 am #10651@simplex nice. historic looks really good. when i run it forward in the history tester your indy gets some anomalies but i don’t know if that is on my end. going to let it run forward on a chart
@Lowphat : May i know what do you mean with “anomalies” ? Could you please explain it ? Did you test the indicator via strategy tester, and check the “visual” option to see how the indicator works on history data (and in realtime too) ? Thanks
@smallcat yes. on dropping sx_ClearMethod on the history tester with the “visual” option and running forward the bars are not colored correctly but the history is perfect when you first drop the indicator on the visual mode. in real-time (not history tester) it runs perfect so far. could be a problem on my end though
The above is the main reason why I want to use iCustom with visual indicator instead of MQH lib.
The MQH can come later, when everything is stable.
G.
December 21, 2015 at 10:06 am #10656it didn´t compile , because of a mistyping (one _ too much) of the mqh file I changed it, if you don´t mind simplex ;)
Thanks for pointing this out! The forum software changes names of uploaded files from time to time. Better to place them in zip containers.
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 10:11 am #10657The above is the main reason why I want to use iCustom with visual indicator instead of MQH lib.
Could anybody provide a little more technical detail, maybe a link to a site where this topic is covered?
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 6:36 pm #10685quick test
original is peaktroughEA
1.2 is 1.2 with .mqh that calls icustom
1.2 test is with an ugly hack calling the same icustom directly in the EA
Attachments:
You must be logged in to view attached files.“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 7:58 pm #10700On this one I changed 0 code aside from commenting out the include and I just moved the functions that call icus from mqh to the EA
im wondering if it tests differently than the mqh version for anyone else.
“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 22, 2015 at 4:01 am #10716On this one I changed 0 code aside from commenting out the include and I just moved the functions that call icus from mqh to the EA im wondering if it tests differently than the mqh version for anyone else.
Thanks Lowphat, will test it. About your test result comparison, may i know it was on whice pair, time frame and begin to end time period of testing ? May be the result i got because of my bad historical data preparation? I download tick data from dukascopy using tickstory, convert it to HST format with gmt shift 0 or +2 (helsinki time) for my 2 different broker server time. The image i post is for gmt +0 broker. Will compare it with other broker and your “all in one” EA (without mqh).
December 23, 2015 at 12:19 am #10771Thanks smallcat everything is running fine today so no need to test the ver i upped. i would like to blame mt for being flaky but i think a lot of my issues were operator error.

“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 23, 2015 at 2:41 pm #10810friends want to share my observation may b useful for u…
what i see is here u r focusing on high volume candles..
but low volume r more important as per me as it will show u trend reversal
observe the candles which r having open low same and low volume
(if we consider market dont have open or close we have to focus the candle which is losing volume, the candle having open low same is the part of same uptrend we cant consider it as diff candle )
same vise versa hope me able to communicate what i want to show u……..
still observing will update my oservations till me get more clear updated raw info so it may use full..in ur concept
-
This reply was modified 10 years, 4 months ago by
fasttrade.
Attachments:
You must be logged in to view attached files.December 23, 2015 at 8:46 pm #10819Hi @jaguar1637, I’m trying to add the FFCal_mini to our EA, but I can’t get it to work. I can try only backtesting as there are no news at this time.
I copied the code you posted here but keep getting these values from the indi throughout a day full of news:
MinToNews = 999999
MinSinceNews = 0
The following condition then causes the EA to stop trading:
if(MinToNews<=MinsBeforeNews || MinSinceNews<=MinsAfterNews) ContinueTrading=false;
I have allowed DLL imports in Metatrader.
Any idea what I’m doing wrong?
V.
December 24, 2015 at 7:30 am #10828Hi @jaguar1637, I’m trying to add the FFCal_mini to our EA, but I can’t get it to work. I can try only backtesting as there are no news at this time. I copied the code you posted here but keep getting these values from the indi throughout a day full of news: MinToNews = 999999 MinSinceNews = 0 The following condition then causes the EA to stop trading: if(MinToNews<=MinsBeforeNews || MinSinceNews<=MinsAfterNews) ContinueTrading=false; I have allowed DLL imports in Metatrader. Any idea what I’m doing wrong? V. [/quote]
Hi Vlan, i think there is some thing wrong. Lets say we will have big news in 2 hours from now. So, the equation (MinToNews <= MinBeforeNews) will give (999999 <= 120) will always give FALSE result to ContinueTrading, and will never open any trade ….
December 24, 2015 at 8:57 am #10831Hi All,
IMHO, we should not be concerned about News as this is very common in Forex trading.
I think we should be more concerned about Volume and Trade entry points (Peak/Trough).
News releases are trading opportunities but we (Trader’s) don’t have control over its direction. We can find several spikes in history that were not triggered by News.
All that we should follow is a good money management to control loss but can’t stop. This is just my opinion.
Happy holidays!
Thanks!
December 24, 2015 at 10:16 am #10832Hi All, IMHO, we should not be concerned about News as this is very common in Forex trading. I think we should be more concerned about Volume and Trade entry points (Peak/Trough). News releases are trading opportunities but we (Trader’s) don’t have control over its direction. We can find several spikes in history that were not triggered by News. All that we should follow is a good money management to control loss but can’t stop. This is just my opinion. Happy holidays! Thanks!
I don’t agree with that statement.
Peak&Trough is our main logic, but pre-trading conditions are also important.
The EA should consider those pre-conditions, and if the user doesn’t want to consider some of those conditions he/she can disable them, but those conditions should be there.
G.
December 24, 2015 at 1:05 pm #10835ContinueTrading=false;
The condition by itself is OK, because 99999 is not less than 120, so it will not set ContinueTrading=false; and will continue trading.
My problem was that the indicator returned those same values every time. But it was in backtesting, so I was thinking that was the reason. But now I tried to run the ea on live chart with news coming in and it still returns those values.
Will have to look into it some more.V.
December 24, 2015 at 5:54 pm #10837Hi All, IMHO, we should not be concerned about News as this is very common in Forex trading. I think we should be more concerned about Volume and Trade entry points (Peak/Trough). News releases are trading opportunities but we (Trader’s) don’t have control over its direction. We can find several spikes in history that were not triggered by News. All that we should follow is a good money management to control loss but can’t stop. This is just my opinion. Happy holidays! Thanks!
Personally the only news that causes me to get flat going into news is Red News. Trading once Red News is announced is a whole different tactic.
December 31, 2015 at 12:21 pm #10911Ok, let’s talk about News Calendar Integration a bit.
Since I haven’t seen the code Emonts mentioned in his latest post yet, I continued to work through Derk Wehlers FFCal solution to get a grip on that one.
I found one interesting comment in his code which I’d like to discuss here:
Set AllowWebUpdates to false when using in another EA or Chart, so that the multiple instances of the indicator don’t fight with each other!
When we load more than one EA and / or indicator using our calendar solution (whichever it will be) these different instances will possibly ‘fight’ for exclusive access to file resources. This can possibly lead to runtime errors or text files being jammed. @emonts: is your solution safe against this?
Since I don’t like the idea of running several instances and having to exclude such errors by manually setting a certain input parameter, I’m considering technical measures to exclude this case automatically:
- using text file naming conventions that ensure each instance to download its own calendar resource file (might lead to an inflationary number of downloaded files)
- implementing file read / write algorithms that are robust against file sharing conflicts (didn’t check the code for that yet)
- ensure that only one calendar instance can be started at the same time
- ensure that several calendar instances can be started, but only the first one will be granted write access to the text files. All following ones will check that a ‘master’ instance is already active updating the calendar files, switching automatically to ‘slave’ mode, only reading those files.
- considering a different architecture of our solution: load only one news indicator which has access to the internet resources and updates calendar files. AFAIK, each new iCustom() call would load a new and possibly concurring instance, so this might be error prone, too. Hence it might make sense to think about a different way to pass information from that calendar indicator to our EA. Global variables of terminal-wide scope are limited to the double type, so we can’t pass the text information using those. A number of minutes as well as impact strength could be passed. The EA then would only read those globals, without touching the text files or attaching the calendar web resources.
Derk Wehler’s approach was to partially implement solution 1 (error prone). I think solution 4 is the most promising one.
What’s your opinion about this? Alternate approaches? Pro’s and Con’s?
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 2, 2016 at 6:05 pm #10944Ok, let’s talk about News Calendar Integration a bit. Since I haven’t seen the code Emonts mentioned in his latest post yet, I continued to work through Derk Wehlers FFCal solution to get a grip on that one. I found one interesting comment in his code which I’d like to discuss here:
Set AllowWebUpdates to false when using in another EA or Chart, so that the multiple instances of the indicator don’t fight with each other!
When we load more than one EA and / or indicator using our calendar solution (whichever it will be) these different instances will possibly ‘fight’ for exclusive access to file resources. This can possibly lead to runtime errors or text files being jammed. @emonts: is your solution safe against this? Since I don’t like the idea of running several instances and having to exclude such errors by manually setting a certain input parameter, I’m considering technical measures to exclude this case automatically:
- using text file naming conventions that ensure each instance to download its own calendar resource file (might lead to an inflationary number of downloaded files)
- implementing file read / write algorithms that are robust against file sharing conflicts (didn’t check the code for that yet)
- ensure that only one calendar instance can be started at the same time
- ensure that several calendar instances can be started, but only the first one will be granted write access to the text files. All following ones will check that a ‘master’ instance is already active updating the calendar files, switching automatically to ‘slave’ mode, only reading those files.
- considering a different architecture of our solution: load only one news indicator which has access to the internet resources and updates calendar files. AFAIK, each new iCustom() call would load a new and possibly concurring instance, so this might be error prone, too. Hence it might make sense to think about a different way to pass information from that calendar indicator to our EA. Global variables of terminal-wide scope are limited to the double type, so we can’t pass the text information using those. A number of minutes as well as impact strength could be passed. The EA then would only read those globals, without touching the text files or attaching the calendar web resources.
Derk Wehler’s approach was to partially implement solution 1 (error prone). I think solution 4 is the most promising one. What’s your opinion about this? Alternate approaches? Pro’s and Con’s? s.
1) will need big space (using many different file name, although we can delete it later, but that is extra work)
2) ==
3) may be can reduce conflict of read⁄write in number 2)
4) i think should be ok … the master process can be changed⁄replace by slave process after master’s job is finish (a slave becomes a master process if needed)?
5) can we use another simple txt file instead of Global Variable? In this case, just have read access (slave process). This is similar to number 4), but just using function ⁄class ?
January 2, 2016 at 6:20 pm #10945Set AllowWebUpdates to false when using in another EA or Chart, so that the multiple instances of the indicator don’t fight with each other!
Hi.
My first post here. This development seems promising.
But the backtest, 35 trades over 5.5 years. Are you sure?
Here is backtest on the latest v1.3
———————————————–– Default settings
– Start account $10.000
– 99% Dukascopy tickdata from 2010-01-01
– Real spread
– $7 commission
– Backtest made with TickDataSuite———————————————–
January 3, 2016 at 1:25 am #10951Hi. My first post here. This development seems promising. But the backtest, 35 trades over 5.5 years. Are you sure? Here is backtest on the latest v1.3 ———————————————– – Default settings – Start account $10.000 – 99% Dukascopy tickdata from 2010-01-01 – Real spread – $7 commission – Backtest made with TickDataSuite ———————————————–

Welcome mate. I haven’t tested v 1.3 yet (will test it soon), but as you know some other features are not implemented yet in this version . But looking at your result (although it is still getting some loss), yes it is promissing. I am sure after all requirements are fullfill (peak trough, osc, trend, etc), we will see a much better result. Try to give your ideas, cide snippets, or other thing you feel should be usefull in this development. One question: Did you test it on big TF like D1 or W1?
January 3, 2016 at 2:12 am #10953Hi all,
I got this line of code from other thread :
double V = ( MathAbs(Open – Close) * MathPow(High – Low, -1) ) * Volume;
Just want to make sure about zero devide. If the result of (High-Low)==0.0, then the equation MathPow(High-Low, -1) will cause error. Is it right?
@pipatronic : Thanks for info about Obv Div.
January 3, 2016 at 3:21 am #10954Hi all, I got this line of code from other thread :
double V = ( MathAbs(Open – Close) * MathPow(High – Low, -1) ) * Volume;
Just want to make sure about zero devide. If the result of (High-Low)==0.0, then the equation MathPow(High-Low, -1) will cause error. Is it right? @pipatronic : Thanks for info about Obv Div.

Hi Brother, zero divide should involving division operation, while in your code example this is multiplication operation, so the result could be zero but not zero divide error.
From my noob perspective, before that line of code you could make sure by ‘if’ condition like;
if ( (High - Low) != 0.0 )to protect zero result condition
Hope it help and best regards
MTH
-
This reply was modified 10 years, 3 months ago by
MTH2014.
Intuition, Experiences and Common sense..
http://www.binaryoptionsedge.com/January 3, 2016 at 9:42 am #10958Set AllowWebUpdates to false when using in another EA or Chart, so that the multiple instances of the indicator don’t fight with each other!
Hi. My first post here. This development seems promising. But the backtest, 35 trades over 5.5 years. Are you sure? Here is backtest on the latest v1.3 ———————————————– – Default settings – Start account $10.000 – 99% Dukascopy tickdata from 2010-01-01 – Real spread – $7 commission – Backtest made with TickDataSuite ———————————————–

Adding Commission distort the whole TRAILING process in MT4, since it is not included in the trailing calculation (besides the fact that the logic isn’t finished yet).
To simulate commission you should add it to the spread and multiply it by the lot size.
G.
-
This reply was modified 10 years, 4 months ago by
- AuthorPosts
- You must be logged in to reply to this topic.
