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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, NeoDumont), 761 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
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