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

Re: [EquisMetaStock Group] help with barsSince



PureBytes Links

Trading Reference Links

Juan

Thanks to Corey Saxe there is a way that MS will accept a variable as
constant. Try redefining your variable using
LastValue(PREV+"Variable Data"-PREV)

This method does not work on every occasion but there are a couple of things
you can do to help.
1. Make sure your variable is greater than or equal to one.
2. Make sure your variable is a whole number.

LastValue() can be used in a number of situations to make a result suitable
for using as a constant, but only where the last value of the variable is
the same as on every other bar. The above example of adding then subtracting
PREV from the current value appears to return the "actual" value rather than
the "last" value, and therefore is accepted as a "constant" by many MS
functions.

I have some doubts about the code you have given as an example and doubt it
could work in its present form even without MetaStock's perceived
inadequacies. The code appears to be looking for results from two If()
statements yet I can only see one If(). It also seems to me that the
calculated "constant" for the HHV periods has no check to ensure that it is
a whole number.

When looking for assistance with code it is also helpful if associated code
can be supplied. You may know how "rmbtl" is calculated but those capable of
offering help won't. Providing actual code or at least a working substitute
will increase your chances of real help that goes beyond "buy some more
software".

Good luck with your attempts to solve your problem whichever method you
choose to use.

Roy

----- Original Message -----
From: "emarco" <emarco@xxxxxxxxxxxxxxx>
To: <equismetastock@xxxxxxxxxxxxxxx>
Sent: Saturday, March 08, 2003 11:37 AM
Subject: [EquisMetaStock Group] help with barsSince


This is a trailing stop. The problem is that MS does not accept variable
data in HHV.



stlong:=if(HHV(H,BarsSince(rmbtl=0))-ATR(6)*2.5>C,1,0),1,0)


As you can see, MS does not accept barssince as a period data.
How can I solve this problem?
Thanks

Juan





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/