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 <[email protected]> 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
>
>  
>

Reply via email to