Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (M_D, AndrewAMD, Quad, Ayumi), 806 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
How to set global Asset,Bar Zone or AssetFrame? #480507
06/11/20 23:38
06/11/20 23:38
Joined: Oct 2019
Posts: 27
Germany
TedMar Offline OP
Newbie
TedMar  Offline OP
Newbie

Joined: Oct 2019
Posts: 27
Germany
Hi, i looking for resolve a simple resolution to set Zone,Bars and Market in EST (New York)
i.e.
load History t.6 from SPY with UTC Time Stamps
Local Maschine is CEST (UTC +2)

Code
function run() 
{
	
	StartDate = 20200301;
        EndDate = 20200314;
	
        AssetZone = EST;
	AssetMarket = EST;
	BarZone = EST;
	
	StartMarket = 0930;
	EndMarket = 1600;
	
	BarMode = BR_MARKET;


	set(LOGFILE+PLOTNOW);
	setf(PlotMode, PL_FINE);
	
	// HistoryZone = UTC;
	
        BarPeriod = 5;
	
	asset("SPY");

	vars Prices = series(priceClose());


}


code NOT WORKS for me...

i would like see every Day start Market at 9:30 before and after Daylight Saving switch too (9 March)

How i can set SPY in EST zone?




v2.27.7b





Last edited by TedMar; 06/11/20 23:40.
Re: How to set global Asset,Bar Zone or AssetFrame? [Re: TedMar] #480517
06/12/20 09:43
06/12/20 09:43
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Variables beginning with "Asset..." are for the selected asset, so they make not much sense in your code before selecting an asset. But BarZone is ok.

https://manual.zorro-project.com/assetzone.htm


Re: How to set global Asset,Bar Zone or AssetFrame? [Re: Spirit] #480520
06/12/20 12:21
06/12/20 12:21
Joined: Oct 2019
Posts: 27
Germany
TedMar Offline OP
Newbie
TedMar  Offline OP
Newbie

Joined: Oct 2019
Posts: 27
Germany
Originally Posted by Spirit
Variables beginning with "Asset..." are for the selected asset, so they make not much sense in your code before selecting an asset. But BarZone is ok.

https://manual.zorro-project.com/assetzone.htm


im not clear about it, if i set AssetZone in Asset block , can't see any changes.
is possible u write down an example?
THX

Re: How to set global Asset,Bar Zone or AssetFrame? [Re: TedMar] #480521
06/12/20 12:37
06/12/20 12:37
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
try this...
Code
function run() 
{
	
	StartDate = 20200301;
        EndDate = 20200314;
	
	BarZone = EST;
        BarPeriod = 5;
	BarMode = BR_MARKET;
	
	StartMarket = 0930;
	EndMarket = 1600;
	set(LOGFILE+PLOTNOW);
	setf(PlotMode, PL_FINE);
	
	// HistoryZone = UTC;
	
	
	asset("SPY");
        AssetZone = EST;
	AssetMarket = EST;

	vars Prices = series(priceClose());
}

Last edited by Grat; 06/12/20 12:37.
Re: How to set global Asset,Bar Zone or AssetFrame? [Re: TedMar] #480522
06/12/20 12:38
06/12/20 12:38
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
AssetZone

Time zone of the current asset, used for setting AssetFrame to a daily TimeFrame that begins at FrameOffset in local time. When your strategy contains a portfolio of different assets that you want to trade daily at different times, use this parameter to define the time frames of individual assets.

Re: How to set global Asset,Bar Zone or AssetFrame? [Re: Grat] #480524
06/12/20 15:08
06/12/20 15:08
Joined: Oct 2019
Posts: 27
Germany
TedMar Offline OP
Newbie
TedMar  Offline OP
Newbie

Joined: Oct 2019
Posts: 27
Germany
Originally Posted by Grat
AssetZone

Time zone of the current asset, used for setting AssetFrame to a daily TimeFrame that begins at FrameOffset in local time. When your strategy contains a portfolio of different assets that you want to trade daily at different times, use this parameter to define the time frames of individual assets.

Grat u code not works , i changed time frame to 30 for better log.
Code

