Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by 3run. 09/19/19 09:42
Any chance of PBR materials with A8?
by Quad. 09/18/19 18:00
Sierra Chart Plugin
by AndrewAMD. 09/18/19 14:03
3d model editor
by karmacomposer. 09/18/19 13:18
Can MED export to FBX?
by karmacomposer. 09/18/19 13:07
I cannot get the A8 game engine to show anything
by karmacomposer. 09/18/19 12:38
Script, Start Trading Immediately
by jcl. 09/18/19 08:38
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
12 registered members (Ayumi, 3run, AndrewAMD, Quad, saulius, 20BN, kvm, MatPed, 3 invisible), 613 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Dark_Light, oxygenjoe, web20tpo, tarekhazem, Juanjo
18290 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: 163
Czech Republic
Grat Offline OP
Member
Grat  Offline OP
Member

Joined: May 2015
Posts: 163
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: 754
Chicago
AndrewAMD Online
User
AndrewAMD  Online
User

Joined: Feb 2017
Posts: 754
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: 163
Czech Republic
Grat Offline OP
Member
Grat  Offline OP
Member

Joined: May 2015
Posts: 163
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 (90 downloads)
show
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: 163
Czech Republic
Grat Offline OP
Member
Grat  Offline OP
Member

Joined: May 2015
Posts: 163
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: 163
Czech Republic
Grat Offline OP
Member
Grat  Offline OP
Member

Joined: May 2015
Posts: 163
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: 854
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 854
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: 163
Czech Republic
Grat Offline OP
Member
Grat  Offline OP
Member

Joined: May 2015
Posts: 163
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,006
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,006
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: 163
Czech Republic
Grat Offline OP
Member
Grat  Offline OP
Member

Joined: May 2015
Posts: 163
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: 71
berlin
L
laz Offline
Junior Member
laz  Offline
Junior Member
L

Joined: Jan 2019
Posts: 71
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

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