PureBytes Links
Trading Reference Links
|
Ok with this revised code i am getting the multiple trend lines
fine, however when i try to run an explore I am not getting the
results that match up with the arrows on the chart? It seems that I
cannot pass out the cross check ie (TLBUP/DN)?
TLBUP=0;
TLBDN=0;
StudyID="";
function trendCheckup(StudyID)
{
global TLBUP;
Linup = Study(StudyID,GetChartID());
TLBUP = Cross(CCI(14),Linup);
PlotShapes( IIf
((TLBUP),shapeUpArrow,shapeNone),colorDarkGreen,0,Graph0,Offset=20);
return TLBUP;
}
function trendCheckdown(StudyID)
{
global TLBDN;
LineDn = Study(StudyID,GetChartID());
TLBDN = Cross(LineDn,CCI(14));
PlotShapes( IIf
((TLBDN ),shapeDownArrow,shapeNone),colorDarkRed,0,Graph0,Offset=20);
return TLBDN;
}
alphai = "";
for( i = 0; i<27; i++ )
{
if (i==1) {alphai="A";}if (i==2) {alphai="B";}if (i==3) {alphai="C";}
if (i==4) {alphai="D";}if (i==5) {alphai="E";}if (i==6) {alphai="F";}
if (i==7) {alphai="G";}if (i==8) {alphai="H";}if (i==9) {alphai="I";}
if (i==10) {alphai="J";}if (i==11) {alphai="K";}if (i==12)
{alphai="L";}
if (i==13) {alphai="M";}if (i==14) {alphai="N";}if (i==15)
{alphai="O";}if (i==16) {alphai="P";}if (i==17) {alphai="Q";}if
(i==18) {alphai="R";}
if (i==19) {alphai="S";}if (i==20) {alphai="T";}if (i==21)
{alphai="U";}if (i==22) {alphai="V";}if (i==23) {alphai="W";}if
(i==24) {alphai="X";}
if (i==25) {alphai="Y";}if (i==26) {alphai="Z";}
trendCheckup("U"+alphai);
trendCheckdown("D"+alphai);
}
LineL=Study("US",1144);
LineS=Study("DS",1144);
CrosschkL=Cross(CCI(14),LineL);
CrosschkS=Cross(LineS,CCI(14));
//PlotShapes( IIf
((CrosschkL),shapeUpArrow,shapeNone),colorDarkGreen,0,Graph0,Offset=2
0);
//PlotShapes( IIf
((CrosschkS ),shapeDownArrow,shapeNone),colorDarkRed,0,Graph0,Offset=
20);
Buy=IIf(TLBUP>0,1,0);
Short=IIf(TLBDN>0,1,0);
Filter = Buy OR Short;
Any ideas?
Thanks
--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> wrote:
>
> One thing, to backtest you need to put the actual chart ID number
into
> study as backtest is run from AA not chart
>
> I am not certain you can pass [] values outside the loop for non
bar
> identification
>
>
> On 10/12/05, coba702002 <coba702002@xxxx> wrote:
> > I am trying to get multiple hand drawn studies on my chart
showing
> > arrows and then able to back test or explore the results without
any
> > luck. I am now just going around in circles and totally
> > frustrated... any pointers on this snipet of code would be
greatly
> > appreciated
> >
> > Thanks in advance
> >
> > alphai = "";
> > TLBDN=0;
> > TLBUp=0;
> >
> > for( i = 1; i < 27; i++ )
> > {
> > if (i==1) {alphai="A";}
> > if (i==2) {alphai="B";}
> > if (i==3) {alphai="C";}
> > if (i==4) {alphai="D";}if (i==5) {alphai="E";}if (i==6)
{alphai="F";}
> > if (i==7) {alphai="G";}if (i==8) {alphai="H";}if (i==9)
{alphai="I";}
> > if (i==10) {alphai="J";}if (i==11) {alphai="K";}if (i==12)
> > {alphai="L";}
> > if (i==13) {alphai="M";}if (i==14) {alphai="N";}if (i==15)
> > {alphai="O";}if (i==16) {alphai="P";}if (i==17) {alphai="Q";}if
> > (i==18) {alphai="R";}
> > if (i==19) {alphai="S";}if (i==20) {alphai="T";}if (i==21)
> > {alphai="U";}if (i==22) {alphai="V";}if (i==23) {alphai="W";}if
> > (i==24) {alphai="X";}
> > if (i==25) {alphai="Y";}if (i==26) {alphai="Z";}
> >
> >
> > id="U";
> > id0=alphai ;
> > id2=(id+id0);
> >
> > //if (id0 != ""){i=26;}
> >
> > LinUp=Study(id2,GetChartID());
> >
> > id="D"+alphai;
> > LinDn=Study(id,GetChartID());
> >
> > TLBDN = Cross(LinDn,z);
> > TLBUP = Cross(CCI(14),LinUp);
> > }
> >
> >
> > PlotShapes( IIf
> >
((TLBDN ),shapeDownArrow,shapeNone),colorDarkRed,0,Graph0,Offset=20);
> > PlotShapes( IIf
> >
((TLBUP),shapeUpArrow,shapeNone),colorDarkGreen,0,Graph0,Offset=20);
> >
> >
> >
> >
> >
> >
> >
> >
> > Please note that this group is for discussion between users only.
> >
> > To get support from AmiBroker please send an e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> --
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://e-wire.net.au/~eb_kavan/ab_write.htm
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~->
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|