#twitter-follow { border: 0;position: fixed; top: 240px; left:0;} #live-support { border: 0;position: fixed; top: 370px; left:0;} #knowledge-base { border: 0;position: fixed; top: 170px; left:0;}

## PREV - Previous value of the same formula

by QuantShare, 4205 days ago

This function is an alternative to the "PREV" function of Metastock.

In Metastock, the "PREV" function is a constant used to reference the previous value of the same formula.

For example, if you want to calculate this:

a = close + [Previous Value of this Formula];

In Metastock, you can use:

a = close + PREV;

This formula takes the value of "close" and adds it to the previous value of "a".
At bar "100", it takes the close price at that bar and adds it to the value of variable "a" at bar 99.

The problem with the "PREV" function of Metastock is that it slows down processing dramatically. This is not the case with the QuantShare similar "PREV" function.

This function allows you to create formulas like:
c = a + b * PREV;

Let us translate an example:

Metastock: (This calculates a sort of exponential moving average)
res = (close*0.20)+(PREV*0.80);

QuantShare:
res = PREV(close*0.20, 0.80);

The first argument is "a" and the second one is "b", which results into: close*0.2 + 0.8*PREV

Here is another example:

Metastock:
res = close + PREV;

QuantShare:
res = PREV(close, 1);

What is this?

 Type: Trading Indicator Object ID: 1194 Country: All Market: All Style: Technical Analysis

 Related objects Empty
Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object

 Random Blog Posts How to measure market strength with the composite tool How to create a trading system, screen and composite using earnings surprise data Download historical EOD data for the stock, futures, ETF and Forex markets How to build and backtest a robust stock trading system Backtesting chart patterns using the auto support and resistance indicator German Stock Exchanges: 5 free ways to download historical EOD/Intraday data How to use QuantShare screener to trade penny stocks Long Term Trading with Technical Analysis Show All

Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object