Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 664 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: ExitTIme=3 but Max open trades is thousands [Re: GPEngine] #441277
05/17/14 06:34
05/17/14 06:34
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline OP
User
GPEngine  Offline OP
User
G

Joined: Sep 2013
Posts: 504
California
At some bars, I am supplying an absurd value for Margin, via
Margin = OptimalFLong * Capital * sqrt(1 + ProfitClosed / Capital);
or
Margin = OptimalFShort * Capital * sqrt(1 + ProfitClosed / Capital);
this comes out as -INF when ProfitClosed is less than -Capital.

Zorro does not complain and instead behaves bizarrely.

I guess it is my fault for supplying a bad Margin.

It would be nice if Zorro complained in a more visible and directed way in case of invalid trade parameters.

Note that if you set Margin to 0, or a finite negative number, Zorro does the sensible thing and does not enter a trade. But if Margin is -INF, it does enter a trade or do something weird.

Demo:
Code:
function run() {
  BarPeriod = 399;
  LookBack = 273;
  StartDate = 20140101;
  EndDate = 20140401;
  set(TICKS);
  ExitTime = 3;
  Capital = 4500;
  var atrx = ATR(232);
  Stop = 1.0 * atrx;
  TakeProfit = 1.5 * atrx;
  Margin = sqrt(-1);
  enterLong();
}



Expected:
No trades when Margin is not a finite positive number.

Re: ExitTIme=3 but Max open trades is thousands [Re: GPEngine] #441317
05/19/14 07:54
05/19/14 07:54
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Ok, we'll implement an error message when Margin is an invalid number.

Page 2 of 2 1 2

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