[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




<FONT face=Arial color=#0000ff 
size=2>Gilles,
<FONT face=Arial color=#0000ff 
size=2> 
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 .........
<FONT face=Arial color=#0000ff 
size=2> 
<FONT 
face=Arial> 
Plot<FONT color=#282828 
size=2>(MACD<FONT color=#282828 
size=2>(),"MACD"<FONT color=#282828 
size=2>,1<FONT color=#282828 
size=2>,1<FONT color=#282828 
size=2>);
Plot<FONT color=#282828 
size=2>(Signal<FONT color=#282828 
size=2>(),"Signal"<FONT color=#282828 
size=2>,4<FONT color=#282828 
size=2>,1<FONT color=#282828 
size=2>);
Plot<FONT color=#282828 
size=2>(0<FONT color=#282828 
size=2>,""<FONT color=#282828 
size=2>,<FONT 
color=#000000>colorWhite<FONT 
color=#282828 size=2>,1<FONT 
color=#282828 size=2>|<FONT 
color=#000000>styleThick<FONT color=#282828 
size=2>);<FONT face=Arial color=#282828 
size=2>
x1=<FONT 
size=2>Signal()<FONT face=Arial 
size=2>>0<FONT 
color=#0000ff>;
x2=<FONT face=Arial 
size=2>Signal()<<FONT face=Arial 
size=2>0<FONT 
color=#0000ff>;
COND1=<FONT 
size=2>Cross(Signal<FONT 
size=2>(),MACD<FONT 
face=Arial color=#0000ff>());
Buy=x1 <FONT face=Arial 
size=2>AND Cond1;<FONT 
face=Arial size=2>
Sell=x2;<FONT 
face=Arial size=2>
Buy=<FONT face=Arial 
color=#0000ff size=2>ExRem<FONT face=Arial color=#282828 
size=2>(Buy<FONT face=Arial color=#282828 
size=2>,Sell<FONT face=Arial color=#282828 
size=2>);
Sell=<FONT face=Arial 
color=#0000ff size=2>ExRem<FONT face=Arial color=#282828 
size=2>(Sell<FONT face=Arial color=#282828 
size=2>,Buy<FONT face=Arial color=#282828 
size=2>);
Filter=<FONT face=Arial 
size=2>Buy;<FONT 
color=#0000ff size=2>
AddColumn<FONT 
color=#282828 size=2>(<FONT 
color=#000000>Buy<FONT color=#282828 
size=2>,"Condition"<FONT 
color=#282828 size=2>);<FONT color=#0000ff 
size=2>
AddColumn<FONT 
color=#282828 size=2>(<FONT 
color=#000000>C<FONT color=#282828 
size=2>,"Cosing price"<FONT 
color=#282828 size=2>);
<FONT 
face=Arial color=#0000ff size=2> 
 
 
Regards, 
Jayson 
<FONT face=Tahoma 
size=2>-----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: <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 Yahoo! Terms of 
Service.Send 
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.