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

Re: [amibroker] RE: Please Help, What wrong with this codes



PureBytes Links

Trading Reference Links

hi wongloktim,

try this now..

_SECTION_BEGIN( "Z Trailing Stop");
SetChartOptions( 0,chartShowArrows|chartShowDates );
_N(Title = FullName()+StrFormat(" {{NAME}} - {{INTERVAL}} {{DATE}}
Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C,
SelectedValue( ROC( C, 1 ) ) ));
Plot( C,"Price",colorBlack,64 );

function HigherLow(Bars, Price)
{
HLow=Price;
HLowArr=Null;
if(Bars>0 AND bars<BarCount)
{
for(i=bars+1; i<BarCount;i++)
{
if(Low[i] >= HLow)
{
HLow=Low[i];
HLowArr[i]=HLow;
}
else
HlowArr[i]=HLow;
}
}
return HlowArr;
}
Start = SelectedValue( BarIndex( ));
Price=ValueWhen( BarIndex( )==start, L,1);
Test=HigherLow( Start,Price) ;
Plot(IIf(start, Test,Null) ,"StopLoss" ,colorRed, 4);
_SECTION_END( );

and copy paste carefully.

this has only taken five minutesof me


now enjoy

cheers

wongloktim <wlt@xxxxxxxxxxxxxx> wrote:
It Return nothing

SECTION_BEGIN("Z Trailing Stop");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = FullName()+StrFormat(" {{NAME}} - {{INTERVAL}} {{DATE}}
Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C,
SelectedValue( ROC( C, 1 ) ) ));
Plot( C,"Price",colorBlack,64 );

function HigherLow(Bars,Price)
{
HLow=Price;
HLowArr=Null;
if(Bars>0 AND bars<BarCount)
{
for(i=bars+1; i<BarCount;i++)
{
if(Low[i] >= HLow)
{
HLow=Low[i];
HLowArr[i]=HLow;
}
else
HlowArr[i]=HLow;
}
}
return HlowArr;
}
Start = SelectedValue(BarIndex());
Price=ValueWhen(BarIndex()==start,L,1);
Test=HigherLow(Start,Price);
Plot(IIf(start,Test,Null),"StopLoss",colorRed,4);
_SECTION_END();



Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. __._,_.___

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___