PureBytes Links
Trading Reference Links
|
Anthony,
Thanks for helping with the AFL. I am getting two
error messages
On the formula to load into AA- I get this
message:
Syntax error at line 12, column 4:
128=---^
At this location in the code:
<FONT face="Courier New"
size=3>ChartStyle=64;//Main chart style ex.64 =
candlestick,128=Barchart,1=line.
I have apply to all stocks and N=1
Then on the Indicator Builder - I get thiserror
message
Unknown identifier at line 11, column
6:
chart,-----^
At this location in the code:
ChartStyle=64<FONT
size=1>;//Main chart style ex.64 =
candlestick, 128=Bar
chart,<FONT color=#ff00ff
size=1>1=line.
I know I must have some setting wrong, I have tried
everytrhing I know to correct it but I am stuck.
Can you help me fix
this?
Thanks,
<FONT
size=2>Brian
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Anthony Faragasso
To: <A title=amibroker@xxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Monday, June 24, 2002 4:18 PM
Subject: Re: [amibroker] AFL- Needs
help
Brian,Try this formula: load into AA, n last
quotations and n=1, clickexplore. The filter statement is set to show
contraction only, if youwant expansion and contraction to show, then alter
the filter statementto this:Filter=Cond1 > 0 and Cond2 > 0 AND
Close > 0 AND Close < 25 AND Volume >5000;/*********Start
code************************///Bollinger Bands with Expansion and
Contraction//HIGHLIGHTS// Contraction Color:
Bluepds=35;//bollinger bands periodsshift=2;//bollinger band
shiftChartStyle=64;//Main chart style ex.64 =
candlestick,128=Barchart,1=line.Cond1=
BBandTop(Close,pds,shift)< Ref(BBandTop(Close,pds,shift),-1)
AND
BBandBot(Close,pds,shift)>Ref(BBandBot(Close,pds,shift),-1);//
Expansion Color: RedCond2= BBandTop(Close,pds,shift)>
Ref(BBandTop(Close,pds,shift),-1) AND
BBandBot(Close,pds,shift)<Ref(BBandBot(Close,pds,shift),-1);barcolor=IIf(Cond1,6,IIf(Cond2,4,0));Graph0=BBandTop(C,pds,shift);Graph1=C;Graph1Style=ChartStyle;Graph2=BBandBot(C,pds,shift);Graph0Style=Graph2Style=1;Graph0BarColor=Graph2BarColor=ValueWhen(barcolor!=0,barcolor);/**********************************************************/Lookback=10;diff=BBandTop(Close,pds,shift)-
BBandBot(Close,pds,shift);contraction_cond=IIf(diff <
Ref(LLV(diff,Lookback),-1),1,0);expansion_cond=IIf(diff >
Ref(HHV(diff,Lookback),-1),1,0);present=WriteIf(Cond1,"Contraction","Expansion");//is
the marketcurrently under expansion or contractionFilter=Cond1
> 0 AND Close > 0 AND Close < 25 AND Volume >
5000;AddColumn(IIf(Cond1,C,IIf(Cond2,C,C)),"close");AddColumn(Cond1,"contract");AddColumn(ValueWhen(Cond1,BBandTop(Close,pds,shift)-BBandBot(Close,pds,shift),1),"ContractValue");AddColumn(Cond2,"expand");AddColumn(ValueWhen(Cond2,BBandTop(Close,pds,shift)-BBandBot(Close,pds,shift),1),"ExpansionValue");AddTextColumn(Present,"Condition");AddColumn(RSI(),"RSI");AddColumn(ADX(),"ADX");/*************end
Code************************/For indicator builder:/********Start
code*********************///Bollinger Bands with Expansion and
Contraction//HIGHLIGHTS// Contraction Color:
Bluepds=35;//bollinger bands periodsshift=2;//bollinger band
shiftChartStyle=64;//Main chart style ex.64 = candlestick,
128=Barchart,1=line.Cond1= BBandTop(Close,pds,shift)<
Ref(BBandTop(Close,pds,shift),-1) AND
BBandBot(Close,pds,shift)>Ref(BBandBot(Close,pds,shift),-1);//
Expansion Color: RedCond2= BBandTop(Close,pds,shift)>
Ref(BBandTop(Close,pds,shift),-1) AND
BBandBot(Close,pds,shift)<Ref(BBandBot(Close,pds,shift),-1);barcolor=IIf(Cond1,6,IIf(Cond2,4,0));Graph0=BBandTop(C,pds,shift);Graph1=C;Graph1Style=ChartStyle;Graph2=BBandBot(C,pds,shift);Graph0Style=Graph2Style=1;Graph0BarColor=Graph2BarColor=ValueWhen(barcolor!=0,barcolor);/********End
code******************/AnthonyBrian Elijah wrote:>
I was looking to find volatility or extreme tightness/contraction with>
the bands. This exploration returned no stocks>> Basically I
wanted yesterday to be the point of lowest distance> between the bands
over the past 10 days- How can I adjust this AFL.>> Thanks in
Advance,>> Brian>>>> bbtop =
BBandTop(Close, 35, 2);>> bbbot = BBandBot(Close, 35,
2);>> Yesterdaybbtop = Ref( MA( bbtop, 50 ), -1
);>> Yesterdaybbbot = Ref( MA( bbbot, 50 ), -1
);>> Yesterdaybbtopp = Ref( MA( bbtop, 50 ), -10
);>> Yesterdaybbbott = Ref( MA( bbbot, 50 ), -10
);>> bandlow = LLV( MA( bbtop, 50 ), -1 );>>
bandhigh = HHV(MA( bbbot, 50 ), -1 );>> bandlowa = LLV(MA(
bbtop, 50 ), -10 );>> bandhighb = HHV(MA( bbbot, 50 ), -10
);>> Filter = Close > 0 AND Close < 25 AND Volume >
5000 AND> (Yesterdaybbtop + Yesterdaybbbot < Yesterdaybbtopp +
Yesterdaybbbott)> AND (bandlow + bandhigh) < (bandlowa +
bandhighb);>> NumColumns = 4;>> Column0 =
Close;>> Column0Name = "Close";>> Column1 =
Volume;>> Column1Name = "Volume";>> Column2=
RSI();>> Column2Name = "RSI";>> Column3 =
ADX();>> Column3Name = "ADX";>>> Your use
of Yahoo! Groups is subject to the Yahoo! Terms of
Service.Your
use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
|