Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 945 guests, and 8 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
Page 3 of 3 1 2 3
Re: Unable to close MT4 positions from a previous Zorro session. [Re: Grant] #485749
04/19/22 07:24
04/19/22 07:24
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
Re-read the manual on enter/exit commands: trading is disabled during the lookback period, and the first bar after the lookback is StartBar, not 1.

So, remove Bar>1 ( or substitute it with ( if (!is(LOOKBACK)) or Bar>StartBar) and remove quit().

Re: Unable to close MT4 positions from a previous Zorro session. [Re: Zheka] #485764
04/20/22 13:43
04/20/22 13:43
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline OP
Member
Grant  Offline OP
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
OK, thanks a lot for this, very insightful.

I thought that the LOOKBACK period only had an impact in TESTMODE with a specific StartDate.
So, in TRADEMODE, this basically means that it's best to only re-start Zorro during the weekend when it's really needed, because live trading is always idle for the length of the LOOKBACK period, even when StartDate is 'NOW'.

Is this correct?

Re: Unable to close MT4 positions from a previous Zorro session. [Re: Grant] #485769
04/20/22 14:41
04/20/22 14:41
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
In Live, Lookback history is back-filled - from existing data and/or freshly loaded from the broker. So trades are allowed from the first complete bar onward. Not sure how this works with StartDate=NOW.

Last edited by Zheka; 04/20/22 14:41.
Re: Unable to close MT4 positions from a previous Zorro session. [Re: Zheka] #485770
04/20/22 14:50
04/20/22 14:50
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline OP
Member
Grant  Offline OP
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
Originally Posted by Zheka
Not sure how this works with StartDate=NOW.


Based on what I read in the manual, it seems best not to define StartDate at all in TRADEMODE.

Quote
StartDate = NOW sets the start date to the current day, and executes the run function in [Trade] mode immediately after the lookback period, regardless of the current time. Useful for strategies that do not run permanently, but are only started for modifying a portfolio.
- StartDate = 0 (default) starts the simulation with NumYears before the current year.

Last edited by Grant; 04/20/22 15:23.
Re: Unable to close MT4 positions from a previous Zorro session. [Re: Grant] #485772
04/20/22 16:33
04/20/22 16:33
Joined: Jul 2017
Posts: 783
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 783
StartDate is 'ignored' in Live,unless set to NOW.

Last edited by Zheka; 04/20/22 16:34.
Re: Unable to close MT4 positions from a previous Zorro session. [Re: Zheka] #485774
04/20/22 17:42
04/20/22 17:42
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline OP
Member
Grant  Offline OP
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
I see, so that NOW setting in TRADEMODE did more harm than good.
I will log some details to be sure that things run correct right from the start.

I appreciate your help Zheka.

Page 3 of 3 1 2 3

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