The two indicators described here are very similar to the ones described in the tip “Finding the value at a specific Time N days Back or Forward”. There are some differences, however, which you should consider when deciding which to use.
1. FindValue – The FindValue indicator will find the value of a price or time series some number of days forward or back given a specific time in hours, minutes, and seconds. If there is no bar with the date and timestamp you requested (plus or minus a tolerance of x seconds which you specify), then no value is plotted. Otherwise, the value of the price or time series found at the date and time specified is plotted. Note that if you are plotting a bar in the future, that will only work on historical data, of course (this indicator does not predict).
The count of days forward or back only includes days for which there are bars present, so do not include weekends and holidays in the count unless there is trading on those days. In other words, if the indicator is plotting last Friday’s value on Monday, the lookback will be -1 if that symbol has no weekend trading.
The tolerance is required because times on bars are designated by floating point fractions, so that a precise comparison of times is not always possible due to the number precision issues of floating point fractions. If you have bars which occur every one second or less use a tolerance of less than half the distance between bars (for second bars 0.2 should be good).
Here are the parameters of the FindValue indicator:
FindValue
Series – this is the price, indicator, or other time series you want to find the value of
Hour – the hour from 0 to 23 of the bar you want
Minute – the minute in the specified hour from 0 to 59
Second – the second in the specified minute from 0 to 59
Target – the number of days forward (+) or back (-) from the day being plotted where the bar is to be found
Tolerance – the number of seconds more or less to identify the bar
Date Variable – always let this default to the NeuroShell Date variable
Examples are found at the end of this article.
2. FindValueD – The FindValueD indicator is like the FindValue indicator except that there is no Target variable that specifics a day forward or back of the day being plotted. Instead an exact day, month, and year specified.
Here are the parameters of the FindValueD indicator:
FindValueD
Series – this is the price, indicator, or other time series you want to find the value of
Month – the month 1 to 12 of the bar you want
Day – the day of the month 1 to 31 of the bar you want
Year – the year 1900 to 2099 of the bar you want
Hour – the hour from 0 to 23 of the bar you want
Minute – the minute in the specified hour from 0 to 59
Second – the second in the specified minute from 0 to 59
Tolerance – the number of seconds more or less to identify the bar
Date Variable – always let this default to the NeuroShell Date variable
3. Examples
Plot the value of the RSI(Close,10) indicator 3 trading days back at 10:30PM
FindValue
Series = RSI(Close,10)
Hour = 22
Minute = 30
Second = 0
Target = -3
Tolerance = 10
Date Variable = Date
Plot the value of the Close today at 8:15:42 AM (Note tolerance changed to < 0.5 second) FindValue Series = Close Hour = 8 Minute = 15 Second = 42 Target =0 Tolerance = 0.2 Date Variable = Date Plot the value of the Open tomorrow at 4:08 PM FindValue Series = Open Hour = 16 Minute = 8 Second = 0 Target = 1 Tolerance = 10 Date Variable = Date Plot the value of the Momentum on January 5, 2005 at 9:31:01 FindValueD Series = Momentum(Close,1) Month = 1 Day = 5 Year = 2005 Hour = 9 Minute = 31 Second = 1 Tolerance = 0.2 Date Variable = Date Click here to download the .DLL and .TPL files which should be stored in your NeuroShell Template folder. After NeuroShell restart the FindValue and FindValueD indicators can be found in the Custom Indicators category.
Click here to download the Powerbasic source code if you are a programmer and think you might want to make modifications to these indicators.