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

  Bars Since Was True (Variable Length) [BarsSinceVL]  
Return to Complete List of Functions
The Bars Since Was True (Variable Length) function determines the number of bars since a given condition was true, up to a variable number of bars ago.

Parameters
------------------
Condition   The condition to evaluate. This is typically a field in a data series or a calculated value.
Period        The number of bars of data to analyze for the condition, including the current value.
                  For example, a period of 3 includes the current value and the two previous values.
Maximum Period   The maximum value that Period can contain.
                             Larger values require extra memory to be set aside for this function to be calculated.

Note: An end point to the Period parameter can be simulated using the Lag function to obtain a previous value of this function. See the notes for the Lag function for more information.

Function Value
------------------------
This function determines the number of bars since a given condition was true, up to a variable number of bars ago. A condition is considered to be true if it has a non-zero value. If the condition was not true during the given period, the function returns zero. If the condition was null during the given period and not true after the last time it was null, the function returns null.

Note: A zero can indicate either that the condition is currently true (zero bars ago) or that the condition was not true during the given period. This function can be used in conjunction with the Was True function or simply checking the current value of the condition to differentiate these two cases.

This function has a value at the beginning of a data series at the first true value or when there are enough records to fill the 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.

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 number of bars since a condition was true after the highest high in the last ten bars:

BarsSinceVL ( condition , BarsSinceHigh ( High, 10 ) , 10)

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.