[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EquisMetaStock Group] Code Question



PureBytes Links

Trading Reference Links

I have a problem with the ref function only being able to store 
constant data.  I want to be able to reference the last time that the 
moving average of 5 crossed the 20 moving average.  Then wait to 
generate a buy signal only after the forex pair has increased by a 
set amount, in this case .0020.  How can I reference a certain period 
back if I do not know exactly the past period when it crossed?  Here 
is the code I have so far:

{finding when the previous cross occured}
BC:=  BarsSince(
(Cross(Mov(C,5,W),Mov(O,20,W))
));

Num:= 0 - BC; {assuming BarsSince returns non-negative number}

{if close of current bar minus close of cross bar is greater then
.002, then fire buy signal}
(CLOSE - (  Ref(C,Num))) > .002

Appreciate any suggestions.  By the way, the error generated is "The 
variable or expression must contain only constant data," and it 
points to the ref function.

Thanks,
David




------------------------ 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/BefplB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/equismetastock/

<*> 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/