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

Re: [amibroker] Makes no sense??? A bug? or ???



PureBytes Links

Trading Reference Links

I dd a check and it works for me
You do realise that you will never be able to view the variable TLBUP
as it is only the resultant of the function calculation. It is not a
variable for actual use outside the function. I changed the base plot
to price to make life easier for me

Plot(C,"",colorWhite,styleBar);

function trendCheckup(StudyID)
{
Linup = Study(StudyID,GetChartID());
TLBUP = Cross(C,Linup);
PlotShapes( TLBUP*shapeUpArrow,colorBrightGreen,0,L,-20);
return TLBUP;
}

ass = trendCheckup("XY");
Title = Name()+" "+ ass ;


you should assign the function results to a variable.
To call it up by itself is really a procedure which gives no actual
returns, but does something, you would then need to use the global
variable definition eg

Plot(C,"",colorWhite,styleBar);

procedure trendCheckup(StudyID)
{
global ass;
Linup = Study(StudyID,GetChartID());
TLBUP = Cross(C,Linup);
PlotShapes( TLBUP*shapeUpArrow,colorBrightGreen,0,L,-20);
ass = TLBUP;
}

trendCheckup("XY");
Title = Name()+" "+ ass ;

hope this helps
--
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



On 10/13/05, coba702002 <coba702002@xxxxxxxxx> wrote:
> This function Plots the arrow fine, so in theory the TLBUP should
> equal 1 based on a cross of the study line. However when i try and
> pass that value out I do not get a 1... its empty.
>
> function trendCheckup(StudyID)
> {
> global ASS;
> global TLBUp;
> Linup = Study(StudyID,GetChartID());
> TLBUP = Cross(CCI(14),Linup);
> PlotShapes( IIf
> ((TLBUP),shapeUpArrow,shapeNone),colorDarkGreen,0,Graph0,Offset=20);
> ASS = IIf(Cross(CCI(14),Linup),1,0);
> return TLBUP;
>
> }
>
> if i assign 'ass' a number it gets passed out fine... ie 'ass'=5
>
> function trendCheckup(StudyID)
> {
> global ASS;
> global TLBUp;
> Linup = Study(StudyID,GetChartID());
> TLBUP = Cross(CCI(14),Linup);
> PlotShapes( IIf
> ((TLBUP),shapeUpArrow,shapeNone),colorDarkGreen,0,Graph0,Offset=20);
> //ASS = IIf(Cross(CCI(14),Linup),1,0);
> ass=5
> return ass;
>
> }
>
> However if i assign 'ass' the cross code im back to getting nadda
> again
>
> function trendCheckup(StudyID)
> {
> global ASS;
> global TLBUp;
> Linup = Study(StudyID,GetChartID());
> TLBUP = Cross(CCI(14),Linup);
> PlotShapes( IIf
> ((TLBUP),shapeUpArrow,shapeNone),colorDarkGreen,0,Graph0,Offset=20);
> ASS = IIf(Cross(CCI(14),Linup),1,0);
> return ASS;
>
> }
>
> What gives?
>
> using ami 4.73
>
>
>


------------------------ 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/