Originally Posted By: jcl
We're looking for beta testers for the mentioned future interface for running strategies in DLLs. If you're interested, please contact support (at) opgroup.de.

Obsolutely Sir. Mail sent.

I had a go at implementing a pointer handover and it appears to be mostly no problem. I intent to use the headers from Zorro as-is without touching them. Thus I have to accompany the original function declarations with implementations, that in return call the function pointer given by lite-c. I created some simple macros that generate the required code from function definition list(s).

Unfortunately the function declarations show no information about optional parameter values. Thus I have to a) check the zorro manual manually if some arguments are optional and b) then guess what the default value could be. I assume the primitive data types and pointers have a default value of 0 (always?). Not sure about string (char*). Also 0 (NULL) or "" (empty string) ? Maybe there are special cases where it is different but not documented?

Finally I have to accompany those function declarations with an overload that specifies the optional argument values.

So original function (as in functions.h)
Code:
TRADE* enterLong(function f,var v0,var v1,var v2,var v3,var v4,var v5,var v6,var v7,...)
{
return bridge::enterLong_ptr(f,v0,v1,v2,v3,v4,v5,v6,v7);
}


is accompanied by
Code:
TRADE* enterLong(int Lots=0, var Entry=0, var Stop=0, var TakeProfit=0, var Trail=0, var TrailSlope=0, var TrailLock=0, var TrailStep=0)
{
return bridge::enterLong_ptr(Lots, Entry, Stop, TakeProfit, Trail, TrailSlope, TrailLock, TrailStep, 0);
}



What I am wondering about in the case of enterLong, enterShort is the behaviour you impose according to the manual.
http://www.zorro-trader.com/manual/en/buylong.htm

Assuming there is just one enterLong function (as indicated by functions.h), and int/long are both 4 bytes, how does this function know if the first parameter means lot size or function ptr?

Last edited by pascalx; 08/30/17 09:30.