PureBytes Links
Trading Reference Links
|
Steve,
Here are a couple of observations.
SPeriod:=4; ...isn't being used
c3 is an oscillator between 0 and 100. I believe you want declining
conditions. In order to assure this use:
c3a:=(((C - PL)/(PH - PL))*100);
c3:= c3a < 40 and c3a < ref(c3a,-1);
Set up the oscillator in a seperate window. The signals you are
getting may not be what you are expecting.
c4:= H>Ref(H,-1) OR H>Ref(H,-1); .... the or is seperating the same
conditions. Eliminate one condition or change it. Are you sure you
are looking for the high to be greater than yesterday's high?
tmp:= If(AllDefined AND c1 AND c2 AND c3,1,0);...could be changed to
tmp:= If((AllDefined + c1 + c2 + c3)=4,1,0);
Preston
--- In Metastockusers@xxxxxxxxxxxxxxx, Stephen Dawson <dawsonsg@xxxx>
wrote:
> Hi Guys,
>
> I have writtten the formula (below) but am having problems with the
> implementation of an method. The code above doesn't implement the
method
> properly.
>
> What I am attempting to do is when c1, c2 and c3 are true then mark
the NEXT
> bar with a symbol if the High is greater than the high the day the
cross
> (evaluated to the 'result' variable) became true.
>
> If that does not happen I would like to mark the NEXT bar along
(with a symbol)
> if its high is higher than the previous day.
>
> What is happening is that a bar can be marked the day the cross
happens if its
> high is higher than the previous bar. The only bars that should be
marked are
> the two AFTER the cross returns the true result.
>
> I hope that makes sense.
>
> As always, any help appreciated.
>
> Regards
> Steve
>
>
> {Set some variables}
> PL:= LLV(L,8);
> PH:=HHV(H,8);
> SPeriod:=4;
>
> {Check all data elements are defined}
> AllDefined := IsDefined(ADX(14)) AND
> IsDefined(PL) AND IsDefined(PH) AND
> IsDefined(PDI(14)) AND IsDefined(MDI(14));
>
>
> {The three conditions that we req}
> c1:=ADX(14)>35;
> c2:=PDI(14)>MDI(14);
> c3:=(((C - PL)/(PH - PL))*100)<40;
> c4:= H>Ref(H,-1) OR H>Ref(H,-1);
>
> {This detects the first time that c1, c2 and c3 }
> {are TRUE. Result is set to TRUE and held for two}
> {more days}
> tmp:= If(AllDefined AND c1 AND c2 AND c3,1,0);
> result:=Alert(Cross(tmp,0.5),3);
>
> {Now check c4 against the result of c1, c2 and c3}
> mark:= result AND Cross(c4,0.5);
> mark
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/zMEolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Metastockusers/
<*> To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|