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

RE: [amibroker] Re: Second time around - a question and a possible bug. Tomasz??



PureBytes Links

Trading Reference Links




Gary,
 
This changes the results, but doesn't solve the problem 
completely.
 
On 2/27/02, the RSI crosses below 30 and so the system buys on 
2/28/02 like it should.  The RSI then rises above 30, but the Close is not 
high enough over the next couple days to make the Sell condition be True.  
Then on 3/2/01, the RSI falls below 30 again.  Since the system is already 
in the middle of a trade, there is not another buy signal, which is what I 
want.  
 
But the code now exits when the close is higher than what the 
entry would have been on the 2nd (potential) signal instead of what the entry 
really was on the first (real) signal.  The system exits at a loss, when I 
want to always wait until there is a profit before exiting.
 
Linda  
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Gary 
  A. Serkhoshian 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: June 22, 2004 8:37 PM
  Subject: Re: [amibroker] Problem with 
  Extraneous Buy Signals
  Linda,The problem is that Cond1 = 
  RSI(14)<30is always true when RSI is below 30.  All you want 
  isthe cross.  So, use Cross(30, RSI(14)) 
  instead.Regards,Gary--- Linda Wilmarth <<A 
  href="">smart@xxxxxxxxxx> wrote:> I am 
  having problems with a system that I am> writing.  > 
  > I have simplified it to the basics for testing> 
  purposes.  At this point, I am testing the system> using EOD data 
  for QQQ only.  > > The system will buy at the next Open if 
  the 14-day> RSI is less than 30.  Then I want to sell at 
  the> first close where I have made a profit, which may> even be 
  the same day that I buy.> > The code works fine if the RSI drops 
  below 30 for 1> day only, e.g. it buys and sells on 4/17/00, and 
  it> buys on 4/29/02 and sells on 4/30/02.  > > But 
  if the RSI stays below 30 for more than 1 day,> the code does not 
  work.  For example, the RSI drops> below 30 on 10/10/00 and the 
  system correctly buys> on 10/11/00.  It should sell on the same 
  day> (10/11/00) because there would have been a small> profit 
  that day.  But it does not - the RSI is also> less than 30 on 
  10/11/00 and the code does not> produce the desired results.  It 
  waits until> 10/12/00 to sell.  Then it buys again on 
  10/12/00,> which it should since the RSI on 10/11 was less than> 
  30, but does not sell until 2/28/01, when it should> have sold the next 
  day on 10/13/00.> > I've included the code below.  Anyone 
  have an idea> what I am doing wrong?> > Thanks> 
  > Linda> > Var0 = 1;> > SetOption 
  ("InitialEquity", 100000); > > SetOption ("MaxOpenPositions", 
  Var0);> > PositionSize = -100/Var0; // to compound 
  results> > BuyPrice = Open;> > SellPrice = 
  Close;> > SetTradeDelays ( 1, 0, 1, 1); // buy, sell, 
  short,> cover> > // 
  BUY>--------------------------------------------------------------> 
  > > Cond1 = RSI(14)<30;> > Buy = Cond1 
  ;> > // 
  SELL>--------------------------------------------------------------> 
  > > Cond102 = Close > 
  Ref(BuyPrice,-BarsSince(Buy)+1);> > Sell = Cond102 ; > 
  > Buy = ExRem (Buy, Sell);> > Sell = ExRem (Sell, 
  Buy);> >       
        __________________________________Do 
  you Yahoo!?New and Improved Yahoo! Mail - Send 10MB messages!<A 
  href="">http://promotions.yahoo.com/new_mail 
  Check AmiBroker web page at:<A 
  href="">http://www.amibroker.com/Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  


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

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html








Yahoo! Groups Sponsor


  ADVERTISEMENT 












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 the Yahoo! Terms of Service.