2 registered members (Ayumi, AndrewAMD),
822
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: optimize() limitations?
[Re: jcl]
#425567
07/08/13 14:26
07/08/13 14:26
|
Joined: Jun 2013
Posts: 1,609
DdlV
OP
Serious User
|
OP
Serious User
Joined: Jun 2013
Posts: 1,609
|
Thanks jcl. I've been to the manual many times. But that doesn't mean I understand it all! First, shouldn't the error/result be the same no matter where BarPeriod is set? As for the example code, this:
function run()
{
set(PARAMETERS);
BarPeriod = optimize(240,60,1440,60);
Stop = 10 * PIP;
Trail = 10 * PIP;
enterLong();
}
gives identical results for all optimize parameters I've tried so far. This:
function run()
{
set(PARAMETERS);
if(is(INITRUN)) BarPeriod = optimize(240,60,1440,60);
Stop = 10 * PIP;
Trail = 10 * PIP;
enterLong();
}
gives the Error 040.
|
|
|
Re: optimize() limitations?
[Re: jcl]
#425571
07/08/13 15:01
07/08/13 15:01
|
Joined: Jun 2013
Posts: 1,609
DdlV
OP
Serious User
|
OP
Serious User
Joined: Jun 2013
Posts: 1,609
|
Thanks jcl. It's so much fun being a junior programmer again & making such idiotic mistakes... At least now it's maybe sunk in that optimize() is not a "meta" process set up once at the beginning of strategy execution, but rather implemented as a regular function call... But BarPeriod may be... Thanks for the TimeFrame code.
|
|
|
|