Could somebody check if HV peeks in this example. I use HV (calculated on Daily) as a filter for entry (5-min). Should I used HV1[bar] or HV1[bar-1] in the example below? I am worried that if use the current day's bar than HV peeks at the Close of the day.
CODE:
Please log in to see this code.
Size:
Color:
No, HV isn't peaking.
Size:
Color:
... but you're not processing the last 50 bars, and therefore will never generate an Alert to trade the Strategy. Why?
IS:
Bars.Count-50
SHOULD BE:
Bars.Count-1
Size:
Color:
Thank you, Eugene and Cone!
Cone, yes should have been Bars.Count-1. I think I had a problem with another exit and Bars.Count-50 somehow "fixed" it. So, it was a left-over from trying to deal with another bug in my code.
Just to clarify my original post: I meant to say whether to use HV1[bar-6] to avoid peeking. But this is not important now that I know that HV1 does not peek.
Do I understand it correctly that, in general, if I reference a daily indicator in an intraday code, the daily indicator is NEVER calculated for the last day (incomplete) when the trade actually takes place? Was WL designed in such a clever way so that people like me did not have to worry which bar to use with indicators from other time frames? :)
Size:
Color:
To configure the application's behavior when accessing compressed price series, in WL4 there were three so called synchronization options (see the Knowledge Base on the old site for an article explaining it in great detail). In WL5, you can manipulate the synchronization without having to resort to the Options dialog. This is accomplished in your code by shifting the series with standard .NET operators. See this KB article for a code example:
Intraday / Multi-Time Frame | Compressed price series alignment
Size:
Color:
I have another small problem with the same script. I ran it on a dataset that have symbols that are no longer updated (stock delisted, merged, etc.). I think it is those symbols that give me "Dataseries do not have equal number of values for mathematical operation" error (e.g. NVT symbol). The script does not generate trades for this particular symbol, but works for the others stocks in the dataset. How can I modify the script to be able to run it on the discontinued symbols?
Size:
Color:
If the script doesn't generate enough trades, perhaps there's not enough data?
Size:
Color:
Eugene, sorry it was my mistake. I have re-built the dataset from scratch and Fidelity does not keep the data for old symbols. So, the error is because there were 0 bars for the symbols in question.
Size:
Color:
QUOTE:
Fidelity does not keep the data for old symbols.
Yahoo! does though. If you really need to run some tests on a discontinued symbol (to avoid survivorship bias, for instance), still there's a workaround:
1. Download
Aronow Software LLC Wealth-Lab 5.0 Watchlist DataSet Provider.
2. Create a DataSet with the Y! provider - they still have NVT on board.
3. "Combine" two Y! & Fidelity DataSets together in a Watchlist with the help of Dave Aronow's great freeware.
Size:
Color: