› 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 16, 2015 at 6:34 pm #10442
Please add another condition for exiting the pre-check before trade entry:
//Don’t trade large bars
//if((High[1]-Low[1])>2*ATR) return;We can debate if it should be double or more, or make it a user parameter.
Thanks,
G.
December 16, 2015 at 6:49 pm #10444
AnonymousI’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.
Great! Looking forward to see how it is working.
Yes its a shame MT4 EA’s cant be backtested using strategy tester across multiple currencies as MT5.
I saw SL is also ATR based. This is intresting. I have been testing this method many times before but I never got it to preform better than a fixed value in the long run. So im exited to see if it can outpreform a fixed value.
December 16, 2015 at 8:07 pm #10445[quote quote=10438]I’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.
Great! Looking forward to see how it is working. Yes its a shame MT4 EA’s cant be backtested using strategy tester across multiple currencies as MT5. I saw SL is also ATR based. This is intresting. I have been testing this method many times before but I never got it to preform better than a fixed value in the long run. So im exited to see if it can outpreform a fixed value. [/quote]
StopLoss is volatility based, and as such it’s specific to each pair and current market situation.
When trading long TF’s, it’s almost impossible to do it both effectively and manually, unless you’re “glued” to the screen.
G.
December 17, 2015 at 12:17 am #10448VlanFx, Please 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.)
VlanFx, Please add another condition for exiting the pre-check before trade entry: //Don’t trade large bars //if((High[1]-Low[1])>2*ATR) return; We can debate if it should be double or more, or make it a user parameter. Thanks, G.
Attached is new version of the PenguinEA
Changes in logic were made based on GG53 ideas in the quoted posts.
V.Attachments:
You must be logged in to view attached files.December 17, 2015 at 7:57 am #10455[quote quote=10434]VlanFx, Please 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.)
VlanFx, Please add another condition for exiting the pre-check before trade entry: //Don’t trade large bars //if((High[1]-Low[1])>2*ATR) return; We can debate if it should be double or more, or make it a user parameter. Thanks, G.
Attached is new version of the PenguinEA Changes in logic were made based on GG53 ideas in the quoted posts. V. [/quote]
Thanks a lot Vlan
will test it … if it is without trend rule, the result is good … then with trend, it will be really great ….
December 17, 2015 at 8:14 am #10456VlanFx, Please 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.
Hi G, i do not understand this part of logic. We do our Long entry point at Peak, Not at Trough? And we exit that Long trade at Trough, Not at Peak?
Could you pleae explain the reason why we do that? Or i have missed understood it?Thanks
December 17, 2015 at 1:57 pm #10464Hi, I just added the Xmeter Function inside the EA
but, I am not able to compile it, for unknown reasons.
I put the code in attachement (in case you could correct it for compilation)
regards
jag
December 17, 2015 at 2:10 pm #10465
Anonymoushi.
@VlanFX hi man!I have done some changes, please take a look and see if you think this is ok.
- modified _all_ functions (didnt change there algo they work the same) so they can work with any symbol and timeframe
- corrected all errors i found. now it doent give any error in tester
- added new trailing, old one gave many errors and only trailed for current chart. now it works for the ordersymbol. also added TrailingStep
- added tradetimes StartHour, EndHour will determ when trades can be open. if no trades are open and its not within tradetime it will Loop the EA
- added near daily pivots filter, dont know if it imporves the end result so mutch but this maby can be modified later on to work better i disabled it for now
December 17, 2015 at 2:40 pm #10467[ deleted, wrong post …. ]
-
This reply was modified 10 years, 6 months ago by
smallcat.
December 17, 2015 at 3:38 pm #10469again
December 17, 2015 at 4:57 pm #10476[quote quote=10434]VlanFx, Please 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.
Hi G, i do not understand this part of logic. We do our Long entry point at Peak, Not at Trough? And we exit that Long trade at Trough, Not at Peak?
Could you pleae explain the reason why we do that? Or i have missed understood it? Thanks [/quote]We enter LONG when we are in Trough area breakout.
G.
December 17, 2015 at 5:00 pm #10477Hi, I just added the Xmeter Function inside the EA but, I am not able to compile it, for unknown reasons. I put the code in attachement (in case you could correct it for compilation) regards jag
I don’t like Xmeter as a CS indicator. It’s just numeric, without any sign of current direction of each currency.
G.
December 17, 2015 at 5:05 pm #10478again
Please don’t post EA versions here. Read thread instructions.
That’s VlanFx job, and he’s the only one that is permitted to do so.
If you want to suggest or add additions – please post code snippet and/or suggested indicator and the way to call it.
VlanFx will add it, if found valuable to the EA and logic accepted by other contributors/members.
Same as above…
G.
December 17, 2015 at 6:34 pm #10479while my testing , The auto Lot calculation didn´t worked correct. The Lotsize was too big and it couldnt open trades in the strategy tester. I changed a value from 100 to 1000.. highlighted it .. now it works. maybe some help for people with the same issue.
// Auto Lot Calculation
double CalcLot(int StopLoss)
{
StopLoss = StopLoss / 10.0;
double pipValue = MarketInfo(Symbol(),MODE_TICKVALUE);
if (Digits==3 || Digits==5) pipValue *= 10;
double step = MarketInfo(Symbol(),MODE_LOTSTEP);
int norm = 0;
if (step==1) norm = 0;
if (step==0.1) norm = 1;
if (step==0.01) norm = 2;
double minLot = MarketInfo(Symbol(),MODE_MINLOT);
double maxLot = MarketInfo(Symbol(),MODE_MAXLOT);
double lots = 0;
if(StopLoss != 0)
lots = AccountBalance()*(Risk/1000.0)/(StopLoss*pipValue);
lots = NormalizeDouble(lots,norm);
"A dream you dream alone is only a dream. A dream you dream together is a reality." (John Lennon)
December 17, 2015 at 9:06 pm #10482@slicken, @johnbaag, @Bartleby, thanks for contributing. I will look into it and post bugfix version later on.
Meanwhile, has anybody thought about how to implement these ideas from GG53:
The logic when Trough changes to Peak is known, and no need to wait for bar close. As soon as this happens you open a Buy…
After 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.
As I understand it, peak and through areas are defined by relative positions of Highs and Lows. And as long as a candle is being formed, it’s High or Low can change. So only after the candle is Closed, can we know for sure that a through has changed into peak.
@GG53 which Close do you mean: highest Close of the area, or Close of the candle with Highest High ?Thanks
V.
December 17, 2015 at 9:21 pm #10483while my testing , The auto Lot calculation didn´t worked correct. The Lotsize was too big and it couldnt open trades in the strategy tester. I changed a value from 100 to 1000.. highlighted it .. now it works. maybe some help for people with the same issue. // Auto Lot Calculation double CalcLot(int StopLoss) { StopLoss = StopLoss / 10.0; double pipValue = MarketInfo(Symbol(),MODE_TICKVALUE); if (Digits==3 || Digits==5) pipValue *= 10; double step = MarketInfo(Symbol(),MODE_LOTSTEP); int norm = 0; if (step==1) norm = 0; if (step==0.1) norm = 1; if (step==0.01) norm = 2; double minLot = MarketInfo(Symbol(),MODE_MINLOT); double maxLot = MarketInfo(Symbol(),MODE_MAXLOT); double lots = 0; if(StopLoss != 0) lots = AccountBalance()*(Risk/1000.0)/(StopLoss*pipValue); lots = NormalizeDouble(lots,norm);
There is a post above related to this…
G.
December 17, 2015 at 9:29 pm #10486@slicken, @johnbaag, @Bartleby, thanks for contributing. I will look into it and post bugfix version later on. Meanwhile, has anybody thought about how to implement these ideas from GG53: [quote quote=10316]The logic when Trough changes to Peak is known, and no need to wait for bar close. As soon as this happens you open a Buy…
After 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.
As I understand it, peak and through areas are defined by relative positions of Highs and Lows. And as long as a candle is being formed, it’s High or Low can change. So only after the candle is Closed, can we know for sure that a through has changed into peak. @GG53 which Close do you mean: highest Close of the area, or Close of the candle with Highest High ? Thanks V. [/quote]
For now, Close of the candle with Highest High.
Remember that the Peak & Trough algo is not yet fully complete.
Also, I’m not absolutly sure that I like the MQH lib reference. I much prefer the iCustom call to the Peak&Trough indicator, because this way any change to it will immediatly affect the EA. Otherwise, changes and additions/modification to the indicator requires to sych each such change made also to the MQH file.
G.
December 17, 2015 at 9:56 pm #10487OK
I made a try by inserting the xMeter function inside the main EA. . this is the Penguin_v1_xmeter.mq4 !!! fork ea. This is only a try, due to the fact, the xMeter is not totally convincing people here
Well, the Xmeter can give some informations about the currency strength
I put this in aim of setting up a new condition for opening new trades
if maincurr > secondcurrency => means LONG
the opposite => means SHORT
Also, 3 or 4 years ago, I found and somtimes rewrote this kind of VSA indys.
may be it could help
GL
-
This reply was modified 10 years, 6 months ago by
john baag. Reason: Penguin_v1_xmeter.mq4 -
This reply was modified 10 years, 6 months ago by
john baag. Reason: Xmeter function -
This reply was modified 10 years, 6 months ago by
john baag.
Attachments:
You must be logged in to view attached files.December 18, 2015 at 10:29 am #10499Highest High = Previous Bar HighestHigh
Lowest High = Previous Bar LowestHigh
Highest Low = Previous Bar HighestLow
Lowest Low = Previous Bar LowestLowHi G,
Could you please advice the use of “Lowest High” and “Highest Low”.
Thanks!
December 18, 2015 at 11:39 am #10500@gg53: You wrote Please don’t post EA versions here. Read thread instructions.
I must admit that I failed to find ‘thread instructions’, all I remember at the moment is this post.
Last night I opened the Trading made REALLY Simple: Coder’s Chat to keep information together in one point and remove the clutter from your main thread, keeping it clean.
Could you add your instructions to the first post of your thread, so anybody who drops in ‘by accident’ and likes to contribute has a fair chance to meet your quality requirements?
I appreciate your attitude regarding the quality of this thread, and like to assist by collecting the clutter.
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 18, 2015 at 1:34 pm #10503If both indicator and EA are referring to the same MQH lib, there shouldn’t be any problem: recompile both, and you’re done.
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 18, 2015 at 4:27 pm #10505December 18, 2015 at 4:38 pm #10508Hi @VlanFx!
Thanks for this!
The mqh name does not match the include directive in the EA file. Misspelled in the code or wrong library posted?
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 18, 2015 at 5:20 pm #10515Hi @VlanFx! Thanks for this! The mqh name does not match the include directive in the EA file. Misspelled in the code or wrong library posted? s.
Thanks @simplex
I couldn’t reupload plain source files without the server changing the name all the time. I think it’s because there are files with the same name on the server already. So I zipped them. Hope it works.
V.
December 18, 2015 at 5:34 pm #10519 - AuthorPosts
- You must be logged in to reply to this topic.