Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, monk12, Quad), 829 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
is(INITRUN) not in TRAINMODE? #477253
06/06/19 21:22
06/06/19 21:22
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Hi,

I have this test code:
Code:
function run(){
  Verbose    = 7;
  StartDate  = 20190210; 
  EndDate    = 2019;
  LookBack   = 100;
  NumYears   = 1;
  BarPeriod  = 15;
  asset("EUR/USD");

  if (is(INITRUN)){

      if (is(TRAINMODE))
        printf("n--- Train MODE----");
      
      if (is(TESTMODE))
        printf("n--- Test MODE1----");
      printf("nAfter init------------------");
  }
}



with output:

test compiling...........
8497 Bars 2019-01-30..2019-06-06 generated
Train: test 2019

my question is, in the Train I cannot use INITRUN?

thanks Milan

edit: is(FIRSTRUN) is the same

Last edited by Grat; 06/06/19 21:28.
Re: is(INITRUN) not in TRAINMODE? [Re: Grat] #477254
06/06/19 22:10
06/06/19 22:10
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
The manual is your friend! laugh

Originally Posted By: Grat
my question is, in the Train I cannot use INITRUN?
INITRUN is used in Train. But printf() is disabled in Train mode. Use print() with flags instead. Read about it here:
https://zorro-project.com/manual/en/printf.htm

Quote:
edit: is(FIRSTRUN) is the same
No. Read about it here:
https://zorro-project.com/manual/en/is.htm

Re: is(INITRUN) not in TRAINMODE? [Re: AndrewAMD] #477259
06/07/19 12:23
06/07/19 12:23
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
so,

I trying this:
Code:
NumTrainCycles = 2;
	if(TrainCycle == 1) set(RULES);
	else if(TrainCycle == 2) set(PARAMETERS);
 	else if(TrainCycle == 0) set(RULES|PARAMETERS); ¨



after first cycle Train finish. I cannot found, where I have bug. Any Idea?

but every time run only 1 cycle.
Quote:

Bar 1849: 0 - bar 1850: 2

ai_dtree_opt compiling..................
4230 Bars 2019-03-27..2019-05-29 generated
Warning 047: USD/JPY first bar at 2019-03-27
Parse PredikceUSDJPY-5-white.csv.. 15380 records
Parse PredikceUSDJPY-15-white.csv.. 5254 records
Rules: ai_dtree_opt 2019
Assets HistoryAssetsGP.csv
Error 015: invalid advise signal[4] at bar 118
Train USDJPY_L => ai_dtree_opt_USDJPY_L.csv
Train USDJPY_S => ai_dtree_opt_USDJPY_S.csv


Attached Files Screenshot_87.png
Last edited by Grat; 06/07/19 13:07.
Re: is(INITRUN) not in TRAINMODE? [Re: Grat] #477266
06/08/19 11:39
06/08/19 11:39
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
So,

for the better illustration I use the WORKSHOP_7

Code:
// Machine learning ////////////////////////////
#include <profile.c>

function run()
{
	StartDate = 2010;
	EndDate = 2018;
	BarPeriod = 1440; // 1 day
	BarZone = WET; // Western European midnight
	Weekend = 1;	// don't merge Friday and Sunday bars
//	NumWFOCycles = 5;
	asset("EUR/USD");
	
	//set(RULES+TESTNOW);
	NumTrainCycles = 2;
	if(TrainCycle == 1) set(RULES);
	else if(TrainCycle == 2) set(PARAMETERS);
  	else if(TrainCycle == 0) set(RULES|PARAMETERS|FACTORS); 

	if(Train) Hedge = 2;	// for training, allow long + short	
	LifeTime = 3;  		// one week
	MaxLong = MaxShort = -1;

>>>	int nTr=optimize(50,10,100); <<< NO work?

	if(adviseLong(PATTERN+FAST+2+RETURNS,0,
		priceHigh(2),priceLow(2),priceClose(2),
		priceHigh(1),priceLow(1),priceClose(1),
		priceHigh(1),priceLow(1),priceClose(1),
		priceHigh(0),priceLow(0),priceClose(0)) > nTr)
		enterLong();
	
	if(adviseShort() > nTr)
		enterShort();

	PlotWidth = 600;
	PlotHeight1 = 300;
	//plotTradeProfile(40);
	//plotWFOCycle(Equity,0);
	//plotWFOProfit();
}



