Gamestudio Links
Zorro Links
Newest Posts
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
Release 2.68 replacement of the .par format
by Martin_HH. 09/23/25 20:48
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 17,605 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
How to control all open trades of an algo? #463058
11/12/16 16:31
11/12/16 16:31
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
Hi

Currently there is NumOpenLong for each asset and each algo, and NumOpenTotal for all assets and algos. How to know all open long trades for all assets and one algo?

Re: How to control all open trades of an algo? [Re: nanotir] #463068
11/13/16 00:25
11/13/16 00:25
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline
Senior Member
boatman  Offline
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
You can use the following macros:

This loops through all open, closed and pending trades:

Code:
for(all_trades)



This one loops through all open and pending trades:

Code:
for(open_trades)



This one loops through all open and pending trades of the currently selected asset/algo combination:

Code:
for(current_trades)



You get access to each individual trade's trade variables and trade statistics inside the loops.

Re: How to control all open trades of an algo? [Re: boatman] #463281
11/26/16 11:15
11/26/16 11:15
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
I may explained wrong my question.

The makros above let you loop through:
- Either all assest and all algos
- Or one asset and one algo

I want to loop or call in function all assets and one algo (not one asset/algo combination and not all assets/algos combination). Now, it maybe possible to call different assets inside the loops to get the statistics at the end of allassets and one algo combination, but it maybe easier if a function is already implemented for it, instead of manually calling all assets inside a loop.

Re: How to control all open trades of an algo? [Re: nanotir] #463419
12/03/16 22:10
12/03/16 22:10
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland
Any ideas?

Re: How to control all open trades of an algo? [Re: nanotir] #463457
12/05/16 08:22
12/05/16 08:22
Joined: Jul 2000
Posts: 28,022
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,022
Frankfurt
He meant that you should loop through all open trades and count the trades with the desired algo.

Re: How to control all open trades of an algo? [Re: nanotir] #463460
12/05/16 09:17
12/05/16 09:17
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline
Senior Member
boatman  Offline
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
I don't know of any existing functions that would allow you to do that, but you can do something like the following to operate on only the trades belonging to the current Algo:
Code:
string currentAlgo = Algo;
for(all_trades)
{
    if(strstr(Algo, currentAlgo))
    {
        ...
        do some stuff
        ...
    }
}


Re: How to control all open trades of an algo? [Re: boatman] #463478
12/06/16 15:29
12/06/16 15:29
Joined: Mar 2015
Posts: 336
Rogaland
N
nanotir Offline OP
Senior Member
nanotir  Offline OP
Senior Member
N

Joined: Mar 2015
Posts: 336
Rogaland


I think that could work.

Thanks


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1