Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Quad, EternallyCurious, 1 invisible), 726 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Using ":L" & ":S" causes 2 possible bug(s) or is it bad coding? [Re: AndrewAMD] #476057
01/23/19 20:55
01/23/19 20:55
Joined: Jan 2019
Posts: 73
berlin
L
laz Offline OP
Junior Member
laz  Offline OP
Junior Member
L

Joined: Jan 2019
Posts: 73
berlin
But then I get all the results twice sick...

I think I prefer to do it with "ALGO:L & ALGO:S" without the parameter chart first.

I just have to check again if at least the resulting fac and par values with

"TREND: L + TREND: S"

and

"TRENDL: L + TRENDS: S"

are identical.

Last edited by laz; 01/23/19 20:58.
Re: Using ":L" & ":S" causes 2 possible bug(s) or is it bad coding? [Re: laz] #476058
01/23/19 21:01
01/23/19 21:01
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Does parameter_test_1 take about as much time to process as parameter_test_2?

Re: Using ":L" & ":S" causes 2 possible bug(s) or is it bad coding? [Re: AndrewAMD] #476059
01/23/19 21:15
01/23/19 21:15
Joined: Jan 2019
Posts: 73
berlin
L
laz Offline OP
Junior Member
laz  Offline OP
Junior Member
L

