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

RE: [amibroker] Re: TJ: A question about COND function



PureBytes Links

Trading Reference Links


I suggest he run and backtest and look at the report printout.
I think you have your "buy" and "sell" signal reversed! If you run this the way it looks.Jayson <jcasavant@xxxxxxxxxxx> wrote:


Gilles,
 
lets simplify. I suggest plotting it so that you can see that what you are asking for is accomplished. to explore for the condition simply choose n=2 to find bars that meet your needs over the last (today and yesterdays)  bars. If nothing shows up on your exploration it simply means the condition has not been met . Increase the n= number to find the last occurrence .........
 
 
Plot(MACD(),"MACD",1,1);
Plot(Signal(),"Signal",4,1);
Plot(0,"",colorWhite,1|styleThick);
x1=Signal()>0;
x2=Signal()<0;
COND1=Cross(Signal(),MACD());
Buy=x1 AND Cond1;
Sell=x2;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Filter=Buy;
AddColumn(Buy,"Condition");
AddColumn(C,"Cosing price");
 
 
 
Regards, 
Jayson 
-----Original Message-----From: gillesdeprez [mailto:gillesdeprez@xxxxxxxxx]Sent: Sunday, September 14, 2003 12:18 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re: TJ: A question about COND functionHi, JaysonLet me explain what I'm trying to do:I try to set up a condition as:The MACD line crosses below the MACD signal FOR THE FIRST TIMESINCE the signal has crossed above zero.This crossing Line/signal may have take place yesterday OR the day before yesterday. That's what I want in french- or in english, sorry!But- forget the graphical point of view- I use this in explo only....And the results I've got using the formula don't take into account the second part of this formula( OR Ref( etc): I've got the same list of stocks with or without the second part of the assertion; to get the list of
 stocks with MACD/ LINE crossing that occured the day before yesterday, I must rewrite and re explore with only the second part of the condition...Of course I try to do this in one shot!Did I make myself clear?Thanks anyway for showing interest in my little challenge!Friendly,Gilles--- In amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> wrote:> Gilles,> It is doing as you ask. Note your yellow arrows all run in pairs. the first> being the actual cross then the second occurring exactly one bar after. The> second arrow coincides with the OR part of your condition........> > > > The blue circle is the cross of cond2 and the red arrow is the cross of G.> Since you  have prohibited further plotting of cond "G" until the next> occurrence of cond2 you must wait until the sig line again crosses up from> 0. to see this
 work in AA simply comment out your exrem version of cond 1> and 2, set your n last days to a couple of hundred bars and run explore. You> will see each of your yellow arrows accounted for...> > Regards,> Jayson> -----Original Message-----> From: gillesdeprez [mailto:gillesdeprez@xxxx]> Sent: Saturday, September 13, 2003 10:25 AM> To: amibroker@xxxxxxxxxxxxxxx> Subject: [amibroker] TJ: A question about COND function> > > Hi Tomasz!> Say, is there anything wrong with the following line:> COND1=Cross(Signal(),MACD())OR Ref(Cross(Signal(),MACD()),-1);> Only the first part of the proposition is taken into account, is it> forbidden to use OR into a COND function?> I join the whole formula below:> // INDICATOR BUILDER PART> Plot(MACD(),"MACD",1,1);> Plot(Signal(),"Signal",4,1);> > > COND1=Cross(Signal(),MACD())OR
 Ref(Cross(Signal(),MACD()),-1);> PlotShapes(shapeUpTriangle*COND1,colorYellow);// all COND1 before> ExRem> COND2=Cross(Signal(),0);> PlotShapes(shapeSmallCircle*COND2,colorBlue);// all COND2 before Exrem> COND1=ExRem(COND1,COND2);COND2=ExRem(COND2,COND1);> G=COND1;> PlotShapes(shapeDownArrow*G,colorRed);> // AA PART> Filter=G;> AddColumn(C,"");> Sell=Filter;> I have tried everything that was within my (weak) habilities, Tomasz,> you're my last hope *sigh*> TIA!!> Friendly,> Gilles> > >       Yahoo! Groups Sponsor>             ADVERTISEMENT> > > > > Send BUG REPORTS to bugs@xxxx> Send SUGGESTIONS to suggest@xxxx> -----------------------------------------> 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.Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 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: <A
 href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. Send BUG REPORTS to bugs@xxxxxxxxxxxxxSend 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. 
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software






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.