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

Re: Predicting price function?



PureBytes Links

Trading Reference Links

At 4:33 PM -0500 12/8/98, Brad Lambert wrote:

>I'm trying to write a function (call it RSI_cross for example)
>that will calculate the price level necessary to fulfil a certain
>criteria (lets say I want to buy when the RSI crosses above 50 for
>example).
>
>Writing code such that a system enters on a close that fulfils this
>condition is not hard. But I want to know "beforehand" what price
>will be needed to satisfy the condition.
>
>I want to be able to say something like...
>
>buy tomorrow at RSI_Cross,stop
>
>Can anyone help me out?


Solving the equation for price, as Jim suggests is the best approach if you
can do it. But it is not always possible.

One approach that I have used is to create a separate variable for price.
Then create a loop that will step through a series of price values such
that you test each value of the price variable to see where the result
switches.

This can be tricky since many functions ("series functions") you may want
to use will not allow variables as inputs but it works well if you can work
around this problem.

Bob