Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 18,175 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Unexpected behavior of AssetFrame #458236
02/28/16 19:24
02/28/16 19:24
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
I set up daily bars aligned to different time zones dependent on the asset. Following the advice in the manual, the code below sets up the daily bars as expected - you can see in the plot the change of day occurring when the filter changes its value. So far so good.

What's unexpected is that setting ExitTime=2 causes trades to exit after 1 hourly bar, not after 1 daily bar.

Is this indeed unexpected behavior or am I missing something? What other functions react to the BarPeriod as opposed to the AssetFrame?
Code:
function run() 
{
   set(LOGFILE);

	BarPeriod = 60;
	LookBack = 200;
  	StartDate = 20151001; 
  	EndDate = 20151201;
  		
`	while(asset(loop("EUR/USD", "EUR/CAD", "AUD/USD")))   { 
		if(Asset == "EUR/USD" or Asset == "EUR/CAD") {
			FrameOffset = 9;
			AssetZone = ET;
		
		}
		else if(Asset == "AUD/USD") {
			FrameOffset = 17;
			AssetZone = JST;
		}
		
		TimeFrame = AssetFrame; 
		
		vars Price = series(price());
		vars filt = series(LowPass(Price, 50));
		
		ExitTime = 2;
		if (valley(filt)) enterLong();
		if (peak(filt)) enterShort();
		
		plot("filt", filt, MAIN, BLUE);
	}
}




Last edited by boatman; 02/28/16 19:54.
Re: Unexpected behavior of AssetFrame [Re: boatman] #458241
02/29/16 06:42
02/29/16 06:42
Joined: Jul 2000
Posts: 28,022
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,022
Frankfurt
ExitTime is independent of the TimeFrame, it's always in bar period units.

If you want to exit in sync with the time frame, check the sign of AssetFrame.

Re: Unexpected behavior of AssetFrame [Re: jcl] #458256
03/01/16 06:13
03/01/16 06:13
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
Gotcha. Would I be correct in assuming that all of the system variables that take a time period as input are dependent on BarPeriod, not TimeFrame? And that the price-based variables are dependent on time frame?

For example, EntryDelay for the former case and price() for the latter?

Re: Unexpected behavior of AssetFrame [Re: boatman] #458261
03/01/16 11:00
03/01/16 11:00
Joined: Jul 2000
Posts: 28,022
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,022
Frankfurt
Yes. If not mentioned otherwise, time variables are in bar period units.

Re: Unexpected behavior of AssetFrame [Re: jcl] #458271
03/01/16 21:37
03/01/16 21:37
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
Thanks for clearing that up!


Moderated by  Petra 

Gamestudio download | 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