Gamestudio Links
Zorro Links
Newest Posts
Converting History Data
by Erneto. 05/25/20 23:54
MT4/5 Bridge - Zero MQ
by Grat. 05/25/20 18:57
bug in parseData?
by Grat. 05/25/20 18:49
Train not save
by Grat. 05/25/20 18:36
CCT PhysX 2.0
by CodeMaster. 05/25/20 17:20
Trend Method on Financial Hackers
by jcl. 05/25/20 12:02
Negative prices?
by danatrader. 05/25/20 06:34
Is Zorro still viable?
by Grat. 05/25/20 05:12
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
2 registered members (AndrewAMD, Erneto), 523 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mike333, trader310, Onn, Dahn, happysun
18453 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Training not reproducible!? #478370
10/09/19 16:43
10/09/19 16:43
Joined: Jul 2019
Posts: 39
Köln
S
StefanCGN Offline OP
Newbie
StefanCGN  Offline OP
Newbie
S

Joined: Jul 2019
Posts: 39
Köln
Hi all,

i am investigating my version of Ehlers algo from his "Rocketscience"-Book. When i start the optimization, is comes to a certain solution, but when i start a second opt-run it comes to a totally different solution and so on..... it seems totally random without changing anything. What the hack is wromg here?

function trade_Ehlers()
{
TimeFrame = 2;

vars Price = series(price());
vars Smoothed = series(LowPass(Price,optimize(100,50,200,25)));
vars Trendline = series(HTTrendline(Price));
vars Trendmode = series(HTTrendMode(Price));
var Phase = DominantPhase(Price,10);
vars LeadSine = series(sin(Phase+PI/4));
vars Sine = series(sin(Phase));
MaxLong = MaxShort = 1;

if(abs(Smoothed[0] - Trendline[0]) > (optimize(0.5,0.25,1.5,0.25) * ATR(30))) {
Trendmode[0] = 1;}

Stop = optimize(30,3,21,3) * ATR(30);

if(Trendmode == 1) {
if(crossOver(Smoothed, Trendline)){
enterLong();}
else if(crossUnder(Smoothed, Trendline)){
enterShort();}}
else if(Trendmode[0] == 1 && Trendmode[1] == 0) {
if(Smoothed > Trendline){
enterLong();}
else if(Smoothed < Trendline){
enterShort();}}
else if(Trendmode == 0){
if(crossOver(LeadSine, Sine)){
enterLong();}
else if(crossUnder(LeadSine, Sine)){
enterShort();}}
}

Re: Training not reproducible!? [Re: StefanCGN] #478371
10/09/19 17:09
10/09/19 17:09
Joined: Feb 2017
Posts: 972
Chicago
AndrewAMD Online
User
AndrewAMD  Online
User

Joined: Feb 2017
Posts: 972
Chicago
These lines are bad:

Code
if(Smoothed > Trendline){

else if(Smoothed < Trendline){


I think you mean this:

Code
if(Smoothed[0] > Trendline[0]){

else if(Smoothed[0] < Trendline[0]){

Re: Training not reproducible!? [Re: StefanCGN] #478373
10/09/19 17:25
10/09/19 17:25
Joined: Jul 2019
Posts: 39
Köln
S
StefanCGN Offline OP
Newbie
StefanCGN  Offline OP
Newbie
S

Joined: Jul 2019
Posts: 39
Köln
That's what i mean.... thanks! It helped :-)

Last edited by StefanCGN; 10/09/19 17:40.

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1