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

Re: [amibroker] ApplyStop & ValueWhen question



PureBytes Links

Trading Reference Links

HB,

Does this help.

Buy=Cross(C,MA(C,28));
Sell=Ref(Buy,-2) OR C < ValueWhen(Buy,Ref(L,-1));


HB wrote:

> Hello all,
>
> I'm trying to code some AFl to sell if EITHER of the following 2
> conditions are met:- 2 days have passed since buyingOR- the price has
> dropped below the low of the bar right before buying The following AFL
> is not working correctly. What am I doing wrong ?
> //ApplyStop(0,2, Ref(Low, -1),1); // I don't think this one is right
> ApplyStop(0,2, ValueWhen(buyconditions, Low, 1),1); // this one is
> not working correctly
>
> Buy = buyconditions;
>
> Buy = ExRemSpan(Buy,2);
>
> Sell = Ref (Buy, -2); ////////////////////////////////
>
>
> Yahoo! Groups Sponsor
ADVERTISEMENT


>
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.