Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, ChrstphFr), 875 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
plot and calculate signal only during regulate trading hours #487682
07/23/23 03:31
07/23/23 03:31
Joined: Jul 2023
Posts: 6
MURRIETA
R
rvl Offline OP
Newbie
rvl  Offline OP
Newbie
R

Joined: Jul 2023
Posts: 6
MURRIETA
hello all,

After 2-weeks researching different Algo platforms to settle on, and like Zorro capacities and bought the S license. smile

Anyway, I'm still having a little hard time understanding BarZone and BarMode concepts even afer reading some posts on here. Basically, I have TICK t1 data from Sierra Chart in EST timezone, I want to plot and calculate ADX/ATR/etc only for the bars in regular trading hours only, discarding after-hours bars, but the plot still shows after-hours bars. My snippet is below, appreciate any help.

set(TICKS);
History = "History\\_2023.t1";
set(LOGFILE);
//series()
asset("QQQ");
//ADXs = series(ADX(20),20);
BarZone = UTC;

AssetMarketZone = EST;
AssetMarketStart = 0930;
AssetMarketEnd = 1600;
BarMode = BR_WEEKEND | BR_LOCAL | BR_MARKET;
//TickTime = 1;
LookBack = 80;
BarPeriod = 5;
StartDate = 20230710;
EndDate = 20230721;

StartMarket = 1330;
EndMarket = 2000;

Re: plot and calculate signal only during regulate trading hours [Re: rvl] #487684
07/24/23 02:42
07/24/23 02:42
Joined: Jul 2023
Posts: 6
MURRIETA
R
rvl Offline OP
Newbie
rvl  Offline OP
Newbie
R

Joined: Jul 2023
Posts: 6
MURRIETA
the graph in UTC time attached shows after-market data that I'm trying to discard, struggling with the Zorro's fundamental, HELP! thx

Attached Files aftermarketData.png
Re: plot and calculate signal only during regulate trading hours [Re: rvl] #487696
07/31/23 14:33
07/31/23 14:33
Joined: Nov 2022
Posts: 13
Tampa Bay
B
bigsmack Offline
Newbie
bigsmack  Offline
Newbie
B

Joined: Nov 2022
Posts: 13
Tampa Bay
There is a tiny example buried in the docs for the suspended function that may help. Please update this post if this works for you or not.

// don't shift series outside market hours
if(suspended()&8) set(NOSHIFT); else set(NOSHIFT|OFF);

Re: plot and calculate signal only during regulate trading hours [Re: bigsmack] #487703
08/04/23 06:27
08/04/23 06:27
Joined: Jul 2023
Posts: 6
MURRIETA
R
rvl Offline OP
Newbie
rvl  Offline OP
Newbie
R

Joined: Jul 2023
Posts: 6
MURRIETA
Thanks for the reply. I was able to get help from support. The issue is the order of the codes.The bars mode should be above the bars being generated.

I was able to get the chart aligned on UTC time but now next issue, the plot shows a giant bar between previous day's close and today's open as shown in the attached. I suspect because of these giant bars between daily close and open, I could not get a simple ATR calculation to match with Sierra Chart( where the data is from) or Tradingview. Any Idea? Thx

Attached Files Capture.PNG
Re: plot and calculate signal only during regulate trading hours [Re: rvl] #487720
08/10/23 05:00
08/10/23 05:00
Joined: Jul 2023
Posts: 6
MURRIETA
R
rvl Offline OP
Newbie
rvl  Offline OP
Newbie
R

Joined: Jul 2023
Posts: 6
MURRIETA
Just an update to this thread to share experience in case another new user of Zorro like me running into similar issue.

So I had to develop another script to remove the pre-market and after-market ticks from the data file to produce the plot, OHLC, ATR values "closely" matched to what Sierra Chart (where the data is from) show.

Another minor issue, looks like the run() function is executed about 500ms off of the market open time set in StartMarket, therefore it misses a few ticks, hence OHL values are slightly off.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1