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

Re: [amibroker] AFL (Beginner Question)



PureBytes Links

Trading Reference Links

hello anty3de,

After looking at the formula you posted earlier, and reading the formula
again along with the explanation, Here is ( I believe ) the correct
conversion : ( I misread your explanation ) . Sorry for any confusion.

final= BollLower <= Ref(LLV(bollLower,4),-1) OR Ref(BollLower,-1) <=
Ref(LLV(bollLower,4),-2) AND (Close <= Ref(LLV(C,4),-1) OR Ref(C,-1) <=
Ref(LLV(C,4),-1));

/**********************************************/

//Load into AA, set range, apply to stock , under settings ( positions=
long and short ) all delays=1, all //prices=open ) , backtest.

Periods=20;
shift=2;

BollHigh = BBandTop(Close, Periods, shift);
bolllower = BBandBot(Close, Periods, shift);
bollmiddle=MA(C,20);

final= BollLower <= Ref(LLV(bollLower,4),-1) OR Ref(BollLower,-1) <=
Ref(LLV(bollLower,4),-2) AND (Close <= Ref(LLV(C,4),-1) OR Ref(C,-1) <=
Ref(LLV(C,4),-1));


Buy=Cross(C,bollmiddle);
Sell=final;
Short=Sell;Cover=Buy;
Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);
Filter=1;
AddColumn(Buy,"buy");AddColumn(Sell,"sell");


//Plot(final,"",4,2);

Plot(bollmiddle,"mid",7,1);
Plot(bollhigh,"top",5,1);
Plot(C,"close",6,64);
Plot(bolllower,"bot",5,1);
Plot(Buy*bolllower,"",5,2);//places a buy spike on chart
Plot(Sell*bolllower,"",4,2);//places a sell spike on chart


520001085531-0001@xxxx wrote:

> Hi Anthony,
>
> > Name ????
>
> I don't know why it is stripped off at yahoo. I'm posting
> the mails from home via my new ISP to yahoo, and somewhere
> the name is stripped off; maybe because I'm using a nickname.
>
> > Periods=15;
> > shift=2;
> >
> > BollHigh = BBandTop(Close, Periods, shift);
> > bolllower = BBandBot(Close, Periods, shift);
> >
> > final= BollLower <= LLV(bollLower,-4) OR Ref(BollLower,-1) <=
> > LLV(bollLower,-4) AND (Close <= LLV(C,-4) OR Ref(C,-1) <=
> LLV(C,-4));
> >
> > Plot(final,"",4,2);
>
> Thanks, this gives me some ideas, but to make this complete,
> how would one realize the following:
> Buy if above condition is met, and sell if close price crosses
> bollinger middle band.
> And, how to place some arrows on these days on the main chart?
>
> Thanks
> anty3de
>
>
>
>
>
> Yahoo! Groups Sponsor
[Image]
Click here to find your contact lenses!
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.