TradingSolutions Home  |  Products  |  Services  |  Downloads  |  Resources  |  Support  |  Order NeuroDimension Home  
'
   Products
     TradingSolutions
     Trader68
     Add-Ons
     Bundles
     Financial Books
     Other Products
   Services
     System Development
     Custom Software
   Downloads
     Free Evaluation Copy
     Product Updates
     Free Systems
   Resources
     Sample Performance
     Video Tour
     Data Sources
     TradingSolutions FAQ
     Online Brokers
   Viewpoints
     Customer Interviews
     Customer Quotes
     News and Reviews
   Support
     How to Get Help
     Licensed User Center
     Contact NeuroDimension
   Order

   ND Corporate Website
   NeuroSolutions.com
   Trader68.com

TradingSolutions Function Library

  Lag (Variable Length) [LagVL]  
Return to Complete List of Functions
The Lag (Variable Length) function returns the value of a data series a variable period of time ago.

Parameters
------------------
Data            The data to analyze. This is typically a field in a data series or a calculated value.
Period          The number of bars of data to include in the calculation, not including the current bar.
                    For example, a period of 3 returns the value from three bars ago.
Maximum Period   The maximum value that Period can contain.
                             Larger values require extra memory to be set aside for this function to be calculated.

Function Value
------------------------
This function returns the value of a data series a variable period of time ago. If the period is set to zero, the current value of the data is returned.

The value at the beginning of a data series is not defined until there are enough values to fill the given period. If the period is greater than the maximum period or negative, the value is not defined. If the period contains a fractional number, only the integer portion will be used.

Close        Period          LagVL(Close,Period,2)
--------------------------------------------------------------------
   2                2
   3                1                          2
   4                2                          2
   5                3                                    <-- no value since 3 > maximum period
   6                2                          4
   7                1                          6

Usage
-----------
Variable length functions can be used in association with other calculations, such as "Bars Since" functions, to determine values since an event occurred. For example, the following formula would return the value of Close at the time of the highest high in the last ten bars:

LagVL ( Close, BarsSinceHigh ( High, 10 ) , 10)

The Lag function is primarily used to access previous values of a data series or function.

The Lag function can also be used to simulate an end point for functions with Period as an input. For example, the highest value from 5 to 14 bars ago could be found using the following formula:

Lag ( Highest ( Value, 10 ) , 5 )

This formula would examine the highest value over a period of 10 bars and return the value associated with that from 5 bars ago.

TradingSolutions Home  |  Products  |  Downloads  |  Resources  |  Support  |  Order

Contact NeuroDimension | Privacy Policy
Webmasters, join our affiliate program. Interested in selling our software? Become a reseller!
Web Site Design and Implementation Copyright © 2010 NeuroDimension, Inc.
Risks of Forex Trading.