Train output:


Workshop7 compiling...............
Rules: Workshop7 2010..2018
Train EURUSD_L 37 patterns
Train EURUSD_S 52 patterns
Rules stored in Workshop7.c

Question is, why not had start the training cycle two


Last edited by Grat; 06/09/19 06:15.
Re: is(INITRUN) not in TRAINMODE? [Re: Grat] #477273
06/09/19 09:57
06/09/19 09:57
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
I change from printf to watch.
Quote:
Displays the given text and up to 8 following bool, int, var, float, or string variables in the message window, or prints them to the log or diag.txt file in all modes. Optionally stops execution and changes to single step mode. Allows to quickly debug into functions and watch variable behavior.



Code:
// Machine learning ////////////////////////////
#include <profile.c>

function run()
{
	StartDate = 2010;
	EndDate = 2018;
	BarPeriod = 1440; // 1 day
	BarZone = WET; // Western European midnight
	Weekend = 1;	// don't merge Friday and Sunday bars
	asset("EUR/USD");
	
	NumTrainCycles = 2;
	if(TrainCycle == 1) set(RULES);
	else if(TrainCycle == 2) set(PARAMETERS);
  	else if(TrainCycle == 0) set(RULES|PARAMETERS); 

	if(Train) Hedge = 2;	// for training, allow long + short	
	LifeTime = 3;  		// one week
	MaxLong = MaxShort = -1;
	int nTr=optimize(50,0,100);
        Stop = optimize(1,1,50);

	if(adviseLong(PATTERN+FAST+2+RETURNS,0,
		priceHigh(2),priceLow(2),priceClose(2),
		priceHigh(1),priceLow(1),priceClose(1),
		priceHigh(1),priceLow(1),priceClose(1),
		priceHigh(0),priceLow(0),priceClose(0)) > nTr)
		enterLong();
	
	if(adviseShort() > nTr)
		enterShort();

  if (is(EXITRUN)){
    if (TrainCycle == 2)
      watch("nExit Cycle 2------------------");
    if (TrainCycle == 1)
      watch("nExit Cycle 1------------------");
    if (TrainCycle == 0)
      watch("nExit Cycle 0------------------");
  }

  if (is(FIRSTRUN)){
    if (TrainCycle == 2)
      watch("n----- Cycle 2------------------");
    if (TrainCycle == 1)
      watch("n----- Cycle 1------------------");
    if (TrainCycle == 0)
      watch("n----- Cycle 0------------------");
  }

}



and output is:


test compiling................
Rules: test 2010..2018

----- Cycle 1------------------

Exit Cycle 1------------------
Train EURUSD_L 37 patterns
Rules stored in test.c

No cycle 2???

Re: is(INITRUN) not in TRAINMODE? [Re: Grat] #477275
06/10/19 10:15
06/10/19 10:15
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Maybe you should contact the support, I see nothing wrong in your code.

Re: is(INITRUN) not in TRAINMODE? [Re: Spirit] #477286
06/12/19 20:50
06/12/19 20:50
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Is a problem with version 2.12. With 1.96 working without problem.

Re: is(INITRUN) not in TRAINMODE? [Re: Grat] #477288
06/13/19 08:14
06/13/19 08:14
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Try the latest beta version. I see no issue with multiple training cycles on the bug list, but if it was related to 2.12, it should work with the beta. The training system was modified in that version.

Re: is(INITRUN) not in TRAINMODE? [Re: jcl] #477295
06/13/19 19:27
06/13/19 19:27
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline OP
Senior Member
Grat  Offline OP
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
With the beta also work. Only with 2.12 is a problem

Re: is(INITRUN) not in TRAINMODE? [Re: Grat] #477296
06/13/19 21:00
06/13/19 21:00
Joined: Jan 2019
Posts: 73
berlin
L
laz Offline
Junior Member
laz  Offline
Junior Member
L

Joined: Jan 2019
Posts: 73
berlin
Hi guys, i faced the same problem, TrainCycle is never 2 with 2.12.

Where can i find the beta?

Page 1 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1