Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Easy/PowerLanguage Equiv. of ValueWhen and LastValue
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:
LastValue(MACD())
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
pattern recognition.
-------------------------------------------
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.