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

[amibroker] Re: Newbie Programming Assistance



PureBytes Links

Trading Reference Links

For the half of the 2500 occurrences of a Cross( FLSD, 50 ) , the 
near Cross( Close, MA( Close, 20 ) ) was 0, 1 or 2 bars.
Explore with
Filter=Cross( FLSD, 50 ) ;
AddColumn(BarsSince(Cross(Close,MA(Close,20))),"");
This means that we may have more trades with
Buy = Cross( FLSD, 50 ) AND BarsSince(Cross( Close, MA( Close, 20 ) ))
<=2;
Sell = Cross( RSI( 14 ), 70 );
We have indeed 319 trades, instead of 113.
With 
Sell=Cross( RSI( 14 ), 65 );
we go to 551 trades, but, the system begins to loose money [-12%].
A closer look is more descriptive :
As the time goes by, the system looses money : watch the optimization
Buy = Cross( FLSD, 50 ) AND BarsSince(Cross( Close, MA( Close, 20 ) ))
<=2;
k=Optimize("k",3,3,30,1);
Sell=Ref(Buy,-k);
On the other side, the optimization
Buy = Cross( FLSD, 50 ) AND Cross( Close, MA( Close, 20 ) );
k=Optimize("k",3,3,50,1);
Sell=Ref(Buy,-k);
is almost flat from k=3 to 50.
It means that any condition after the Buy, in the next 50 bars will 
not give interesting profits.
I do not see for the moment any improvement.
DT
--- In amibroker@xxxxxxxxxxxxxxx, "bdsko" <bdsaqa6@xxxx> wrote:
> Thanks for the prompt reply Dimitris
> 
> Bruce
> --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
<TSOKAKIS@xxxx> 
> wrote:
> > the conditions are OK. The trades are not many. 113 for the whole 
> > N100 group since Jan2000. 22 stocks did not meet the criteria at 
> all.
> > Maximum # of trades was 3 for 4 stocks.
> > AMZN was good...
> > No trades from Jan2000 till Oct2001 and then 3 nice Long trades 
> with 
> > an +120% profit. The system was waiting AMZN all the bearish 
period 
> > patiently...
> > DT
> > --- In amibroker@xxxxxxxxxxxxxxx, "bdsko" <bdsaqa6@xxxx> wrote:
> > > Greetings
> > > 
> > > I had a previous post in which I requested assistance for the 
AFL 
> > > that would create the following:
> > > 
> > > Price = 20/40
> > > Stochastics = 14/4/5
> > > RSI = 14
> > > 
> > > The rules were to buy when the stochastics break above 50 & the 
> > price 
> > > clearly breaks above its 20 day EMA.
> > > 
> > > The sell was generated when the RSI breaks below 70. 
> > > 
> > > The code that I am using is below:
> > > 
> > > pds = 14;
> > > slw = 4;
> > > slwd = 5;
> > > // Fast Stoch
> > > FSK = 100*(C-LLV(L,pds))/(HHV(H,pds)-LLV(L,pds)); 
> > > // Slow Stoch %K
> > > FLSK = MA( FSK, slw );  
> > > // Slow Stoch %D
> > > FLSD = MA( FLSK, slwd ); 
> > > 
> > > Buy = Cross( FLSD, 50 ) AND Cross( Close, MA( Close, 20 ) );
> > > 
> > > Sell = Cross( RSI( 14 ), 70 );
> > > 
> > > The back test results are inconsistent when I compare it aginst 
> > > backtesting with the data feed which is FT.
> > > Any suggestions on how I might modify the code is greatly 
> > appreciated.
> > > 
> > > Tx,
> > > 
> > > Bruce


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Your own Online Store Selling our Overstock.
http://us.click.yahoo.com/rZll0B/4ftFAA/46VHAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/