Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (alibaba, howardR, basik85278), 756 guests, and 3 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
Set regular trading hours? #464591
02/28/17 07:48
02/28/17 07:48
Joined: Feb 2017
Posts: 369
D
Dalla Offline OP
Senior Member
Dalla  Offline OP
Senior Member
D

Joined: Feb 2017
Posts: 369
Is there any parameter that I can set to determine the regular trading hours for my algo, ie "Don't trade before this time and exit all positions at that time".

Currently I'm doing this manually like so

//Only enter trades during these hours
if (hour() >= 9 && minute() >= 0 && hour() <= 17 && minute() <= 29)
{
...
enterLong();
...
}

if (hour() >= 17 && minute() >= 30)
{
exitLong();
}

Re: Set regular trading hours? [Re: Dalla] #464597
02/28/17 14:53
02/28/17 14:53
Joined: Feb 2017
Posts: 8
Veli Offline
Newbie
Veli  Offline
Newbie

Joined: Feb 2017
Posts: 8
Hi Dalla smile

I haven't found a parameter so far. Like you I'm curious if there is one.

Similar to you I use an IF statement:
Code:
if(ltod(CET) >= 900 && ltod(CET) <= 1729)
{
  ...
  enterLong();
  ...
}



Does someone else have any ideas? wink

Best wishes

Veli

Last edited by Veli; 02/28/17 14:57.
Re: Set regular trading hours? [Re: Veli] #464607
03/01/17 10:28
03/01/17 10:28
Joined: Nov 2016
Posts: 35
therealLeon Offline
Newbie
therealLeon  Offline
Newbie

Joined: Nov 2016
Posts: 35
Hi,

@Veli: Your way is the same way i handle timeframes for trading.

BR

Leon

Last edited by therealLeon; 03/01/17 10:29.

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