Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Edgar_Herrera, VoroneTZ, Akow), 973 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
TRADE* pointer in TradeVar? #450543
04/17/15 03:49
04/17/15 03:49
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline OP
Serious User
DdlV  Offline OP
Serious User
D

Joined: Jun 2013
Posts: 1,609
Hi jcl.

Is it possible to store a pointer in a TradeVar?

If not, is there another way to similarly link trades?

Also, it appears a for(open_trades) within a for(open_trades), even within a function, doesn't work. Is this a limitation or is there a workaround?

Thanks.

Re: TRADE* pointer in TradeVar? [Re: DdlV] #450563
04/17/15 16:36
04/17/15 16:36
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
For storing a pointer in a var, try *(TRADE**)&TradeVar - maybe this works. There is however no workaround that would make a double for(open_trades) loop work.

Re: TRADE* pointer in TradeVar? [Re: jcl] #450741
04/21/15 19:18
04/21/15 19:18
Joined: Jun 2013
Posts: 1,609
D
DdlV Offline OP
Serious User
DdlV  Offline OP
Serious User
D

Joined: Jun 2013
Posts: 1,609
Hi jcl.

Re. nested for(open_trades), I've had some initial success with this workaround code:

Code:
void	sub(other paramenters,int TID) {
	TRADE	*SaveThisTrade	= ThisTrade;
	for(open_trades) {
		// anything that doesn't close TID
	}
	for(open_trades) if(TradeID==TID) break;
	ThisTrade	= SaveThisTrade;
}

void	run () {
	// do some stuff
	for(open_trades) {
		// do stuff
		sub(other parameters,TradeID);
		// do other stuff
	}
	// do more stuff
}



Of course, since I can't see "under the covers" I don't know if there are any pitfalls to this method, and would appreciate your comments!

Thanks.


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