Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Ayumi, AndrewAMD, howardR), 1,095 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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 | 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