[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Using functions and optimize( )



PureBytes Links

Trading Reference Links

Hello,
 
In fact optimize() can be used inside the function but the formula writer needs to ensure
that such function is called unconditionally (not inside "if" or "for" or "while" statement that may not get executed
or may get executed more than once).
This is so because AA executes formula oncebefore actual optimization to "read" optimization variables and ranges.
If such initial execution does not call optimize() (because it is buried in some conditional statement) the AA
will not "notice" it.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
Sent: Wednesday, March 02, 2005 11:12 AM
Subject: RE: [amibroker] Using functions and optimize( )

Probably because Optimize should not be used from within a function. It is an instruction to the AA machine, it is not an afl statement that is conditional on other afl code.
 
best regards,
herman
-----Original Message-----
From: Claude Caruana [mailto:claudecaruana@xxxxxxxxxxx]
Sent: Wednesday, March 02, 2005 4:37 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Using functions and optimize( )

Hi All,

 

I am using functions in my code and came across the following problem:

 

When I use optimize(….) inside a function, during the optimization backtest Amibroker will run 2 combinations of the same value

 

For example, optimize(“X”,1,1,10,1) will result in 100 runs. The result set contains two columns of X, each result line containing a different combination of the two X columns.

 

If I move this line outside the function, it works fine.

 

Did anybody come across this before? Is there any way of fixing this? (apart from removing it from within the function?)

 

Regards,

Claude

 



Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html





Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html





Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links