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

Re: [amibroker] Re: Sell after certain Percentage Gain Question?



PureBytes Links

Trading Reference Links

No. ApplyStop is its own function. It returns nothing. It is not used in a Sell statement, which returns a 1 when true or 0 when false. Check the help file under ApplyStop. The answer to your question is:

Percent = Optimize("Percent",10,1,20,1);
ApplyStop(stopTypeProfit, stopModePercent,Percent);

Al Venosa

alannortham wrote:

Is it like this:

Sell = ApplyStop(); // Of course I would fill in the required info
between the brackets...

--- In amibroker@xxxxxxxxxxxxxxx, "Fred" <ftonetti@xxxx> wrote:
>
> ApplyStop
>
> --- In amibroker@xxxxxxxxxxxxxxx, "alannortham" <anortham@xxxx>
> wrote:
> >
> > When backtesting and my setup conditions triggers a BUY how do I
> > write the AFL code so that my trade gets closed after it has
> gained
> > say 10%?
> >
> >
> > Sell = ?;
> >
> >
> > Thanks,
> > Alan





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 Links