› 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
- January 27, 2016 at 9:59 am #11326
Testing some indicators today … thanks for nice indicators mates

Attachments:
You must be logged in to view attached files.January 27, 2016 at 10:13 pm #11333I’m away until next week, so would you please make and post the next EA version 1.4 with the news filter from @fuzzy?
Thanks.@fuzzy, thanks for contributing, good work.
V.
January 27, 2016 at 11:03 pm #11334Thanks for your faith in me! As you can easily see from the code I sent you recently, my coding style is quite different from yours. I would feel more confident basing my further work on the version I sent you for review, not on yours. But I’m afraid that might introduce a major break in our overall workflow. Please do not take this a sign of disrespect!
I can give it a try based on your most recent version 1.3, but I’m not sure whether it will work out.
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 28, 2016 at 2:44 am #11335@VlanFx: Thanks for your faith in me! As you can easily see from the code I sent you recently, my coding style is quite different from yours. I would feel more confident basing my further work on the version I sent you for review, not on yours. But I’m afraid that might introduce a major break in our overall workflow. Please do not take this a sign of disrespect! I can give it a try based on your most recent version 1.3, but I’m not sure whether it will work out. s.
I think it’s Ok to convert to your style and @VlanFx will adapt to that style later on. That will save precious time, and later on you can both coordinate published versions.
Many thanks to all contributing members.
G.
January 28, 2016 at 11:24 am #11339@VlanFx: Thanks for your faith in me! As you can easily see from the code I sent you recently, my coding style is quite different from yours. I would feel more confident basing my further work on the version I sent you for review, not on yours. But I’m afraid that might introduce a major break in our overall workflow. Please do not take this a sign of disrespect! I can give it a try based on your most recent version 1.3, but I’m not sure whether it will work out. s.
That’s no problem simplex. I’m away and wouldn’t want the group to wait.
V.
January 28, 2016 at 12:40 pm #11341Have a good trip, @VlanFx!
Ok then, give me two days or so. Will call for assistance by @andymack aka fuzzy for the implementation. Don’t have much experience with the OOP approach.
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 28, 2016 at 12:54 pm #11342February 2, 2016 at 10:39 pm #11392you’re most welcome GG53
I’ve attached the latest version of the newsCalendar indicator . I repaired a bug concerning backtesting and catching up data and the time it thinks it is when download latest calendar (I feel like such a dill) .
February 2, 2016 at 11:44 pm #11395I’m still working on the integration of the news calendar lib in our EA, having tried two versions: one function calling the calendar lib directly, and one calling the impact indicator via iCustom(). None of them are working by now.
Attaching the indicator to a chart manually works fine: news are updated and levels are displayed. Perfect!
Calling the lib directly in the EA gives a constant output = -12 (calendar file not found).
Calling via iCustom() gives a constant output = -1 (no news item found).
Before you’re asking: yes, DLL import is allowed, and XML files are ok. My implementation followed your code example. At the moment I have no idea what’s wrong. Any ideas?
@fuzzy: I used the version you sent me by PM. I think tomorrow I’ll tweak it a little bit so it writes some log lines in case of an error to support further debugging. Would be helpful to know which file is used, etc. It’s well after midnight on this end of the planet, and I’ll be catching some sleep now. If you’re faster than I am and can provide some logging: even better for me!
s.
// --------------------------------------------------------------------------------------------- check news calendar datetime serverTime = Time[0]; static int previousImpact = 0; static bool newsBlocked = false; int currentImpact = updateNewsCalendar(symb, serverTime); // int currentImpact = updateNewsCalendarIndicator(symb, tf, 0); if (blockFromLevel > 0) { if (currentImpact >= blockFromLevel) { newsBlocked = true; } else { newsBlocked = false; } } if (currentImpact != previousImpact) { string printPrefix = eaLog(__FUNCTION__, "News impact changing from "); string newsStatus = "allowed."; if (newsBlocked) { newsStatus = "blocked."; } Print(printPrefix, IntegerToString(previousImpact), " to ", IntegerToString(currentImpact), ". Trading is ", newsStatus); previousImpact = currentImpact; } int updateNewsCalendar(string sym, datetime _time ) { NewsCalendarItem newsItem; datetime gmt = _time - BrokerGMToffset * 3600; int newsValue = newsCalendar.getNewsImpactLevel(sym, gmt, minutesBeforeNews, minutesAfterNews); return(newsValue); } int updateNewsCalendarIndicator(string sym, int _tf, int sh ) { int newsValue = (int)NormalizeDouble(iCustom(sym, _tf, NEWS_INDI_NAME, minutesBeforeNews, minutesAfterNews, BrokerGMToffset, minutesRefresh, 0, sh), 0); return(newsValue); }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)
February 2, 2016 at 11:49 pm #11396@fuzzy: just found your new PM with the new code you sent me minutes ago – thanks! Will give it a quick try and report back.
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)
February 3, 2016 at 12:07 am #11397Ok, something has changed with the new version: we’re having a constant output = 0 now when calling via iCustom().
When calling the lib directly it remains a constant -12.
I’ve had an idea regarding iCustom() use: the EA is executed using timeframe H4, but your news indicator requires lower timeframes to display correctly. So that version can’t work, IMO, but calling the lib should work.
Time to sleep now! Any idea welcome!
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)
February 3, 2016 at 10:28 am #11401OK, we’re getting closer! A little sleep helps, and fuzzy’s PMs also help

