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

Re: Calculating trend line values



PureBytes Links

Trading Reference Links

--- In amibroker@xxxx, "epintoem" <epintoem@xxxx> wrote:
> How can I calculate the next value of the trendline given the previous
> 2 days data?

//TrV is trendline value

slope = Ref(TrV,-1) - Ref(TrV,-2);
pred = slope + Ref(TrV,-1);// "prediction" of the next trendline value

//**end of code

works with rising and falling trendlines 

HTH

Stephan