› 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 15, 2015 at 5:46 pm #10394
Ok, as announced earlier my ‘volume per session’ contribution to start our baby. For the purpose of this thread, I stripped my volume per session indicator down to the minimum and placed the function set in an MQH library file for convenient linking to the EA. So the indicator file may just act as an example for using this little lib. @vlanfx: feel free to ask if anything is unclear! On the pics provided you see examples of how I’m planning to document my contributions to this little project, especially file headers and function headers. Should be easier to integrate and understand the contributions of a bunch of authors if everybody approves to some minimum standard of inline comments. One pic shows my file header and an enumeration header, the other one a typical function header, with a short description of every parameter. Special techniques used can be described under ‘Remarks’. @vlanfx: feel free to modify or enhance
If you would suggest any naming conventions to avoid problems during compilation, please post! s.Please post sample “include” for @vlanfx to interface that lib.
G.
December 15, 2015 at 6:04 pm #10395i did a little work to this so here is version 0.1 GmtOffset – makes a gmt time that will be used on TradeTimes
TradeTimes – you can use StartHour/EndHour Cs – added simple curency stenght function – it does put ob/os currencys into array. builds pairs of em and if they are allowed they are put in trade_symbol[].. ide is that it will find proper pairs based on ob os conditions and trade thoes.. also is very so far and need futher work. VolOsc func – added function that signals ob os on VolOscilator that was shared here somewhere. Added stuff to initalize so we get less errors if something is wrong. it may contain bugs tho i didnt tryed it out fully yet.. not that it can contain bugs. the InitCs function also needs more work..
Thanx for contributing.
Please note that @vlanfx is in charge and responsible for versioning.
Any addition/contribution please post as separate file and @vlanfx decide where to integrate it.
BTW: your “Comment” overwites already existing one. That’s one of the reasons why only one person is in charge of new versions, and it’s @vlanfx.
G.
December 15, 2015 at 6:09 pm #10396
Anonymous[quote quote=10391]i did a little work to this so here is version 0.1 GmtOffset – makes a gmt time that will be used on TradeTimes
TradeTimes – you can use StartHour/EndHour Cs – added simple curency stenght function – it does put ob/os currencys into array. builds pairs of em and if they are allowed they are put in trade_symbol[].. ide is that it will find proper pairs based on ob os conditions and trade thoes.. also is very so far and need futher work. VolOsc func – added function that signals ob os on VolOscilator that was shared here somewhere. Added stuff to initalize so we get less errors if something is wrong. it may contain bugs tho i didnt tryed it out fully yet.. not that it can contain bugs. the InitCs function also needs more work..
Thanx for contributing.
Please note that @vlanfx is in charge and responsible for versioning.
Any addition/contribution please post as separate file and @vlanfx decide where to integrate it.
BTW: your “Comment” overwites already existing one. That’s one of the reasons why only one person is in charge of new versions, and it’s @vlanfx.
G. [/quote]
alright i will send it to vlanfx then..
about the comment , its not. i renamed comments in the lots or sl function to lotsinfo and made comments to global and added lotscomments and cscomments into globalcomments.
December 15, 2015 at 7:19 pm #10397[quote quote=10395][quote quote=10391]i did a little work to this so here is version 0.1 GmtOffset – makes a gmt time that will be used on TradeTimes
TradeTimes – you can use StartHour/EndHour Cs – added simple curency stenght function – it does put ob/os currencys into array. builds pairs of em and if they are allowed they are put in trade_symbol[].. ide is that it will find proper pairs based on ob os conditions and trade thoes.. also is very so far and need futher work. VolOsc func – added function that signals ob os on VolOscilator that was shared here somewhere. Added stuff to initalize so we get less errors if something is wrong. it may contain bugs tho i didnt tryed it out fully yet.. not that it can contain bugs. the InitCs function also needs more work..
Thanx for contributing.
Please note that @vlanfx is in charge and responsible for versioning.
Any addition/contribution please post as separate file and @vlanfx decide where to integrate it.
BTW: your “Comment” overwites already existing one. That’s one of the reasons why only one person is in charge of new versions, and it’s @vlanfx.
G. [/quote]
alright i will send it to vlanfx then..
about the comment , its not. i renamed comments in the lots or sl function to lotsinfo and made comments to global and added lotscomments and cscomments into globalcomments.
[/quote]
Comment should be Comment(comment + “….”) where “comment” is aggregated, and not over-complicated.
In any case post your suggested file here and @vlanfx will add it.
I’m not familiar with your CS. Where can we check it?
G.
December 15, 2015 at 7:28 pm #10398Please post sample “include” for @vlanfx to interface that lib.
It’s in the indicator I posted (that’s why I posted it, and to check it’s function). Just one line of code, with lib placed in the Include folder:
#include <_simplex_Volume.mqh>All functions are used in this indicator, a simple example for using the lib.
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 15, 2015 at 7:50 pm #10399@slicken:
I gave your CS code a short review (without drilling deeply into detail). In your code you commented:
InitCs(); // ... need fix and more work‘need fix and more work’ is not very precise. Are there bugs? Is it lagging too much? Too many false signals? Runtime errors? … Please provide more detail! Just guessing for debugging is too time consuming.
I think it would be interesting to have a CS algo packed into one single function, if it works correctly! So you at least got my attention, and I’m waiting with interest for more information about that ‘need fix and more work’ detail.
And, as gg53 wrote: it would be interesting to have the function packed into an indicator for testing.
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 15, 2015 at 8:45 pm #10400@slicken again:
I did not run your EA. But from reviewing your
CSInit()a little more, I would say that one issue is the base algorithm:For each pair involved you compare the value of a fast MA and a slow MA, and this comparison is a simple difference, with JPY weighed with a factor of 0.01. This will not provide precise results. It does not take into account different price levels of pairs.
And you’re using MQL standard iMA method, which does not have a good performance.
Second thing, trying to understand your basic idea: under certain consitions (threshold Cs_ObOs) you mark a currency as overbought or oversold by writing that currency symbol in arrays ob[] or os[]. Correct?
In the next step, you combine those values in a loop:
string pair = ob + os[j];and check, whether pair is a valid symbol. If yes, you have an entry. Correct so far?
So if EUR is in ob[] and USD is in os[], you would have a short entry for EURUSD.
But what if EUR is in os[] and USD is in ob[]? The resulting symbol is USDEUR, it’s invalid, and you get no long entry. The valid case is never checked. So for EURUSD, you would get only short entries and miss the long ones.
Maybe I overlooked something. But I think, that this is an issue that needs a bugfix.
Please report back whether I’m right or wrong 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)
December 15, 2015 at 9:17 pm #10401
AnonymousAbout the CS function.
The calculation algo is based on another CS indicator i found somewhere, dont remeber exacly where but it could be in this forum. I didnt do to mutch changes to it. I was playing around with it a fiew month ago and I found my default settings pretty simular to Gadi_CS. So It should work prety properly I dont know any bugs yet. (see pic. upper=this , lower=gg53’s).
In the middle and downwords in the InitCS() function i made it collect OB and OS currencys into array ob[] and os[] . After its done it tryes to make real pair symbols of them by combining ob+os. If symbol exist and is alowed (looking for match in the string called AllowedSymbols=”EURUSD, GBPUSD, and other allowed symbols”; this should be a Input string. Then it puts the real symbol in a array called trade_symbol[]. This is where i wanted it to collect symbols that it should be looking for signals on.
The “fix” and futher work i ment was this. I dont know if its enuff to only pick OB and OS symbols and put them together. Maby its better to use OS + OS or wating for OB + OS to move towards middle from thease OB OS ares.
Altho the function seems to work and is picking OB and OS symbols atm and combines them and puts them into the trade_symbol[] array .. this is how far i have gotten.. So everything works but need better logic of picking symbols. So this is for someone else to take over from there if you want it use it :)
here is how it can be continued when it found tradable symbols:
if (ArraySize(trade_symbols) > 0)
{
for (int i = 0; i < ArraySize(trade_symbols); i++)
{
symbol = _Symbol;
MAXLOT = MarketInfo(symbol, MODE_MAXLOT);
MINLOT = MarketInfo(symbol, MODE_MINLOT);
LOTSTEP = MarketInfo(symbol, MODE_LOTSTEP);
STOPLEVEL = MathMax(MarketInfo(symbol, MODE_FREEZELEVEL), MarketInfo(symbol, MODE_STOPLEVEL)) * _Point;
lotsdigits = (int)(MathLog(LOTSTEP) / MathLog(0.1));
digits = (int)MarketInfo(symbol, MODE_DIGITS);
point = MarketInfo(symbol, MODE_POINT);
ask = MarketInfo(symbol, MODE_ASK);
bid = MarketInfo(symbol, MODE_BID);
and start looking signals..
/ slicken
December 15, 2015 at 9:37 pm #10403@slicken: thanks for your fast reply!
So that means if function CSInit() finds an ob/os situation for symbol USDEUR, it will turn this invalid symbol around to EURUSD?
I failed to identify that part. Could you point me there?
s.
EDIT: and could you possibly post your indicator code so I can compare the results with my posted CIX?
-
This reply was modified 10 years, 6 months ago by
simplex.
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 15, 2015 at 10:31 pm #10405This CS discussion looks interesting, but I want to see a working indicator to compare it’s accuracy and lagging, instead of reviewing bits of code.
This should be done in any case, because we have several CS’s to choose from, and we need to be practical and focus on this specific EA.
We should be using it inside the EA as a function, returning either “1”, “-1”, or “0”, for confirming up, down or no signal, and not in the main EA logic.
G.
December 15, 2015 at 11:23 pm #10406wow, a lot of activity here.
I filled out the EA skeleton provided by GG53 with logic from the PeakThroughEA and thus creating the first version of the Penguin EA.
The basic functionality is the same and it has the same performance. There are also other functions provided with the skeleton to dynamicaly calculate TP, SL and Lots.I placed functions related specifically to PaT to separated source file – Penguin_PeakThrough.mqh library (place it inside the ‘Include’ folder). I plan to do this also for Volume and Currency strength functions. It should keep code more organized.
For next release, we should fix/change logic in the peakThrough algorithm (currently it trades only on closed bars) and then move to maybe Volume or CS logic.
V.Attachments:
You must be logged in to view attached files.December 15, 2015 at 11:33 pm #10409vlanfx
I don’t have it as a separate indicator at the moment. I just compared the ea’s behavior to indicator posted by @tankhang
V.
December 16, 2015 at 1:48 am #10410After some tests/trials:
I prefer Buy-Limit @Close +xx, instead of the current Buy-Stop @High+xx.
In cases where entry is in mid-bar, entry should be also a Buy-Limit instead of Buy-Stop.
Vice versa for Shorts.
Advantage: More pips.
G.
December 16, 2015 at 5:37 am #10411Hi
Here is the concept idea of Peak And Trough..
Maybe there is other way round (better algo) to implement it..
In my case, it need to wait (n)th bar finish to determine the validity of the change..
@gg53 please correct it if my interpretation was wrong..tankhang
-
This reply was modified 10 years, 6 months ago by
tankhang.
Attachments:
You must be logged in to view attached files.December 16, 2015 at 8:44 am #10421About the CS function. The calculation algo is based on another CS indicator i found somewhere, dont remeber exacly where but it could be in this forum. I didnt do to mutch changes to it. I was playing around with it a fiew month ago and I found my default settings pretty simular to Gadi_CS. So It should work prety properly I dont know any bugs yet. (see pic. upper=this , lower=gg53’s). In the middle and downwords in the InitCS() function i made it collect OB and OS currencys into array ob[] and os[] . After its done it tryes to make real pair symbols of them by combining ob+os. If symbol exist and is alowed (looking for match in the string called AllowedSymbols=”EURUSD, GBPUSD, and other allowed symbols”; this should be a Input string. Then it puts the real symbol in a array called trade_symbol[]. This is where i wanted it to collect symbols that it should be looking for signals on. The “fix” and futher work i ment was this. I dont know if its enuff to only pick OB and OS symbols and put them together. Maby its better to use OS + OS or wating for OB + OS to move towards middle from thease OB OS ares. Altho the function seems to work and is picking OB and OS symbols atm and combines them and puts them into the trade_symbol[] array .. this is how far i have gotten.. So everything works but need better logic of picking symbols. So this is for someone else to take over from there if you want it use it :) here is how it can be continued when it found tradable symbols: if (ArraySize(trade_symbols) > 0) { for (int i = 0; i < ArraySize(trade_symbols); i++) { symbol = _Symbol; MAXLOT = MarketInfo(symbol, MODE_MAXLOT); MINLOT = MarketInfo(symbol, MODE_MINLOT); LOTSTEP = MarketInfo(symbol, MODE_LOTSTEP); STOPLEVEL = MathMax(MarketInfo(symbol, MODE_FREEZELEVEL), MarketInfo(symbol, MODE_STOPLEVEL)) * _Point; lotsdigits = (int)(MathLog(LOTSTEP) / MathLog(0.1)); digits = (int)MarketInfo(symbol, MODE_DIGITS); point = MarketInfo(symbol, MODE_POINT); ask = MarketInfo(symbol, MODE_ASK); bid = MarketInfo(symbol, MODE_BID); and start looking signals.. / slicken
Hi mate,
May i know what is the different between _Point and point ? Does _Point calculates the 2/3 digits & 4/5 digits broker ? I mean, may be if it is 3 or 5 digits broker, _Point = point * 10 ?
Thanks
December 16, 2015 at 9:03 am #10423
Anonymous@slicken: thanks for your fast reply! So that means if function CSInit() finds an ob/os situation for symbol USDEUR, it will turn this invalid symbol around to EURUSD? I failed to identify that part. Could you point me there? s. EDIT: and could you possibly post your indicator code so I can compare the results with my posted CIX?
The way it’s working right now is that it only combines ob+os witch, it also must to be able to do it the other way around os+ob (and maby ob+ob/ os+os I don’t know really the optimal state condition on how to choose pairs properly using a cs) so this is where it need more work. With the conditions and with making it be able to combine the other way around.
I made the ob ob part just yesterday pretty quickly as a idie on how it could be done. It works picking ob+os but not more then that.
My indicator is not finished and contain some bugs. I will send it to you tho so you can try and compare to others.
The algo as I said is not mine I was just playing around with this cs some time ago and was thinking of modding It and put my touch in it but it never got finish.
If you want me to redo the function in another way or anything I will gladly help to do ir or something else needed.
December 16, 2015 at 10:15 am #10424@slicken: thanks again! For about 10 minutes or so, I have an indicator version on screen now.
What it points out sharply are reversal points of currency lines. But the currencies are oscillating at very different amplitudes due to the simple scaling.
Your ob / os levels are hardly ever reached on most timeframes, because there is no compensation for timeframe scaling effects. And the different amplitudes are not comparable regarding any fixed level.
Maybe I can tune this algo a bit.
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 16, 2015 at 10:48 am #10425Currency-Strength is a good indicator to add to our system, but please move the discussion of its inner build to the proper thread. Suggest one when it is finished and bug free – with proper way on how to use it to enhance our current EA.
G.
December 16, 2015 at 10:54 am #10426Ok.
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 16, 2015 at 10:57 am #10427
Anonymous@slicken: thanks again! For about 10 minutes or so, I have an indicator version on screen now. What it points out sharply are reversal points of currency lines. But the currencies are oscillating at very different amplitudes due to the simple scaling. Your ob / os levels are hardly ever reached on most timeframes, because there is no compensation for timeframe scaling effects. And the different amplitudes are not comparable regarding any fixed level. Maybe I can tune this algo a bit. s.
yes the cs_avg= is not correct coded and need fix i forgot to mention that.. therefore i added manual Inputs. Maby you can fix it or tune it :)
Also if someone could explain more in details what preferable conditions are in CS to find strong trends .. then maby i could start working on that part.
December 16, 2015 at 11:30 am #10429
AnonymousCurrency-Strength is a good indicator to add to our system, but please move the discussion of its inner build to the proper thread. Suggest one when it is finished and bug free – with proper way on how to use it to enhance our current EA. G.
Sorry for this. Will do :)
December 16, 2015 at 12:19 pm #10430Sorry, my BUG…
calcLOT designed to receive SL in POINTS and not PIPS, so we need to divide recieved variable /10.
G.
-
This reply was modified 10 years, 6 months ago by
gg53.
December 16, 2015 at 3:07 pm #10434Please add reverse entry logic to EXIT trade if happened before SL.
(i.e. if Trough becomes Peak and we entered Long trade – than if it turns back into Trough again -> we exit trade.)
G.
December 16, 2015 at 3:27 pm #10435
AnonymousHi mate, May i know what is the different between _Point and point ? Does _Point calculates the 2/3 digits & 4/5 digits broker ? I mean, may be if it is 3 or 5 digits broker, _Point = point * 10 ? Thanks
Hi. _Point should be the same as using Point or Point() if im not wrong, “The _Point variable contains the point size of the current symbol in the quote currency.”
Same goes for _Symbol, _Period and _Digits :)
December 16, 2015 at 5:35 pm #10438I’ve added more logic to the current one, using my version of CS, and it’s doing more than Ok on live (demo acct) trades.
The problem is that CS can’t be accurately backtested (MT4 backtest consider only current pair currencies), so I suggest we leave CS as a last addition, although I still consider it as major addition to this EA.
G.
-
This reply was modified 10 years, 6 months ago by
- AuthorPosts
- You must be logged in to reply to this topic.