Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
Deeplearning Script
by wolfi. 02/26/24 12:46
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/22/24 16:22
AssetAdd() vs. modern asset list?
by jcl. 02/21/24 15:01
How many still using A8
by Aku_Aku. 02/20/24 12:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 521 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Starting with Zorro-trader #487369
03/23/23 23:26
03/23/23 23:26
Joined: Mar 2023
Posts: 14
Freiburg
Y
YesNotes Offline OP
Newbie
YesNotes  Offline OP
Newbie
Y

Joined: Mar 2023
Posts: 14
Freiburg
Hello, I am totally new to zorro-trader and always have huge problems with my variable declarations,
so I did restart from scratch this most simple test-script to simply show the date and time.

Code
// Declare variables
int year = 2022;
int month = 3;
int day = 23;
int hour = 15;
int minute = 30;
int second = 0;

// Create datetime object
datetime myDateTime = date(year, month, day) + time(hour, minute, second);

// Print datetime object
printf("My date and time: %s", strdate(myDateTime));


Zorro 2.53.9 does throw, however following error:
Error in 'line 11:
syntax error
< datetime myDateTime = date(myYear, myMonth, myDay) + time((int)myHour, (int)myMinute, (int)mySecond); >.

Can anyone tell me what I am doing wrong?

Last edited by YesNotes; 03/24/23 03:28.
Re: Starting with Zorro-trader [Re: YesNotes] #487372
03/24/23 13:25
03/24/23 13:25
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65
Hi YesNotes,

Doesn't seem like this code is using any valid Zorro functions for dates:

https://zorro-project.com/manual/en/month.htm

Is it something from C API? maybe you need to add some includes to make this work

Re: Starting with Zorro-trader [Re: YesNotes] #487373
03/24/23 13:30
03/24/23 13:30
Joined: Feb 2017
Posts: 1,718
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,718
Chicago
First of all, if you haven't already, you should do the Lite-C tutorial from beginning to end. Definitely play around with those sample scripts. It starts here:
https://zorro-project.com/manual/en/tutorial_var.htm

Second, there is no such thing as datetime in Zorro. If you don't understand the MT4 code you received, you won't understand how to implement it in Zorro either.

Read the MQL4 and MQL5 docs for reference purposes:
https://docs.mql4.com/
https://www.mql5.com/en/docs

datetime, defined below, works completely differently than anything in Zorro:
https://docs.mql4.com/basis/types/integer/datetime
https://www.mql5.com/en/docs/basis/types/integer/datetime

Finally, check out this conversion reference if you haven't already:
https://zorro-project.com/manual/en/conversion.htm

Re: Starting with Zorro-trader [Re: YesNotes] #487388
03/27/23 11:07
03/27/23 11:07
Joined: Mar 2023
Posts: 14
Freiburg
Y
YesNotes Offline OP
Newbie
YesNotes  Offline OP
Newbie
Y

Joined: Mar 2023
Posts: 14
Freiburg
Once more thank you, Alun and Andrew,
(I accidentally deleted this comment, so I repost it)
Since I am totally new and have to learn everything from scratch anyway
I will consider other methods or programming languages for comparing different trading times,
for my research purposes, because trading as of yet is not an issue for me.


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