[169: Thu 20-03-05 20:00] (302.34)
[170: Thu 20-03-05 20:30] (300.65)
[171: Fri 20-03-06 14:30] (293.18)  // pre Daylight Saving    (14:30)
[172: Fri 20-03-06 15:00] (293.34)
[173: Fri 20-03-06 15:30] (296.42)
[174: Fri 20-03-06 16:00] (297.09)
[175: Fri 20-03-06 16:30] (295.14)
[176: Fri 20-03-06 17:00] (294.94)
[177: Fri 20-03-06 17:30] (293.21)
[178: Fri 20-03-06 18:00] (294.56)
[179: Fri 20-03-06 18:30] (295.59)
[180: Fri 20-03-06 19:00] (293.66)
[181: Fri 20-03-06 19:30] (293.46)
[182: Fri 20-03-06 20:00] (291.01)
[183: Fri 20-03-06 20:30] (292.19)
[184: Sat 20-03-07 14:30] (282.81)  //  Sat?
[185: Mon 20-03-09 13:30] (275.30) // after Daylight Saving (13:30)
[186: Mon 20-03-09 14:00] (279.87)
[187: Mon 20-03-09 14:30] (280.75)
[188: Mon 20-03-09 15:00] (278.62)
[189: Mon 20-03-09 15:30] (281.06)
[190: Mon 20-03-09 16:00] (282.70)
[191: Mon 20-03-09 16:30] (281.02)
[192: Mon 20-03-09 17:00] (279.72)
[193: Mon 20-03-09 17:30] (278.61)
[194: Mon 20-03-09 18:00] (275.83)
[195: Mon 20-03-09 18:30] (274.95)
[196: Mon 20-03-09 19:00] (276.62)
[197: Mon 20-03-09 19:30] (277.91)
[198: Tue 20-03-10 13:30] (284.64)   // after Daylight Saving 
[199: Tue 20-03-10 14:00] (282.64)


How i get 9:30 start Session?

Last edited by TedMar; 06/12/20 15:11.
Re: How to set global Asset,Bar Zone or AssetFrame? [Re: TedMar] #480532
06/13/20 08:43
06/13/20 08:43
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
All this is wrong, here is it fixed:

Code
function run() 
{
	StartDate = 20200301;
        EndDate = 20200314;
	
	BarZone = EST;
        BarPeriod = 5;
	setf(BarMode,BR_MARKET);
	
	StartMarket = 0930;
	EndMarket = 1600;
	set(LOGFILE+PLOTNOW);
	
	asset("SPY");
	vars Prices = series(priceClose());
}

Re: How to set global Asset,Bar Zone or AssetFrame? [Re: Spirit] #480534
06/13/20 14:38
06/13/20 14:38
Joined: Oct 2019
Posts: 27
Germany
TedMar Offline OP
Newbie
TedMar  Offline OP
Newbie

Joined: Oct 2019
Posts: 27
Germany
Originally Posted by Spirit
All this is wrong, here is it fixed:


?? Result is same , No session start @ 9:30 , and shift @ Daylight Saving

Code
function run() 
{
	StartDate = 20200305;
        EndDate = 20200311;
	
	BarZone = EST;
        BarPeriod = 30;
	setf(BarMode,BR_MARKET);
	
	StartMarket = 0930;
	EndMarket = 1600;
	set(LOGFILE+PLOTNOW);
	
	asset("SPY");
	vars Prices = series(priceClose());
}



Log
Code
End of lookback period

[143: Thu 20-03-05 14:30] (304.99)
[144: Thu 20-03-05 15:00] (304.59)
[145: Thu 20-03-05 15:30] (305.55)
[146: Thu 20-03-05 16:00] (306.03)
[147: Thu 20-03-05 16:30] (307.94)
[148: Thu 20-03-05 17:00] (305.75)
[149: Thu 20-03-05 17:30] (304.47)
[150: Thu 20-03-05 18:00] (302.49)
[151: Thu 20-03-05 18:30] (303.08)
[152: Thu 20-03-05 19:00] (303.50)
[153: Thu 20-03-05 19:30] (301.43)
[154: Thu 20-03-05 20:00] (302.34)
[155: Thu 20-03-05 20:30] (300.65)
[156: Fri 20-03-06 14:30] (293.18)       //14:30 Winter (Daylight Saving)
[157: Fri 20-03-06 15:00] (293.34)
[158: Fri 20-03-06 15:30] (296.42)
[159: Fri 20-03-06 16:00] (297.09)
[160: Fri 20-03-06 16:30] (295.14)
[161: Fri 20-03-06 17:00] (294.94)
[162: Fri 20-03-06 17:30] (293.21)
[163: Fri 20-03-06 18:00] (294.56)
[164: Fri 20-03-06 18:30] (295.59)
[165: Fri 20-03-06 19:00] (293.66)
[166: Fri 20-03-06 19:30] (293.46)
[167: Fri 20-03-06 20:00] (291.01)
[168: Fri 20-03-06 20:30] (292.19)
[169: Mon 20-03-09 13:30] (275.30)  //13:30 Summer (Daylight Saving)
[170: Mon 20-03-09 14:00] (279.87)
[171: Mon 20-03-09 14:30] (280.75)
[172: Mon 20-03-09 15:00] (278.62)
[173: Mon 20-03-09 15:30] (281.06)
[174: Mon 20-03-09 16:00] (282.70)
[175: Mon 20-03-09 16:30] (281.02)
[176: Mon 20-03-09 17:00] (279.72)
[177: Mon 20-03-09 17:30] (278.61)
[178: Mon 20-03-09 18:00] (275.83)
[179: Mon 20-03-09 18:30] (274.95)
[180: Mon 20-03-09 19:00] (276.62)
[181: Mon 20-03-09 19:30] (277.91)
[182: Tue 20-03-10 13:30] (284.64)
[183: Tue 20-03-10 14:00] (282.64)
[184: Tue 20-03-10 14:30] (282.36)
[185: Tue 20-03-10 15:00] (278.61)
[186: Tue 20-03-10 15:30] (274.91)
[187: Tue 20-03-10 16:00] (275.47)
[188: Tue 20-03-10 16:30] (277.59)
[189: Tue 20-03-10 17:00] (278.37)


