PureBytes Links
Trading Reference Links
|
Perumal, the solution here is to avoid forward-looking code, such as
Ref(L,2) OR Ref(L,3).
An easy fix:
---8<-------------------------
fwd:=L <=LLV(L,10)
AND L<Ref(L,-2)
AND (L<Ref(L,2) OR L<Ref(L,3));
Ref(fwd,-3)
---8<-------------------------
jose '-)
http://www.metastocktools.com
--- In equismetastock@xxxxxxxxxxxxxxx, "Perumal
Ramasamy" <umrperumal@xxx> wrote:
>
> Hi friends
>
> I wanted to code a buy signal with the following three conditions:
>
> 1. Low should be the low of the last 10 periods
> 2. Low should be less than the low of the previous 2nd bar
> 3. Low should be less than the low of the subsequent 2nd bar or
subsequent 3rd bar
>
> I had coded this as under:
>
> L <=LLV(L,10) AND
> L<Ref(L,-2) AND
> L<Ref(L,2) OR L<Ref(L,3) ;
>
> To satisfy this condition, minimum 5 bars are required. One central bar
with lowest low of 10 periods, 2 bars on the left side of LLV bar, and 2
bars on the right side of the LLV bar. If the condition is not satisfied,
it will need the 6th bar (3rd bar on the right side). This will give a
signal earliest when 2 bars have been posted after LLV(L,10) bar
>
> My problem is that even if the condition is satisfied with 5 bars, the
signal is not given. It is only given after 6th bar is posted.
Logically, it should give the signal with 5 bars since even without 6th
bar, the last condition ( L<Ref(L,2) OR L<Ref(L,3) ) is satisfied.
>
> Is there any work around to come out of this problem, and get the signal
with 5 bars if the conditions are satisfied.
>
> Anybody can help me?
>
> Regards
>
> Perumal
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/equismetastock/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:equismetastock-digest@xxxxxxxxxxxxxxx
mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|