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

[amibroker] Re: functions/variable scope errors



PureBytes Links

Trading Reference Links

-- In amibroker@xxxxxxxxxxxxxxx, "loveyourenemynow" <loveyourenemynow@xxx> wrote:

> I need to optimize on the functions, so their definition should change
> for different optimization parameter, and since I cannot define them
> within if statements I don't see how I could achive whar I want using
> your idea.

I think Graham mentioned to parameterize your functions so that within the function you can have a totally different implementation.  e.g.


function Test(myParam, myClose)
{
    if (myParam == 0)
    {
        result = Ref(myClose, -1);
    }
    else
    {
        result = StDev(myClose, 10);
    }
   
    return result;
}


I think you should focus on achieving the functionality you want within the technology constraints presented instead of focusing on polymorphism (or other design patterns).

Tuzo
__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___