Gamestudio Links
Zorro Links
Newest Posts
Chat Room for Zorro Programmers
by danatrader. 07/02/20 18:35
Locating unfreed memory
by Dooley. 07/02/20 14:39
A9
by Aku_Aku. 07/02/20 12:43
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 07/02/20 11:11
Help with code
by danatrader. 07/02/20 04:22
Grid Trading - dynamic
by danatrader. 07/01/20 17:15
Fuzzy Range
by AndrewAMD. 07/01/20 16:57
new macro: break_assets
by AndrewAMD. 07/01/20 01:01
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
9 registered members (Zheka, Ayumi, 3run, 20BN, kvm, ozgur, Quad, jenGs, Grat), 423 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
carolthesecond, Roger399, vrindger, XRaf, pchen90
18472 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: 41
Köln
S
StefanCGN Offline OP
Newbie
StefanCGN  Offline OP
Newbie
S

Joined: Jul 2019
Posts: 41
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: 1,012
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,012
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: 41
Köln
S
StefanCGN Offline OP
Newbie
StefanCGN  Offline OP
Newbie
S

Joined: Jul 2019
Posts: 41
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