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

RE: [amibroker] Re: Exrem - Buy Only



PureBytes Links

Trading Reference Links




<SPAN 
class=580292014-14122003>Hi Ed,
<SPAN 
class=580292014-14122003> 
<SPAN 
class=580292014-14122003>How about this:
<SPAN 
class=580292014-14122003> 
<SPAN 
class=580292014-14122003>    Buy = Cross(Ref(LLV(L,y),-1), 
L);
<SPAN 
class=580292014-14122003> 
<SPAN 
class=580292014-14122003>Cross only returns true when the first value goes ABOVE 
the second, not above or equal to the second, so it's not exactly the same as 
your code, but it's simple and clean, and I think gets at your basic 
issue.
<SPAN 
class=580292014-14122003> 
<SPAN 
class=580292014-14122003>I think (;-)
<SPAN 
class=580292014-14122003> 
<SPAN 
class=580292014-14122003>Dave
<SPAN 
class=580292014-14122003> 
<BLOCKQUOTE 
>Dave, 
  Graham, Phsst, et al - thanks for your help.My reason for the orignial 
  ExRem question was because the 10 day Pullback strategy is a Long only 
  strategy - Sells and Shorts are not part of my needs in this case.  
  I'll use my own Stops and exits.I only wanted Buy signals at the Buy = 
  L <= Ref(LLV(L,y),-1.   Without ExRem, I get those multiple 
  signals on the chart, and it just adds "noise" and confusion (at least to 
  me).  And without a Sell/Cover statement, ExRem doesn't 
  work.I originally used ExRem and just ignored the Sell 
  arrows.Below is all of the original code that worked - I may just 
  stick to this!!!!y=10;Sell = H >= 
  Ref(HHV(H,y),-1);Buy = L <= 
  Ref(LLV(L,y),-1);Short=Sell;Cover = 
  Buy;Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);Short=ExRem(Short,Cover);Cover=ExRem(Cover,Short);Filter= 
  Close > 2 AND ( Buy OR Sell ) ;AddTextColumn( FullName(), "Full name", 
  77 , colorDefault, IIf( Close < 10, colorLightBlue, colorDefault ) 
  );AddColumn (Close, 
  "Close");AddColumn(IIf(Buy,1,IIf(Short,-1,0)),"Signal",1.0);AddColumn(RSI(14),"RSI",1.2);Thanks 
  to all for your help.Ed--- In amibroker@xxxxxxxxxxxxxxx, 
  "Dave Merrill" <dmerrill@xxxx> wrote:> MessageYes, of course, 
  you're right. Even if the backtester removes> redundant signals before 
  atually trading, if your code needs to know when> the last entry 
  happened, or the BuyPrice at that time, etc., you need to> remove 
  them yourself before looking for those kinds of infos.> > 
  Dave>   The one main area where the additional buy signals 
  cause a problem is when> your sell is related to the buy signal 
  either by time or price. The sell> will recognise the additional 
  buy signals and reset its calculation based on> that. This can 
  cause the sell to move further out, or in event of applystop> could 
  bring it sooner, than would otherwise be the case. This would make> 
  your backtesting produce unreal results. Of course this would not be 
  the> case if you use the additional buy signals within your trade 
  plan.> >    Cheers,>   
  Graham>   <A 
  href="">http://groups.msn.com/asxsharetrading>   
  <A 
  href="">http://groups.msn.com/fmsaustralia>     
  -----Original Message----->     From: Dave Merrill 
  [mailto:dmerrill@xxxx]>     Sent: Sunday, 14 
  December 2003 8:03 PM>     To: 
  amibroker@xxxxxxxxxxxxxxx>     Subject: RE: 
  [amibroker] Re: Exrem - Buy Only> > 
  >     Are you saying that you've actually seen the 
  backtester take more than> one consecutive buy or sell on the same 
  stock in a row, without an> intervening opposite signal?!? I haven't, 
  ever. I suppose it's possible I> didn't notice a rare exception, 
  but I bet someone would have.> >     Or 
  maybe you've seen the backtester take a signal other than the 
  first> of consecutive signals in the same direction? That I'm less 
  certain I> haven't seen, but I am quite sure I'd call that a bug. 
  Is that not so? Can> you point me to somewhere in the docs or 
  something Tomasz has said that> indicates otherwise? Where 
  ExRem-ing trade signals is said to be *required*> for proper 
  operation? I'd think that would be an important piece of info to> 
  mention, say, in the docs for ExRem.> >     
  One piece of evidence that the backtester does this, and is supposed 
  to,> is in the docs for the Equity function, describing the behavior of 
  Flag (1st> parameter) value 1:> 
  >     "works as 0 but additionally updates 
  buy/sell/short/cover arrays so all> redundant signals are removed 
  exactly as it is done internally by the> backtester plus all exits 
  by stops are applied so it is now possible to> visualise 
  ApplyStop() stops."> >     
  Dave>       <which the backtester does 
  automatically anyway>> >       
  Dave,> >       I'm pretty sure 
  that the backtester does NOT automatically do as you> say.> 
  >       I've spent quite a lot of time 
  working with the backtester, 
  and>       determined that I *ALWAYS* 
  need to perform the ExRem functions 
  myself>       in order to have absolute 
  control over the last Buy, Sell, Short 
  &>       Cover signals.> 
  >       Whether I'm right or wrong, by 
  taking absolute control over 
  these>       signals, there is no 
  question about the sequence of events related 
  to>       these signals.> 
  >       Regards,> 
  >       PhsstSend 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT 









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