Any idea more to resolve them?

Attached Files 2020-06-13 16_32_26-Window.png
Re: How to set global Asset,Bar Zone or AssetFrame? [Re: TedMar] #480537
06/13/20 17:39
06/13/20 17:39
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Ok,

question, you are downloaded data from?

Re: How to set global Asset,Bar Zone or AssetFrame? [Re: Grat] #480538
06/13/20 19:20
06/13/20 19:20
Joined: Oct 2019
Posts: 27
Germany
TedMar Offline OP
Newbie
TedMar  Offline OP
Newbie

Joined: Oct 2019
Posts: 27
Germany
Originally Posted by Grat
Ok,

question, you are downloaded data from?


https://zorro-project.com/download.php

Historical Data Archives

SPY M1 & EOD Options 2011+ - Price & option chain history (t6/t8 formats, 150 MB, free)

Re: How to set global Asset,Bar Zone or AssetFrame? [Re: TedMar] #480540
06/14/20 04:32
06/14/20 04:32
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
Try source data with ZhistoryEditor

Re: How to set global Asset,Bar Zone or AssetFrame? [Re: Grat] #480541
06/14/20 07:45
06/14/20 07:45
Joined: Oct 2019
Posts: 27
Germany
TedMar Offline OP
Newbie
TedMar  Offline OP
Newbie

Joined: Oct 2019
Posts: 27
Germany
Originally Posted by Grat
Try source data with ZhistoryEditor

sorry i not understand, what is your idea. Hunderts of assets to Edit?

in fact the quest is very simple. I'm surprised it's so hard to set such simple adjustments.

Re: How to set global Asset,Bar Zone or AssetFrame? [Re: TedMar] #480542
06/14/20 08:06
06/14/20 08:06
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Maybe its unclear what you want to adjust. Bar zone and market time are already set, so what is still the problem?

If there is a bar or not at a certain hour has nothing to do with your code, but with the historical data.

Re: How to set global Asset,Bar Zone or AssetFrame? [Re: TedMar] #480543
06/14/20 08:16
06/14/20 08:16
Joined: Oct 2019
Posts: 27
Germany
TedMar Offline OP
Newbie
TedMar  Offline OP
Newbie

Joined: Oct 2019
Posts: 27
Germany
@Spirt , u have idea why i don't get bar Result Session start 9:30? U have result 9:30 with this code and SPY datafeed from Zorro Download page?

Re: How to set global Asset,Bar Zone or AssetFrame? [Re: TedMar] #480544
06/14/20 08:21
06/14/20 08:21
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Do you mean 9:30 in the log? The log is UTC.

Re: How to set global Asset,Bar Zone or AssetFrame? [Re: Spirit] #480545
06/14/20 08:59
06/14/20 08:59
Joined: Oct 2019
Posts: 27
Germany
TedMar Offline OP
Newbie
TedMar  Offline OP
Newbie

Joined: Oct 2019
Posts: 27
Germany
Originally Posted by Spirit
Do you mean 9:30 in the log? The log is UTC.

Result log, yes

I confused now laugh , if i leave BarZone from code , result is TimeStamp is ok, but DATA is UTC + 1 ,+2 (wrong)

Code