First of all the first line of code I posted above was complete nonsense:
datetime serverTime = Time[0];Replace it with
datetime serverTime = TimeCurrent();and things might work!
During backtest calendar XML files were not being created in the \tester\files folder. That’s why the calendar did not work initially. After copying files manually, and with the above change in my code, the calendar basically works, see screenshot.
Now one of the remaining problems is performance: backtesting one single day took about 7 minutes on a fast XEON. I tried to reduce file read frequency, but no change so far.
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)
February 4, 2016 at 10:53 am #11408Ok, news calendar is working now! Fuzzy did a wonderful job coding that lib as a class. Once I’ve learned to implement classes correctly I might be able to do the job a little faster next time

Some code cleaning now on my side of the implementation, green light from his side and we’re going public with v. 1.4.
Stay tuned!
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)
February 4, 2016 at 1:21 pm #11416Hi G,
About the market share, do i calculate it based on its pair “portion” ?
USD = ( EURUSDs1 + GBPUSDs2 + AUDUSDs3 … ) / 7.
So, the value of s1 = mEUR/mUSD , s2 = mGBP/mUSD … where mEUR is the share of EUR and mUSD is the share of USD.
Or we do it for each currency , after all other calculations like Vol, Momentum, etc are made :
USD = ( EURUSDd1 + GBPUSDd2 + AUDUSDd3 … ) / 7 => d1 , d2 … is other calculation …
USD = mUSD * USD … where mUSD is the share of USD
Or if we do it for each currency at the end … may be we do it like this ?
USD = USD * mUSD / (mUSD + mEUR + mGBP + mAUD + mNZD + mCAD + mCHF + mJPY)
Thanks in advance G.
February 4, 2016 at 2:11 pm #11418Hi G, About the market share, do i calculate it based on its pair “portion” ?
USD = ( EURUSDs1 + GBPUSDs2 + AUDUSDs3 … ) / 7. So, the value of s1 = mEUR/mUSD , s2 = mGBP/mUSD … where mEUR is the share of EUR and mUSD is the share of USD.
Or we do it for each currency , after all other calculations like Vol, Momentum, etc are made :
USD = ( EURUSDd1 + GBPUSDd2 + AUDUSDd3 … ) / 7 => d1 , d2 … is other calculation … USD = mUSD * USD … where mUSD is the share of USD
Or if we do it for each currency at the end … may be we do it like this ?
USD = USD * mUSD / (mUSD + mEUR + mGBP + mAUD + mNZD + mCAD + mCHF + mJPY)
Thanks in advance G.
This belongs in one of the Currency-Strength threads. I posted my “index” version as a suggestion to simplex CIX addition/option.
G.
February 4, 2016 at 3:22 pm #11419This belongs in one of the Currency-Strength threads. I posted my “index” version as a suggestion to simplex CIX addition/option. G.
Thanks a lot G, will look at it again …
February 4, 2016 at 10:15 pm #11427ClearMethod Peaks & Troughs can be further enhanced by using ADX (some modifications of an “ADX Candles” indicator).
G.
February 5, 2016 at 10:07 am #11435Changing TF’s or currency pairs on your ClearMethod MTF version, causes the MTF to disappear, manual refreshing returns the indicator to correct state.
G.
February 5, 2016 at 1:11 pm #11439Changing TF’s or currency pairs on your ClearMethod MTF version, causes the MTF to disappear, manual refreshing returns the indicator to correct state.
Thanks, I’ll have a look inside.
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)
February 5, 2016 at 2:12 pm #11442Correct, there was a bug. Please find an updated version over here.
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)
February 7, 2016 at 12:38 pm #11464We can currently agree on few key elements of the EA’s Logic:
Trend:
ClearMethod: simplex latest version with current and 1 or 2 higher TF’s, Trend direction according to HTF, entries on areas of current TF in opposite to Trend direction.
TVI (or TickVolume): (Optional) Trend direction defined by above/below zero, entries areas are in opposite direction.
Exact bar for entry:
VZO (or VolumeOsc): when above/below range, in opposite direction of Trend.
Currency-Strength:
Here we have a problem… This one should indicate strong/weak currencies (Sentiment) by their location above/below the “0” line.
Comparing my ForexGT_Spaghetti with simplex CIX, I found that currencies location in relation to the “0” line are different.
We need conclusion on this one.
Attached is comparison (CIX is default params, USD majors even, Timeframe normalization) USD both in Green.
G.
Attachments:
You must be logged in to view attached files.February 7, 2016 at 2:09 pm #11466I own a car with a six-step gearbox. I’ve never had the idea to use only one of them, let’s say third or fifth gear. When I drive my car I take the freedom to choose between all six gears with regard to the current situation, reflecting my experience as a seasoned driver.
It’s the same way I’m using the input parameters of my indicators. It just does not make any sense to use default inputs for each and every comparison with another indicator.
If comparison with ForexGT_Spaghetti is that important, I’m ‘again’ calling everybody who has access to that one to make use of the CIX gearbox (input parameters) and try to adjust it in a way that provides the best fit. Starting from that point we might turn this part of our discussion and development in a new direction. I do not have access to ForexGT_Spaghetti, so I can’t provide this specific detail.
Apart from that, any idea from any thread contributor leading to an improvement of CIX is most welcome.
Best,
s.
Edit: since I’m not Phil Connors, I’m out of this specific CS part of our discussion and development, until new information is on the table. Following scientific principles, ‘new information’ could be a so far unknown theory, preferrably based on replicable math, or new experimental evidence including detailed setup for everybody competent enough to reproduce the proposed results. This
while (true)loop requires abreak, re-entry not excluded. Please consider this a call for action targeted at everybody interested in our community project.-
This reply was modified 10 years, 2 months ago by
simplex. Reason: addendum
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)
February 7, 2016 at 3:28 pm #11469I own a car with a six-step gearbox. I’ve never had the idea to use only one of them, let’s say third or fifth gear. When I drive my car I take the freedom to choose between all six gears with regard to the current situation, reflecting my experience as a seasoned driver. It’s the same way I’m using the input parameters of my indicators. It just does not make any sense to use default inputs for each and every comparison with another indicator. If comparison with ForexGT_Spaghetti is that important, I’m ‘again’ calling everybody who has access to that one to make use of the CIX gearbox (input parameters) and try to adjust it in a way that provides the best fit. Starting from that point we might turn this part of our discussion and development in a new direction. I do not have access to ForexGT_Spaghetti, so I can’t provide this specific detail. Apart from that, any idea from any thread contributor leading to an improvement of CIX is most welcome. Best, s.
My car have Automatic gear shifting…
Strangely enough, same params on both indicators looks quite the same on M30, but quite different on H4, as seen in above screenshot.
It’s not a question of adjusting gear shift, but what parameters setting correctly reflect the market.
If we decide to go with this logic:
LONG with currency the first time it becomes the strongest, SHORT on all currencies that are below “0” and pointing down.
This logic constantly produce 2-3 trades per such event (H4), mostly 2 events per day, Minimum 10 pips per trade. (Min. 40-60 pips per day)
Above logic will produce different currencies results, if compared between indicators, regardless of each one “value”.
The Forex_Spaghetti indicator is based on my already posted USDx anchor, taking into account its market share. detailed on that was also posted.
G.
February 7, 2016 at 4:31 pm #11470Yes, mine is an automatic one, too, but with the opportunity to interact manually if preferred – just like the EA is supposed to be.
Thanks for your entry suggestions, yet this is not the point for me. We’ve had several discussions about USDx anchor and how to reflect it in CS values. This is the specific part where our discussion got stuck in the past.
Your entry suggestions will certainly enter the EA development, regardless which specific CS indicator is used, once VlanFx is back, reviews my code and decides / discusses how to proceed.
I’m open for that and will continue to proceed my own development until then.
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)
February 7, 2016 at 4:38 pm #11471Validity of the CS model can be verified by comparing the USDx indicator (with market share weight) against ForexGT_Spaghetti.
When the USDx (Green) gets stronger (dotted Yellow above Red) the USD currency become strong on the ForexGT_Spaghetti (above “0”).
When the USDx (Green) gets weaker (dotted Yellow below Red) the USD currency become weaker on the ForexGT_Spaghetti (below “0”).
All marked with the vertical lines.
G.
Attachments:
You must be logged in to view attached files. -
This reply was modified 10 years, 2 months ago by
- AuthorPosts
- You must be logged in to reply to this topic.