Gamestudio Links
Zorro Links
Newest Posts
Zorro tutorial ideas?
by AndrewAMD. 09/21/26 14:50
Trades during a running bar
by Martin_HH. 09/21/26 12:03
Capital slider is not saving in Z12
by frutza. 09/17/26 13:36
Avoiding pop-up training parameter results
by Martin_HH. 09/16/26 21:31
What are you working on?
by rayp. 09/16/26 20:20
Future of ZorroHFT
by TipmyPip. 09/16/26 09:28
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (AndrewAMD, lopezsergio07, Martin_HH, 3run), 1,952 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
lopezsergio07, mistery, lokkalyansamiti, rahulbuilds, speedx
19237 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Zorro tutorial ideas? #489462
06/11/26 17:57
06/11/26 17:57
Joined: Feb 2017
Posts: 1,832
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,832
Chicago
I might be posting some Zorro tutorials on my blog or YouTube channel in the near future.

Are there any requests?

Re: Zorro tutorial ideas? [Re: AndrewAMD] #489463
06/11/26 19:41
06/11/26 19:41
Joined: Sep 2017
Posts: 337
TipmyPip Offline
Senior Member
TipmyPip  Offline
Senior Member

Joined: Sep 2017
Posts: 337
Congratulations, I would love to watch them, and would love to see some new ideas too.

Thank you Andrew.

Re: Zorro tutorial ideas? [Re: AndrewAMD] #489465
06/12/26 13:36
06/12/26 13:36
Joined: May 2022
Posts: 16
P
pr0logic Offline
Newbie
pr0logic  Offline
Newbie
P

Joined: May 2022
Posts: 16
That sounds great.
Some ideas
- futures trading in its particularities
- options strategies
- data scraping (for constructing indicators, e.g. COT)
- Input/output section in the manual

Last edited by pr0logic; 06/13/26 08:07.
Re: Zorro tutorial ideas? [Re: pr0logic] #489469
06/13/26 15:01
06/13/26 15:01
Joined: Feb 2017
Posts: 1,832
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,832
Chicago
Originally Posted by pr0logic
That sounds great.
Some ideas
- futures trading in its particularities
- options strategies
- data scraping (for constructing indicators, e.g. COT)
- Input/output section in the manual
thanks smile

Re: Zorro tutorial ideas? [Re: AndrewAMD] #489649
09/19/26 17:09
09/19/26 17:09
Joined: Sep 2026
Posts: 1
M
mistery Offline
Guest
mistery  Offline
Guest
M

Joined: Sep 2026
Posts: 1
Hello Andrew, i am having lot of trouble, trying to build very simple strategies, for example:

History is QQQ.t6 just OHLC, i want to open 1 trade wednesday at market open and close the same trade at Thrusday market close.

Seem a very simple strategy but i am not able to close at trusday close, as the signal cant be executed at market close, i know it is not realistic strategy because when signal is send, market just close, but i want to do this because i have more years in this QQQ.t6 file than other QQQ tick data files. By the way i copy the claude code i got. I am a totally novice in c-lite, so you have an idea of a novice zorro trader coder

The code:

// IWM_WedThu.c
// Simple Zorro Lite-C bot:
// - Buy IWM at Wednesday's market open
// - Sell (close) that position at Thursday's market open
//
// Data file used: C:\Zorro\History\IWM_eod.t6
// (Zorro finds it automatically because the asset name below
// matches the file name, minus the .t6 extension.)
//
// IMPORTANT TIMING NOTE:
// Zorro evaluates the script at the CLOSE of each daily bar, and any
// order placed during that evaluation is filled at the OPEN of the
// NEXT bar. So to get filled on Wednesday's open, the enterLong()
// signal must be raised on TUESDAY's bar. Likewise, to get filled on
// Thursday's open, exitLong() must be raised on WEDNESDAY's bar.
//
// dow() returns a plain number, not a named constant:
// 0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday
// IWM_WedThu.c
// Simple Zorro Lite-C bot:
// - Buy IWM at Wednesday's market open
// - Sell (close) that position at Thursday's market open
//
// Data file used: C:\Zorro\History\IWM_eod.t6
// (Zorro finds it automatically because the asset name below
// matches the file name, minus the .t6 extension.)
//
// IMPORTANT TIMING NOTE:
// Zorro evaluates the script at the CLOSE of each daily bar, and any
// order placed during that evaluation is filled at the OPEN of the
// NEXT bar. So to get filled on Wednesday's open, the enterLong()
// signal must be raised on TUESDAY's bar. Likewise, to get filled on
// Thursday's open, exitLong() must be raised on WEDNESDAY's bar.
//
// dow() returns a plain number, not a named constant:
// 0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday

// Trade pointer kept between bars so we can exit the specific trade
// we opened, rather than "the current open long position".
TRADE *myTrade;

function run()
{
set(LOGFILE); // write a trade log so you can verify fills
BarPeriod = 1440; // 1440 minutes = daily bars (matches EOD data)
LookBack = 0; // no indicators, no warm-up period needed

StartDate = 2015; // adjust to taste, or delete to use full history
EndDate = 2017;

Fill = 3; // delayed fill: entry order executes at the OPEN of
// the next bar instead of the close of the signal bar

//asset("IWM_eod"); // loads C:\Zorro\History\IWM_eod.t6
asset("QQQ"); // loads C:\Zorro\History\QQQ.t6

// --- DIAGNOSTIC: print what Zorro sees on the days that matter ---
if(dow(0) == 2 || dow(0) == 3 || dow(0) == 4)
printf("\n%s dow=%i Fill=%i Open=%.3f Close=%.3f",
strdate("%Y-%m-%d", 0), dow(0), Fill, priceOpen(), priceClose());

// --- Entry: signal on Tuesday (2), fills at Wednesday's open ---
// (Standard Zorro behavior: order raised now, filled at next bar's open.)
if(dow(0) == 2 && !myTrade)
myTrade = enterLong();

// --- Exit: signal on Thursday (4), plain market close.
// IMPORTANT: exitTrade() must be called WITHOUT a price argument here.
// Passing a price (e.g. exitTrade(myTrade, priceClose())) makes Zorro
// register it as a Stop level on the trade (visible in the log as
// "Trail ... Stop ..."), and that Stop gets checked against price
// action independently of the Fill setting -- which is why changing
// Fill from 0 to 3 had no effect on the unwanted stop-outs. A plain,
// price-less exitTrade() just closes the position at market with no
// Stop object attached, removing that artifact entirely.
if(dow(0) == 4 && myTrade) {
exitTrade(myTrade);

// --- DIAGNOSTIC: confirm the exit landed on THIS (Thursday) bar
// and that no Stop/Trail line appears for this trade in the log.
printf("\n >> EXIT check: signaled %s (dow=%i) at Close=%.3f -- check trade log above for Stop/Trail lines",
strdate("%Y-%m-%d", 0), dow(0), priceClose());

myTrade = 0;
}
}

Re: Zorro tutorial ideas? [Re: AndrewAMD] #489653
41 minutes ago
41 minutes ago
Joined: Feb 2017
Posts: 1,832
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,832
Chicago
I might be able to make a tutorial based on this. (I'm writing a book right now.)

Short answer: For backtesting, remember that the bar is not formed until the end of the trading day. So if you want to trade market open, define the trade on the previous trading day and change your Fill options. And to trade market close, trade the same day with a different fill option.


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