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

[amibroker] Re: Function Performance Pattern



PureBytes Links

Trading Reference Links

Missing brackets for the array references, maybe?

TitlePP[0]+TitlePP[1]+TitlePP[2]

--- In amibroker@xxxxxxxxxxxxxxx, "monriri2" <lamottefranck@xxx> 
wrote:
>
> With the follow function I try to test performance pattern for 3/5 
> and 8 periodes to obtain something like this for example:
> 
> #pattern : 52 (patterns found)  Per : 3 (back period)  5,1 (avg % 
> gain)  52 ( % win trade)
> 
> 
> function PP(Pattern) {// function Performance Pattern
> P1=3;Step=5;i=0;
> 
> But I have the message "error 29 variable TitlePP0 used without 
> having been initialized". I don't understand where is the problem
> 
> for( i = 0 ; i <= 2; i++ )  
> { 
> back=P1+(i*Step);
> NumPattern   	= LastValue(Cum(Pattern));
> base[i]   		= Ref(C,-back);
> NextBar[i]		= Ref(Pattern,-back);
> Result[i] 		= IIf(NextBar[i],(C-base[i])/base[i]*100,0);
> ResultTOT[i] 	= LastValue(Cum(Result[i]));
> ResultMOY[i] 	= Nz(100*ResultTOT[i]/NumPattern);
> UpTrade[i] 	= Result[i] >0;
> DnTrade[i] 	= Result[i]<=0;
> NumUpTrade[i]	= LastValue(Cum(UpTrade[i]));
> NumDnTrade[i]	= LastValue(Cum(DnTrade[i]));
> PatternWin[i]	= Nz(100*NumUpTrade[i]/(NumUpTrade[i]+NumDnTrade[i]));
> TitlePP[i] = 
> "Per :   "+NumToStr(Back,1.0)+
> "Result MOY : "+NumToStr(ResultMOY[i],1.1);
> "% Win :      "+NumToStr(PatternWin[i],1.1)+"  ";
> } // FIN for( i = 0 ; i <= 2; i++ )  
> 
> Titre= "#Patterns : "+NumToStr(NumPattern,1.0)
> +TitlePP0+TitlePP1+TitlePP2;
> return titre ; } // fin fonction PP
>



------------------------------------

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL 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

*********************************
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

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