Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (EternallyCurious, TipmyPip, Quad, AndrewAMD), 904 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Money Management with ProfitClosed when restarting a strategy #462076
09/07/16 07:00
09/07/16 07:00
Joined: Aug 2016
Posts: 95
Wien
T
trenki2 Offline OP
Junior Member
trenki2  Offline OP
Junior Member
T

Joined: Aug 2016
Posts: 95
Wien
The workshop about money management talks about the square root rule and proposes the following formula for money management:

Code:
Margin = 0.5 OptimalF * Capital * sqrt(1 + ProfitClosed/Capital);



Now the trade statistics page says "Trade statistics are updated on every bar. They are reset when the strategy is restarted. For preventing this, they could be copied into global variables or saved in a file that is loaded at start of the strategy."

So this means, the money management with the above formula only works when I never restart the strategy as when I do ProfitClosed will be reset to 0 right?

How can I make it work the right way, even when restarting the strategy? Save ProfitClosed on every bar in a file and restore it in the INITRUN and add that value to the zorro ProfitClosed value?
Or store it in AlgoVars (but there is only a limited amount of them). What about global variables are they somehow stored?

Re: Money Management with ProfitClosed when restarting a strategy [Re: trenki2] #462079
09/07/16 08:17
09/07/16 08:17
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Yes, you can store it in an AlgoVar. It is then loaded at restart.

Re: Money Management with ProfitClosed when restarting a strategy [Re: jcl] #475310
12/01/18 17:03
12/01/18 17:03
Joined: Oct 2018
Posts: 70
AZ
C
chsmac85 Offline
Junior Member
chsmac85  Offline
Junior Member
C

Joined: Oct 2018
Posts: 70
AZ
I am working through the black book and have arrived at the money managemetn section

This is an old topic so maybe it has been addressed. Oanda has been doing system maintenance on their platform and two of the times in the past month I've had to restart the algo in order to re-authenticate zorro with the Oanda server.

Will profit closed reset to zero in z12 system each time I restart?

Since z12 is a compiled file, I can't edit it as above.
Is there a workaround that can help prevent me losing everything due to a margin call!?

I know the simplest solution is to write my own algo so I can customize everything but I haven't coded one that can beat z12 yet laugh


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