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

[amibroker] creating sectors



PureBytes Links

Trading Reference Links

thanks
then something with my computer must be wrong 
i will check 
cheers 
Michael

--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
<TSOKAKIS@xxxx> wrote:
> Here is an example.
> What do you see wrong ?[except the severe losses]
> 
> Settings 
>   
> Initial Equity: 10000  Periodicity/Positions: Daily/Long Short 
> Commissions: 0.50 %  Annual interest rate: 0.00% 
> Range: All quotations  Apply to: Current Symbol 
> Margin requirement: 100  Futures mode: No 
> Def. round lot size: 0  Def. Tick Size 0 
> Drawdowns based on: Open prices      
> Long trades 
> Buy price: Open  Sell price: Open 
> Buy delay: 1  Sell delay: 1 
> Short trades 
> Short price: Open  Cover price: Open 
> Short delay: 1  Cover delay: 1 
> Stops 
> Maximum loss: disabled  Profit target: disabled 
> Value: 10.00  Value: 20.00 
> Exit at stop? yes  Exit at stop? no 
>   
> Trailing stop: disabled      
> Value: 10.00      
> Exit at stop? yes      
> 
> Formula 
> 
> 
>  /*Fisher Transform*/ 
> price=(H+L)/2; 
> Length=Optimize("length",10,2,21,1); 
> MaxH=HHV(price,Length); 
> MinL=LLV(price,Length); 
> Value=C; 
> fish=C; 
> for (i=1;i<BarCount;i++) { 
> Value1[0]=0; 
> Fish[0]=0; 
> Value1[i]=0.33*2*((price[i]-MinL[i])/(MaxH[i]-MinL[i])-0.5) 
> +0.67*Value1[i-1]; 
> if (Value1[i]>0.99)  
> { 
> Value1[i]=0.999; 
> } 
> if (Value1[i]<-0.99)  
> { 
> Value1[i]=-0.99; 
> } 
> Fish[i]=0.5*log((1+Value1[i])/(1-Value1[i]))+0.5*Fish[i-1]; 
> } 
> Trigger=Ref(Fish,-1); 
> Buy=Cross(Fish,Trigger); 
> Sell=Cross(Trigger,Fish); 
> Short=Sell;Cover=Buy; 
> Plot(Fish,"Fisher Transform",3,1); 
> Plot(Ref(Fish,-1),"Trigger",5,1);
> 
> Overall performance summary 
>   
> Total net profit: -9773.75   Total commissions paid: 4993.49 
> Return on account: -97.74 %    Open position gain/loss 4.12 
> Buy&Hold profit: -6205.00   Bars (avg. days) in test: 1133 (1649) 
> Buy&Hold % return: -62.05%   System to Buy&Hold index: -57.51% 
>   
> Annual system % return: -56.77%   Annual B&H % return: -19.30% 
>   
> System drawdown: -9780.02   B&H drawdown: -7828.14 
> Max. system drawdown: -10779.44   B&H max. drawdown: -10344.98 
> Max. system % drawdown: -98.00%   B&H max. % drawdown: -82.57% 
> Max. trade drawdown: -937.82       
> Max. trade % drawdown: -18.98%       
> Trade drawdown: -696.12       
>   
> Total number of trades: 225   Percent profitable: 30.7% 
> Number winning trades: 69   Number losing trades: 156 
> Profit of winners: 6045.25   Loss of losers: -15825.27 
> Total # of bars in winners: 612   Total # of bars in losers: 736 
> Commissions paid in winners: 1529.76   Commissions paid in losers: 
> 3463.74 
>   
> Largest winning trade: 586.71   Largest losing trade: -795.28 
> # of bars in largest winner: 9   # bars in largest loser: 3 
> Commission paid in largest winner: 103.20   Commission paid in 
> largest loser: 99.16 
>   
> Average winning trade: 87.61   Average losing trade: -101.44 
> Avg. # of bars in winners: 8.9   Avg. # bars in losers: 4.7 
> Avg. commission paid in winner: 22.17   Avg. commission paid in 
> loser: 22.20 
> Max consec. winners: 4   Max consec. losers: 8 
>   
> Bars out of the market: 6   Interest earned: 0.00 
>   
> Exposure: 99.5%   Risk adjusted ann. return: -57.07% 
> Ratio avg win/avg loss: 0.86   Avg. trade (win & loss): -43.47 
> Profit factor: 0.38     
> 
> 
> Performance for ^NDX  
>   
> Total net profit: -9773.75   Total commissions paid: 4993.49 
> Return on account: -97.74 %    Open position gain/loss 4.12 
> Buy&Hold profit: -6205.00   Bars (days) in test: 1133 (1649) 
> Buy&Hold % return: -62.05%   System to Buy&Hold index: -57.51% 
>   
> Annual system % return: -56.77%   Annual B&H % return: -19.30% 
>   
> System drawdown: -9780.02   B&H drawdown: -7828.14 
> Max. system drawdown: -10779.44   B&H max. drawdown: -10344.98 
> Max. system % drawdown: -98.00%   B&H max. % drawdown: -82.57% 
> Max. trade drawdown: -937.82       
> Max. trade % drawdown: -18.98%       
> Trade drawdown: -696.12       
>   
> Total number of trades: 225   Percent profitable: 30.7% 
> Number winning trades: 69   Number losing trades: 156 
> Profit of winners: 6045.25   Loss of losers: -15825.27 
> Total # of bars in winners: 612   Total # of bars in losers: 736 
> Commissions paid in winners: 1529.76   Commissions paid in losers: 
> 3463.74 
>   
> Largest winning trade: 586.71   Largest losing trade: -795.28 
> # of bars in largest winner: 9   # bars in largest loser: 3 
> Commission paid in largest winner: 103.20   Commission paid in 
> largest loser: 99.16 
>   
> Average winning trade: 87.61   Average losing trade: -101.44 
> Avg. # of bars in winners: 8.9   Avg. # bars in losers: 4.7 
> Avg. commission paid in winner: 22.17   Avg. commission paid in 
> loser: 22.20 
> Max consec. winners: 4   Max consec. losers: 8 
>   
> Bars out of the market: 6   Interest earned: 0.00 
>   
> Exposure: 99.5%   Risk adjusted ann. return: -57.07% 
> Ratio avg win/avg loss: 0.86   Avg. trade (win & loss): -43.47 
> Profit factor: 0.38 
> 
> Dimitris Tsokakis
> --- In amibroker@xxxxxxxxxxxxxxx, "mhtrading2003" 
> <hennigmichael@xxxx> wrote:
> > profit ans loss wich means the profit cullumn
> > Michael
> > --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
> > <TSOKAKIS@xxxx> wrote:
> > > What is this p&l ?
> > > Dimitris Tsokakis
> > > --- In amibroker@xxxxxxxxxxxxxxx, "mhtrading2003" 
> > > <hennigmichael@xxxx> wrote:
> > > > hello 
> > > > did you check the p&l, becaus i got strange results in the 
p&l .
> > > > 
> > > > regards
> > > > Michael
> > > > --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
> > > > <TSOKAKIS@xxxx> wrote:
> > > > > Michael,
> > > > > I did not see any problem plotting or 
optimizing/backtesting 
> > your 
> > > > > code.
> > > > > BTW, the system suffers from SEVERE losses [for ANY Length 
> > > > value] !!!
> > > > > I hope you will not apply it !!
> > > > > Dimitris Tsokakis
> > > > > --- In amibroker@xxxxxxxxxxxxxxx, "mhtrading2003" 
> > > > > <hennigmichael@xxxx> wrote:
> > > > > > Hello graham
> > > > > > when I use the following code the indicator is displaed 
> > correct,
> > > > > > but when backtesting there are stange results it looks 
like 
> > that
> > > > > > the array is to short and the p&l is not correct
> > > > > > 
> > > > > >  /*Fisher Transform*/
> > > > > > 
> > > > > > price=(H+L)/2;
> > > > > > Length=Optimize("length",10,1,21,1);
> > > > > > MaxH=HHV(price,Length);
> > > > > > MinL=LLV(price,Length);
> > > > > > Value=C;
> > > > > > fish=C;
> > > > > > 
> > > > > > 
> > > > > > for (i=1;i<BarCount;i++) {
> > > > > > Value1[0]=0;
> > > > > > Fish[0]=0;
> > > > > > 
> > > > > > Value1[i]=0.33*2*((price[i]-MinL[i])/(MaxH[i]-MinL[i])-
0.5)
> > > > > > +0.67*Value1[i-1];
> > > > > > 
> > > > > > if (Value1[i]>0.99) {
> > > > > > Value1[i]=0.999;
> > > > > > }
> > > > > > 
> > > > > > if (Value1[i]<-0.99) {
> > > > > > Value1[i]=-0.99;
> > > > > > }
> > > > > > Fish[i]=0.5*log((1+Value1[i])/(1-Value1[i]))+0.5*Fish[i-
1];
> > > > > > }
> > > > > > 
> > > > > > Trigger=Ref(Fish,-1);
> > > > > > 
> > > > > > Buy=Cross(Fish,Trigger);
> > > > > > Sell=Cross(Trigger,Fish);
> > > > > > Cover=Buy;
> > > > > > Short=Sell;
> > > > > > 
> > > > > > Plot(Fish,"Fisher Transform",3,1);
> > > > > > Plot(Ref(Fish,-1),"Trigger",5,1);
> > > > > > 
> > > > > > cheers
> > > > > > Michael
> > > > > > 
> > > > > > --- In amibroker@xxxxxxxxxxxxxxx, "Graham" 
<gkavanagh@xxxx> 
> > > > wrote:
> > > > > > > Not certain what you mean
> > > > > > > Barcount is the count of the number of bars in your 
> chart. 
> > It 
> > > > is 
> > > > > > same as
> > > > > > > saying Lastvalue(cum(1)) or Lastvalue(Barindex()+1)
> > > > > > > So the line
> > > > > > > for (i=1;i<BarCount;i++)
> > > > > > > looks at the 2nd bar (1st bar is zero) to the last bar 
of 
> > the 
> > > > > data.
> > > > > > > 
> > > > > > > I would suggest your strange results could most likely 
be 
> > in 
> > > > the 
> > > > > > formulae
> > > > > > > you are using within the code. Can you post the full 
code?
> > > > > > > 
> > > > > > > Just looking at the line I can see I may be wrong 
above 
> > and 
> > > if 
> > > > > you 
> > > > > > have put
> > > > > > > this as a full line in the code
> > > > > > > 
> > > > > > > statement (for (i=1;i<BarCount;i++))
> > > > > > > 
> > > > > > > Then you do not use the statement part.
> > > > > > > There are examples in the help files for using the if 
for 
> > etc 
> > > > > > statements 
> > > > > > > Amibroker Formula Language - AFL Reference Manual
> > > > > > > 
> > > > > > > You do not need to define a variable or array before 
> using 
> > > it, 
> > > > > > except to
> > > > > > > define the first value
> > > > > > > 
> > > > > > > Here is one example from the help file as above
> > > > > > > myema[ 0 ] = Close[ 0 ]; 
> > > > > > > for( i = 1; i < BarCount; i++ ) 
> > > > > > > { 
> > > > > > >     myema[ i ] = 0.1 * Close[ i ] + 0.9 * myema[ i - 
1 ]; 
> > > > > > > }
> > > > > > > 
> > > > > > > Hope this helps
> > > > > > > 
> > > > > > > 
> > > > > > > Cheers,
> > > > > > > Graham
> > > > > > > http://e-wire.net.au/~eb_kavan/
> > > > > > > 
> > > > > > > -----Original Message-----
> > > > > > > From: mhtrading2003 [mailto:hennigmichael@x...] 
> > > > > > > Sent: Friday, July 09, 2004 2:46 PM
> > > > > > > To: amibroker@xxxxxxxxxxxxxxx
> > > > > > > Subject: [amibroker] Re: number of bar limit for using 
> for 
> > > > > > statement
> > > > > > > 
> > > > > > > --- In amibroker@xxxxxxxxxxxxxxx, "mhtrading2003" 
> > > > > > > <hennigmichael@xxxx> wrote:
> > > > > > > > Hello,
> > > > > > > > 
> > > > > > > > does anybody know if there is a number of bar limit 
for 
> > > > > > > using "for" 
> > > > > > > > statement (for (i=1;i<BarCount;i++))
> > > > > > > > because I get strange results when backtesting with 
a 
> > > > formula 
> > > > > > > using 
> > > > > > > > this for statement.or is there a function lile dim 
in 
> > basic?
> > > > > > > > 
> > > > > > > > regards 
> > > > > > > > Michael
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > Check AmiBroker web page at:
> > > > > > > http://www.amibroker.com/
> > > > > > > 
> > > > > > > Check group FAQ at:
> > > > > > > 
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > > > > > > Yahoo! Groups Links



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/