Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by 7th_zorro. 04/16/24 13:19
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Quad, alibaba, rki), 425 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 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,724
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,724
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