PureBytes Links
Trading Reference Links
|
I haven't had a close look at your code but perhaps instead of your
nested iif statements, you could use something like:
Pds = 20;
Setup1 = Ref(H<MA(H,3),-1);
Setup2 = sum(setup1,Pds)==Pds;
this checks that setup1 condition has been true for last 20
periods. Obviously just changing Pds changes the lookback period
you wish to specify.
Andrew
--- In amibroker@xxxxxxxxxxxxxxx, "mrdavis9" <mrdavis9@xxxx> wrote:
> What you see here is an attempt to create a scan that looks for
the first "up day" following a series of as many as twenty
sequential days where the high of the day was less than the three
day moving average of the high. To say it another way, this scan
is looking for up to twenty mostly down days occurring, untill an up
day finally appears (gasp). I decided to look for the H>MA(H,3) in
order to prevent the possibility of a single very small "up day"
interfearing with the general idea of finding stocks that are in a
severe free fall condition. Needless to say, I tried several ways
to get this scan to work as I wanted it to , but alas, all to no
avail. I then found that I could get it to actually run (with
obviously no hits), if I placed a zero to the left of the last
comma in the IIF statement. Example>>IIf(ref(H<MA(H,3),PAST2,0).
What I am trying to ultimately achieve is an exploration for those
conditions where a stock is in virtual freefall, and then I want to
examine the subsequent behavior of the stock after the free fall
ends. BTW, I sincerely appreciate all of the assistance provided by
Amibroker users from around the world during my recent efforts to
create my first exploration.
>
> In my first attempt to make this work, I had placed "BUY" in
place of the zero to the right of the last comma in the IIF
statement. Example>>IIF(H>MA(H,3),PAST2,buy), but it would not
work.
>
> I would really appreciate it if one of the many magnanimous
Amibroker users would be so kind as to create an exploration
version of this freefall concept that works, I think I am capable
of creating the necessary exploration report columns that I need to
analyze the results of the exploration. The rest of this email
further elucidates what I did.
>
> The below PAST(n) statements were pasted into >>SETUP=O<C AND
PAST1; and the resulting "SETUP=statement " is shown following
these commented PAST(n) statements. Further down in this email is
shown the completed scan that actually ran and which obviously
produced no buy candidates because of the zero that was placed to
the right of the last comma in the IIF statement.
>
> Filter=C>1 AND C<100 AND MA(V,50)>100000;
>
> //PAST1=IIf(Ref(H<MA(H,3),-1),PAST2,0)
>
> //PAST2=IIf(Ref(H<MA(H,3),-2),PAST3,0)
>
> //PAST3=IIf(Ref(H<MA(H,3),-3),PAST4,0)
>
> //PAST4=IIf(Ref(H<MA(H,3),-4),PAST5,0)
>
> //PAST5=IIf(Ref(H<MA(H,3),-5),PAST6,0)
>
> //PAST6=IIf(Ref(H<MA(H,3),-6),PAST7,0)
>
> //PAST7=IIf(Ref(H<MA(H,3),-7),PAST8,0)
>
> //PAST8=IIf(Ref(H<MA(H,3),-8),PAST9,0)
>
> //PAST9=IIf(Ref(H<MA(H,3),-9),PAST10,0)
>
> //PAST10=IIf(Ref(H<MA(H,3),-10),PAST11,0)
>
> //PAST11=IIf(Ref(H<MA(H,3),-11),PAST12,0)
>
> //PAST12=IIf(Ref(H<MA(H,3),-12),PAST13,0)
>
> //PAST13=IIf(Ref(H<MA(H,3),-13),PAST14,0)
>
> //PAST14=IIf(Ref(H<MA(H,3),-14),PAST15,0)
>
> //PAST15=IIf(Ref(H<MA(H,3),-15),PAST16,0)
>
> //PAST16=IIf(Ref(H<MA(H,3),-16),PAST17,0)
>
> //PAST17=IIf(Ref(H<MA(H,3),-17),PAST18,0)
>
> //PAST18=IIf(Ref(H<MA(H,3),-18),PAST19,0)
>
> //PAST19=IIf(Ref(H<MA(H,3),-19),PAST20,0)
>
> //PAST20=IIf(Ref(H<MA(H,3),-20),1,0)
>
> The above PAST(n) statements were pasted into >>SETUP=O<C AND
PAST1; with this result:
>
>
>
>
>
>
>
> SETUP=O<C AND IIf(Ref(H<MA(H,3),-1),IIf(Ref(H<MA(H,3),-2),IIf(Ref
(H<MA(H,3),-3),IIf(Ref(H<MA(H,3),-4),IIf(Ref(H<MA(H,3),-5),IIf(Ref
(H<MA(H,3),-6),IIf(Ref(H<MA(H,3),-7),IIf(Ref(H<MA(H,3),-8),IIf(Ref
(H<MA(H,3),-9),IIf(Ref(H<MA(H,3),-10),IIf(Ref(H<MA(H,3),-11),IIf(Ref
(H<MA(H,3),-12),IIf(Ref(H<MA(H,3),-13),IIf(Ref(H<MA(H,3),-14),IIf(Ref
(H<MA(H,3),-15),IIf(Ref(H<MA(H,3),-16),IIf(Ref(H<MA(H,3),-17),IIf(Ref
(H<MA(H,3),-18),IIf(Ref(H<MA(H,3),-19),IIf(Ref(H<MA(H,3),-
20),1,0),0),0),0),0),0),0),0),0),0),0),0),0),0),0),0),0),0),0),0);
>
>
> LASThigherhigh=ValueWhen(Cross(MA(C,3),C),C,1);//this gives the
approximate value of the close just as the line graph of close
prices is crossing down through the 3day MA of close prices. This is
the same thing as the STOCHK RED LINE passing down through the
STOCHD BLUE LINE. This may not always be the exact high of the last
pivot, but it is close enough for me.
>
>
> LASThigherlow=ValueWhen(Cross(C,MA(C,3)),C,1);//I used 1 for the n-
th most recent occurrence. There may also be an occurrance of this >
Cross(C,MA(C,3)),C,1) happening on the day that the scan is being
run. If so, then would the present occurrence of this Crossing be
considered to be the n-th most recent occurrence rather than what I
am assuming here. I will test it an find out.
>
> PRIORhigherhigh=ValueWhen(Cross(MA(C,3),C),C,2);//Same explanation
as LASThigherhigh, but notice how this is now looking for the second
most recent occurrence of a high pivot point.
>
> PRIORhigherlow =ValueWhen(Cross(C,MA(C,3)),C,2);// Ditto the above
explanation.
>
> uptrendtest=LASThigherhigh>PRIORhigherhigh AND
LASThigherlow>PRIORhigherlow;
>
> Buy= Filter AND setup AND uptrendtest;
>
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.520 / Virus Database: 318 - Release Date: 9/21/2003
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->
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 http://docs.yahoo.com/info/terms/
|