Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, Quad, VoroneTZ, 1 invisible), 623 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Possible bug with LifeTime and TradeExitTime #473304
06/27/18 09:13
06/27/18 09:13
Joined: Mar 2017
Posts: 65
G
Ger1 Offline OP
Junior Member
Ger1  Offline OP
Junior Member
G

Joined: Mar 2017
Posts: 65
I got an issue executing LifeTime and TradeExitTime properly.

Various algos/asset combinations are coded in a loop. I want one of those strategies("Algo1") to exit after 10 bars, which I first tried using LifeTime=10.
The issue is that not only "Algo1" is exited after 10 bars but other strategies as well.
Be aware that I already reset LifeTime=0 when executing the other algos.

I used following type of code:

function algo1()
{
algo("Algo1");
LifeTime=10;
enterLong();
}

function algo2()
{
algo("Algo2");
LifeTime=0;
enterLong();
}

...

while(algo(loop("Algo1","Algo2","Algo3")))
while(asset(loop("Asset1","Asset2")))
{
if(Algo=="Algo1") algo1();
if(Algo=="Algo2") algo2();
...
}




Can anyone advise what's going wrong here?

Re: Possible bug with LifeTime and TradeExitTime [Re: Ger1] #473305
06/27/18 09:22
06/27/18 09:22
Joined: Mar 2017
Posts: 65
G
Ger1 Offline OP
Junior Member
Ger1  Offline OP
Junior Member
G

Joined: Mar 2017
Posts: 65
I also tried setting the maximum number of traded bars in a tmf, however the results did not change.

function tmf()
{
if(TradeIsOpen and TradeAlgo=="Algo1")
{
TradeExitTime=11;
}
return 8;

}

function Algo1()
{
algo("Algo1");
enterLong(tmf);
}


function Algo2()
{
algo("Algo2");
enterLong();
}

Last edited by Ger1; 06/27/18 09:25.
Re: Possible bug with LifeTime and TradeExitTime [Re: Ger1] #473378
07/02/18 09:49
07/02/18 09:49
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
LifeTime is trade specific and does not affect other trades. So the problem is somewhere else in your script - if you can't find it, and don't want to post it here, you can get help from Support.


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