Finding a Value at a Specific Time N Days Back or Forward

We have produced two indicators called Days Back and Days Ahead that some of you might find interesting because they function as intraday lag/lead. They are for the NeuroShell DayTrader Professional and are designed to find the value of a Time Series at a specific time x, n periods behind/ahead. The output of the indicator for that day is the value of the Time Series at time x, n days behind/ahead. The indicators have constant values that only change at day boundaries when the indicator must go again and search for time x, n days ago. The indicators take four parameters:

1. A Time Series that you will like to pull values from (Close, Open, RSI, etc.)
2. The hour of the day that you want to pull the value from the Time Series (use 24 hour time, eg 4pm would be 16)
3. The minute of the hour that you want to pull the value from the Time Series.
4. The number of days ahead/behind you would like to look for the Time Series value (use integers greater than or equal to 0).

*******************
Example 1. Let’s say you want your indicator to take the value of the Close 2 days ago at 3:30pm.

Here is how you would call Days Back:
Days Back
Time Series: Close
Hour: 15
Minute: 30
Days Back: 2

*******************
Example 2. Suppose you want to plot the ADX indicator 1 day in advance for the 9:45 am bar.

Here is how you would call Days Ahead:
Days Ahead
Time Series: ADX
Hour: 9
Minute: 45
Days Ahead: 1

*******************
Example 3: Let’s say that you now want to plot the value of the RSI at 12:00 pm on today’s bar or 0 days back/ahead.
For this example you can either use the Days Ahead or Days Back indicator.

Here is how you would call Days Ahead.
Days Ahead
Time Series: RSI
Hour: 12
Minute: 0
Days Ahead: 0

Here is how you would call Days Back
Days Back
Time Series: RSI
Hour: 12
Minute: 0
Days Ahead: 0

Note: in the examples above we have eliminated the parameters of the RSI and ADX indicators for clarity.

Also Note: The Days Back indicator was programmed to take the first bar that is equal to or earlier to the time that you select. For example, if you entered a time of 12:57pm on 5 minute bars, the Days Back indicator would give you the 12:55pm bar. The opposite is true for the Days Ahead indicator as it selects the first bar that is equal to or after the selected time. So 12:57pm on 5 minute bars would be equal to the 1:00pm value using the Days Ahead indicator. Also, setting Days Ahead and Days Behind to a time before the market opens will plot the value of the open while the Days Behind will be missing since there are no bars before the market opens. Likewise, setting Days Ahead and Days behind to a time after the market closes will give Days Behind the value of the close and will plot missing for Days Ahead.

Click here to download a self extracting EXE file containing 2 template (*.tpl) files and one DLL (*.dll). Extract the contents of the downloaded file to your NeuroShell Trader 4\Template directory. Make sure the Trader is not running when you extract, or if it is, restart it so that you can use these indicators. They will be found in the Custom Category

Was this article helpful?

Related Articles