PureBytes Links
Trading Reference Links
|
This is part of a 40 day long iif( coding that seems to do the
job, but I was hoping for something more elegant and simple. I
can change the false condition of #0 to a true condition of #1 at any
of the Day levels that I want. If I decide that I don't want a true
result till I get past 20 days, then starting at day 21 and up, I have to change
all of the zeros to ones, I can also make x any thing that I want. In
this case, it is an exponential moving average.
I thought that if loops or some kind of AFL function may be
a better way to lookback at each individual bar for many days, then I
would be able to finally learn how looping works by knowing what the looping
code is supposed to
do.
I will try to make sense of Graham' loop example. Maybe this sample that I
have coded of an iif way to do the lookback will make it a little more clear
what I am attempting to do. Ron D
x=EMA<FONT
face="Bookman Old Style" size=4>(<FONT face="Times New Roman"
size=4>OBVsqz3to15,<FONT
face="Bookman Old Style" color=#ff00ff size=4>20<FONT
face="Bookman Old Style" size=4>);
Day6=IIf(x<<FONT
color=#0000ff size=4>Ref(x,-<FONT color=#ff00ff
size=4>7),Day7,<FONT color=#ff00ff
size=4>0);
Day5=IIf<FONT
size=4>(x<Ref<FONT
size=4>(x,-6<FONT
size=4>),Day6,0);
Day4=IIf<FONT
size=4>(x<Ref<FONT
size=4>(x,-5<FONT
size=4>),Day5,0);
Day3=IIf<FONT
size=4>(x<Ref<FONT
size=4>(x,-4<FONT
size=4>),Day4,0);
Day2=IIf<FONT
size=4>(x<Ref<FONT
size=4>(x,-3<FONT
size=4>),Day3,0);
Day1=IIf<FONT
size=4>(x<Ref<FONT
size=4>(x,-2<FONT
size=4>),Day2,0);
Day0=IIf(x<FONT
face="Bookman Old Style" size=4>><FONT face="Bookman Old Style"
color=#ff00ff size=4>1.05<FONT face="Bookman Old Style"
size=4>*Ref<FONT
size=4>(x,-1<FONT
size=4>),Day1,0<FONT
size=4>);
Buy=Day0;
<FONT
face=Arial>=============================================================
<BLOCKQUOTE dir=ltr
>
----- Original Message -----
<DIV
>From:
Anthony Faragasso
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Thursday, February 19, 2004 6:23
PM
Subject: Re: [amibroker] Re:
IsNotThere(Array or Ref(Array,-1) or Ref(Array,-1) or
Ron,
What would be the Array condition ?
Anthony
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
mrdavis9
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Thursday, February 19, 2004 6:48
PM
Subject: Re: [amibroker] Re:
IsNotThere(Array or Ref(Array,-1) or Ref(Array,-1) or
I am going to code an exploration that
looks back over the last 25 daily bars to see if an Array condition
has been met on ALL of the last 25 bars. If it fails to
find that ALL of the last 25 bars are true, it will then look for 24
true bars, then 23 true bars, and so on till it finally quits looking at
about 10 bars back. I can code this with lots of
repititons of coding, but I would like to find a more elegant way to code
it.
I was unable to divise a way to do this with Sum() or
Cum(). Is there any other simple way to code this?
If loops is the way to go, then I would sure
appreciate seeing this coded with loops. I learn best by seeing a
working example of something that I am attempting to
do. TIA Ron D
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
johsun
To: <A
title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Wednesday, February 18, 2004
11:42 AM
Subject: [amibroker] Re:
IsNotThere(Array or Ref(Array,-1) or Ref(Array,-1) or
cond=Your conditionx=Sum(cond,4)>=1;this
will return True if cond has occurred in the last four days including
today. Is that what you wanted?JS--- In <A
href="">amibroker@xxxxxxxxxxxxxxx,
"mrdavis9" <mrdavis9@x...>
wrote:> Below is coding that allows the Seq10e2up2e10 OR
SeqR14toR14e15 conditions to have occurred upto three days before the
RSIEMA2cross occurs. Is there a lot more elegant and simple way
to do this?> > An IsNotThere(Array) would do what I
want. Is there one that I missed that can be made to work.
I still have not been able to grasp doing loops. If looping is a
good way to do this, I would sure appreciate seeing the below IIF
coding made into a looping function. Then, by knowing what it is
designed to do, I should be able to finally understand how looping
works. Ron D> > Day3a=IIf(Ref(Seq10e2up2e10 OR
SeqR14toR14e15,-3),1,0);> > Day3=IIf(Ref(Seq10e2up2e10 OR
SeqR14toR14e15,-3),1,0);> > Day2a=IIf(Ref(Seq10e2up2e10 OR
SeqR14toR14e15,-1),1,day3a);> > Day2=IIf(Ref(Seq10e2up2e10
OR SeqR14toR14e15,-2),Day3,0);> >
Day1a=IIf(Ref(Seq10e2up2e10 OR SeqR14toR14e15,-1),Day2,Day2a);>
> Day1=IIf(Ref(Seq10e2up2e10 OR SeqR14toR14e15,-1),Day2,0);>
> Day0a=IIf(Seq10e2up2e10 OR SeqR14toR14e15,Day1,Day1a);>
> Day0=IIf(RSIEMA2cross,Day0a,0);Send BUG REPORTS
to bugs@xxxxxxxxxxxxxSend
SUGGESTIONS to <A
href="">suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: <A
href="">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
Yahoo! Groups Links<*> To visit your group on the web,
go to: <A
href="">http://groups.yahoo.com/group/amibroker/<*>
To unsubscribe from this group, send an email
to: <A
href="">amibroker-unsubscribe@xxxxxxxxxxxxxxx<*>
Your use of Yahoo! Groups is subject to: <A
href="">http://docs.yahoo.com/info/terms/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
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
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
Yahoo! Groups Sponsor
ADVERTISEMENT
Click Here
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.
|