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

Re: [amibroker] Testing multiple exits


  • Date: Fri, 22 Jan 2010 06:00:29 -0700
  • From: Howard B <howardbandy@xxxxxxxxx>
  • Subject: Re: [amibroker] Testing multiple exits

PureBytes Links

Trading Reference Links



Hi Richard --

Something like this?

///////////////////////////////////////////////////
//    MultipleExits.afl
//
//    Buy the first trading day of the month
Buy = Month() != Ref(Month(),-1);

WhichExit = Optimize("WhichExit",1,1,4,1);
switch(WhichExit)
{
    case 1:
    //    Sell the first Wednesday
    Sell = DayOfWeek() == 3;
    break;

    case 2:
    //    Sell using a 1% profit target
    ApplyStop(stopTypeProfit,stopModePercent,1,1);
    break;

    case 3:
    //    Sell after a 5 day holding period
    ApplyStop( stopTypeNBar, stopModeBars, 5 );
    break;

    default:
    //    sell on the 20th
    Sell = Day()>=20;
    break;

}
////////////////////////////////////

Thanks,
Howard


On Fri, Jan 22, 2010 at 5:14 AM, Richard <richpach2@xxxxxxxxx> wrote:
 

Hello,
Is it possible or practical to test six different exit strategies in one optimization run?
Could anyone point me to code example how this can be implemented?

Regards
Richard




__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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





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

__,_._,___