Discontinued functions, macros and variables

Posted By: Joaquin

Discontinued functions, macros and variables - 05/28/18 19:03

Hi all,

Is there a list of discontinued functions, macros, and variables, and their newer versions (or at least the substitution of the previous command), as newer Zorro versions come out?

Because it is very annoying to code programs from 2 years ago and realize that in newer versions the same program does not compile.

Examples:
setf, resf, and I am pretty sure that there are many many others.

I must say that before asking here for this info, I have already look for it in the manual and in the "What's new" section. But haven't found anything yet.
Posted By: jcl

Re: Discontinued functions, macros and variables - 05/28/18 20:44

Zorro is not yet old enough to have discontinued functions, at least as to my knowledge.
Posted By: Joaquin

Re: Discontinued functions, macros and variables - 05/28/18 22:01

ok... then what should I do to compile

// don't trade when the equity curve goes down
// and is below its own lowpass filtered value
function checkEquity()
{
// generate equity curve including phantom trades
vars EquityCurve = series(EquityLong+EquityShort);
vars EquityLP = series(LowPass(EquityCurve,10));
if(EquityLP[0] < LowPass(EquityLP,100) && falling(EquityLP))
setf(TradeMode,TR_PHANTOM); // drawdown -> phantom trades
else
resf(TradeMode,TR_PHANTOM); // profitable -> normal trades
}

? It's from the manual, I'm using Zorro 1.66. Am I missing a header file?
Posted By: jcl

Re: Discontinued functions, macros and variables - 05/29/18 08:16

The manual contains usage examples. For compiling them, just use them in a suited script.
Posted By: Joaquin

Re: Discontinued functions, macros and variables - 05/29/18 08:38

Thanks for your answer jcl,

the thing is that if I try to compile the function above, which I got from the online manual, in
http://www.zorro-trader.com/manual/en/trademode.htm

with Zorro 1.66, I get a compilation error saying that it does not know what is setf and resf

If I open the manual by clicking the Help button in my terminal, it is true that this same function is different:

// equity curve trading: switch to phantom mode when the equity
// curve goes down and is below its own lowpass filtered value
function checkEquity()
{
if(Train) { Lots = 1; return; } // no phantom trades in training mode
vars EquityCurve = series(ProfitClosed+ProfitOpen);
vars EquityLP = series(LowPass(EquityCurve,10));
if(EquityLP[0] < LowPass(EquityLP,100) && falling(EquityLP))
Lots = -1; // drawdown -> phantom trading
else
Lots = 1; // profitable -> normal trading
}

So, maybe I got it wrong... Is the online manual referring to a newer version than mine? I imagine that, according to your answer, that is actually what is happening here.. Am I right?
Posted By: jcl

Re: Discontinued functions, macros and variables - 05/29/18 11:04

Certainly.
Posted By: Joaquin

Re: Discontinued functions, macros and variables - 05/29/18 19:29

Ooops.. ok then, feel free to slap me in the face

Sorry for that :-)
© 2024 lite-C Forums