Joined: Jan 2019
Posts: 73
berlin
parameter_test_1
Code:
while(asset(loop("EURUSD")))
while(algo(loop("TRND"))) {

changes in parameter_test_2 to:
Code:
while(asset(loop("EURUSD")))
while(algo(loop("TRND:L","TRND:S"))) {


Script parameter_test_2 now need twice as long as we train 2 different components...

But as I write this I wonder, why was parameter_test_3 so slow, I have to look at it again...
I do not really know, what the problem was.

Quote:
parameter_test_1 - runtime about 3 minutes from first _1.par to .fac file
parameter_test_2 - runtime about 7 minutes from first _1.par to .fac file
parameter_test_3 - i stopped it, it's getting slower and slower, why?
parameter_test_4 - runtime about 5 minutes from first _1.par to .fac file

Internal Timer from FIRSTINITRUN to EXITRUN

parameter_test_1
Quote:
EXITRUN @ bar 10035 time = 501.353 ms
EXITRUN @ bar 10035 time = 493.324 ms
EXITRUN @ bar 10035 time = 487.299 ms
EXITRUN @ bar 10035 time = 487.029 ms
parameter_test_2
Quote:
EXITRUN @ bar 10035 time = 493.028 ms
EXITRUN @ bar 10035 time = 495.644 ms
EXITRUN @ bar 10035 time = 503.310 ms
EXITRUN @ bar 10035 time = 493.658 ms
parameter_test_3
Quote:
EXITRUN @ bar 10035 time = 12252.315 ms
EXITRUN @ bar 10035 time = 10282.861 ms
EXITRUN @ bar 10035 time = 10487.490 ms
EXITRUN @ bar 10035 time = 9688.894 ms
parameter_test_4
Quote:
EXITRUN @ bar 10035 time = 350.156 ms
EXITRUN @ bar 10035 time = 351.938 ms
EXITRUN @ bar 10035 time = 346.190 ms
EXITRUN @ bar 10035 time = 345.802 ms

I don't know why test_4 is faster but it's good smile.

Last edited by laz; 01/23/19 21:48.
Re: Using ":L" & ":S" causes 2 possible bug(s) or is it bad coding? [Re: laz] #476060
01/23/19 21:27
01/23/19 21:27
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Does parameter_test_5 take longer than parameter_test_2?

Test #5 does this:
loop("TRNDL:L","TRNDS:S")

You know how strstr works.

My hypothesis is that Test #5 == Test #2 > Test #1 (time consumed)

Re: Using ":L" & ":S" causes 2 possible bug(s) or is it bad coding? [Re: AndrewAMD] #476061
01/23/19 21:31
01/23/19 21:31
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
I'm assuming that test #3 is time consuming because it might be I/O intensive.

EDIT: Disregard, I thought verbose was high.

Last edited by AndrewAMD; 01/23/19 22:07.
Re: Using ":L" & ":S" causes 2 possible bug(s) or is it bad coding? [Re: AndrewAMD] #476062
01/23/19 21:56
01/23/19 21:56
Joined: Jan 2019
Posts: 73
berlin
L
laz Offline OP
Junior Member
laz  Offline OP
Junior Member
L

Joined: Jan 2019
Posts: 73
berlin
Quote:
I'm assuming that test #3 is time consuming because it might be I/O intensive.

Can you please explain more, the runtimes look very suspicious.

Training for test_5 is running, i think it will take the same time as test_2 & test_4.

Quote:
parameter_test_1 - runtime about 3 minutes from first _1.par to .fac file
parameter_test_2 - runtime about 7 minutes from first _1.par to .fac file
parameter_test_3 - i stopped it, it's getting slower and slower, why?
parameter_test_4 - runtime about 5 minutes from first _1.par to .fac file
parameter_test_5 - runtime about 6 minutes from first _1.par to .fac file

parameter_test_5
Quote:
EXITRUN @ bar 22787 time = 386.639 ms
EXITRUN @ bar 22787 time = 386.281 ms
EXITRUN @ bar 22787 time = 390.088 ms
EXITRUN @ bar 22787 time = 396.646 ms

Attached Files
parameter_test_5.c (30 downloads)
Last edited by laz; 01/23/19 22:08.
Re: Using ":L" & ":S" causes 2 possible bug(s) or is it bad coding? [Re: laz] #476063
01/23/19 22:14
01/23/19 22:14
Joined: Jan 2019
Posts: 73
berlin
L
laz Offline OP
Junior Member
laz  Offline OP
Junior Member
L

Joined: Jan 2019
Posts: 73
berlin
The strange thing is, jcl does it in the same way as i did in #3, his script runs fine...?

babypips_jcl_LS.c
Quote:
if(strstr(Algo,":L") and valley(Trend)) enterLong(); else
if(strstr(Algo,":S") and peak(Trend)) enterShort();

parameter_test_3
Code:
if(strstr(Algo,":L") && valley(sig)) enterLong(); else
if(strstr(Algo,":S") && peak(sig))   enterShort();


EDIT:
I think I found a possible explanation (maybe)?
Quote:
Hedge
0 = no hedging; automatically close opposite positions with the same asset when a new position is opened (default for NFA accounts).
1 = hedging across algos; automatically close opposite positions with the same algo when a new position is opened (default for unspecified accounts).
2 = full hedging; long and short positions can be open at the same time.

From test_1 to test_3 I'm in Hedge = 1 (default for me).

But in test_3 I'm limiting enterLong() + enterShort() to :L or :S
Code:
if(strstr(Algo,":L") && valley(sig)) enterLong(); else
if(strstr(Algo,":S") && peak(sig))   enterShort();


Because of that:
Quote:
while(algo(loop("TRND:L","TRND:S")))

Does Zorro now handle TRND:L and TRND:S as "the same" or 2 different Algos?

If so, we never have a enterLong() & (exit short) for TRND:S and never a enterShort() & (exit long) for TRND:L.

Result = Open trades are no longer closed?

That would explain why test_4 works correctly, there I have Hedge = 2 and i correctly close the open orders in the respective algo.

There is only 1 open question, why does it work in the jcl babypips script, there is no Hedge set, so it is also Hedge = 1...?

Attached Files
babypips_jcl_LS.c (30 downloads)
Last edited by laz; 01/24/19 01:48.
Re: Using ":L" & ":S" causes 2 possible bug(s) or is it bad coding? [Re: laz] #476064
01/24/19 01:22
01/24/19 01:22
Joined: Jan 2019
Posts: 73
berlin
L
laz Offline OP
Junior Member
laz  Offline OP
Junior Member
L

Joined: Jan 2019
Posts: 73
berlin
Ok I had a guess, but what I'm telling you now was too significant, so I wanted to be sure.

Because if I'm right then many examples that were posted everywhere are wrong!

In the babypips_jcl_LS.c I set the barperiod to = 60 (more trades) and it also got extremely slow.

So I thought, if my suspicion is right, there must be more than 1-2 trades open at the same time.

Please download new versions of #2 and #3 and hit TRAIN :

parameter_test_2 works as intended, in the train.log I never found more than 2 open trades.

Take a look at the train.log of parameter_test_3, there are 20,30,40 open trades.

Whatever ends the trades (End of WFOCycle?), it is not your function!

That would mean all the examples:
https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=407922
https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=408151#Post408151
http://www.forexfabrik.de/topic/3273-zorro-trader
https://forums.babypips.com/t/automated-trading-course-part-2-strategy-design/46305/24

are wrong?

Can one check this please, it can be the solution to a lot of questions...

Attached Files
parameter_test_2.c (24 downloads)
parameter_test_3.c (25 downloads)
Last edited by laz; 01/24/19 02:00.
Re: Using ":L" & ":S" causes 2 possible bug(s) or is it bad coding? [Re: laz] #476078
01/25/19 19:21
01/25/19 19:21
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
The ":L" and ":S" suffixes to algo names are from an early Zorro version. I have no notice of discontinuation, so theoretically they should still work, but otherwise please use "TRNDL" and "TRNDS" at the moment. We'll look into that.

Re: Using ":L" & ":S" causes 2 possible bug(s) or is it bad coding? [Re: jcl] #476090
01/26/19 04:38
01/26/19 04:38
Joined: Jan 2019
Posts: 73
berlin
L
laz Offline OP
Junior Member
laz  Offline OP
Junior Member
L

Joined: Jan 2019
Posts: 73
berlin
OFFTOPIC
Hi jcl, nice to meet you wink ... Thanks for everything here, I do not know who is behind the project but you (guys) did a really good job. Zorro's framework is great & takes a lot off, I already had the r-bridge in my own dll (freepascal) and the WFO coded in R but i was still missing so much, zorro makes it all superfluous wink.
OFFTOPIC


Quote:
The ":L" and ":S" suffixes to algo names are from an early Zorro version.

Please don't remove it wink It would be nice if you can fix only 1 thing:

1. wrong parameter charts with :L & :S

Why ?

:L & :S make it possible to combine/use both adviseLong/adviseShort Calls for LONG and
both for SHORT as we have different components now wink. So we can use 2 perceptrons or neural nets for 1 direction.


But TRNDL & TRNDS are ok for the moment wink

Problem 2, the open trades can be solved by understanding that by using :L & :S
you now use 2 different algo's and that your script has to close open trades.

Because enterLong() and enterShort() are not doing it for you with :L & :S.

This should be correct?
Code:
if(strstr(Algo,":L")) {
	
   if(peak(sig))   exitLong(); else 
   if(valley(sig)) enterLong();

} else if(strstr(Algo,":S")) {

   if(valley(sig)) exitShort(); else		
   if(peak(sig))   enterShort();

}


Last edited by laz; 01/26/19 04:54.
Page 2 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1