Thanks for the suggestion, [x] is something I most certainly already use, it is specific to 'number of bars back or forward' from the current calc. bar though.
Some more info on what I'm looking for:
ValueWhen(Nth, Expression, Data Array)
Nth _ Is the number of occurrences, of the `expression', you wish to refer back when obtaining the value of the selected data array.
Expression _ The technical condition that you are going back through the data to search for and the `N' will dictate how many occurrences you count back.
Data Array _ On the period that `Expression' is found `N' times ago, it is the value of this data array that is returned.
LastValue( Data Array)
This function will always return the last value of a data array. Put another way, the function:
LastValue ( close )
returns the closing price for the last day of data available. By the same token, the function:
returns the MACD has on the last day of data available.
The same value is returned no matter when the lastvalue() function is calculated. If the Data Array is undefined for any reason, LastValue will return a 0.
Since the function, in effect looks into the future, it is not acceptable for most custom indicators. It is; however, very beneficial for things likes
Effectively I need to refer to the nth occurrence of a specific expression value in the past and return an OHLC value for that occurrence.. also to be able to refer to the last value (value at most recent bar) of a particular expression from any previous bar on the chart.
Last edited by OZ Trade; October 6th, 2013 at 07:40 PM.