function run() 
{
	StartDate = 20200305;
        EndDate = 20200311;
	
	// BarZone = EST;       
        BarPeriod = 30;
	setf(BarMode,BR_MARKET);
	
	StartMarket = 0930;
	EndMarket = 1600;
	set(LOGFILE+PLOTNOW);
	
	asset("SPY");
	vars Prices = series(priceClose());
}






Code
154: Thu 20-03-05 15:00] (304.59)
[155: Thu 20-03-05 15:30] (305.55)
[156: Fri 20-03-06 09:30] (298.14) // ok
[157: Fri 20-03-06 10:00] (295.84)
[158: Fri 20-03-06 10:30] (294.21)
[159: Fri 20-03-06 11:00] (294.40)
[160: Fri 20-03-06 11:30] (293.79)
[161: Fri 20-03-06 12:00] (294.51)
[162: Fri 20-03-06 12:30] (293.79)
[163: Fri 20-03-06 13:00] (293.32)
[164: Fri 20-03-06 13:30] (293.35)
[165: Fri 20-03-06 14:00] (293.34)
[166: Fri 20-03-06 14:30] (293.18)
[167: Fri 20-03-06 15:00] (293.34)
[168: Fri 20-03-06 15:30] (296.42)
[169: Mon 20-03-09 09:30] (281.97)  // ok
[170: Mon 20-03-09 10:00] (279.99)
[171: Mon 20-03-09 10:30] (280.70)
[172: Mon 20-03-09 11:00] (279.75)
[173: Mon 20-03-09 11:30] (278.30)
[174: Mon 20-03-09 12:00] (278.49)
[175: Mon 20-03-09 12:30] (276.18)
[176: Mon 20-03-09 13:00] (277.38)
[177: Mon 20-03-09 13:30] (275.30)
[178: Mon 20-03-09 14:00] (279.87)
[179: Mon 20-03-09 14:30] (280.75)
[180: Mon 20-03-09 15:00] (278.62)
[181: Mon 20-03-09 15:30] (281.06)
[182: Tue 20-03-10 09:30] (286.40) 
[183: Tue 20-03-10 10:00] (288.05)
[184: Tue 20-03-10 10:30] (287.35)
[185: Tue 20-03-10 11:00] (288.01)
[186: Tue 20-03-10 11:30] (286.20)
[187: Tue 20-03-10 12:00] (286.00)
[188: Tue 20-03-10 12:30] (283.78)
[189: Tue 20-03-10 13:00] (284.38)
[190: Tue 20-03-10 13:30] (284.64)
[191: Tue 20-03-10 14:00] (282.64)
[192: Tue 20-03-10 14:30] (282.36)
[193: Tue 20-03-10 15:00] (278.61)



i try now with other Instrument and history

Last edited by TedMar; 06/14/20 17:03.
Re: How to set global Asset,Bar Zone or AssetFrame? [Re: TedMar] #480546
06/14/20 09:41
06/14/20 09:41
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
The log is in UTC, while StartMarket/EndMarket are in EST (BarZone=ET). So, all is *mostly* correct in the log.

Except Zorro treats end times as "exclusive of" the specified time, i.e. EndMarket=1600 will NOT include the bar ending at 16:00; you have to set EndMarket=1601 to include the last 30-min bar into the day. (this logic is technically correct for ticks, but not for bars- which are timestamped by Zorro itself by the end time "inclusive of ").

Also, StartMarket=9:30 does NOT mean that your trading day will start from 9:30 (as you would expect). Rather, this is a timestamp(=END) of the first bar in a trading day.
And where it starts depends on the BarMode, EndMarket and available price history in the file (with the current script you get an "overnight" bar spanning 15:30-9:30).

Set Verbose=3 to see bar open and close prices and construct the "price candles" the way you need .

Re: How to set global Asset,Bar Zone or AssetFrame? [Re: TedMar] #480551
06/14/20 16:15
06/14/20 16:15
Joined: Oct 2019
Posts: 27
Germany
TedMar Offline OP
Newbie
TedMar  Offline OP
Newbie

Joined: Oct 2019
Posts: 27
Germany
The Session Start  @9:30 is in Zorro default , then TimeStamp in log is correct , but data is from local Machine (CET +1 /CEST +2) @9:30  
if set BarZone to EST , this changed session start in UTC.
Im totally confused. 
Please.... I would like set EST Zone Time+Data (New York) MARKET i environment with correct Data  from UTC History only. 

 How?

Last edited by TedMar; 06/15/20 19:28.
Page 1 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1