The “special” situation I can see here is that the 2 instruments are 1 Future and 1 Index, specifically the VX Future (VX 05-22) and the VIX Index (^VIX), and the problem is I don’t get the desired result that is a plot based on the data from these 2 instruments at the same time.
I’ve tried:
- Changing the primary instrument in the chart, rotating between a Future and an Index to see if with a specific combination I get the plot working, but no result and what I get is a blank chart.
- Selecting other Trading Hours for the Index instrument, when is the Index that is the primary instrument loaded in the chart.
- Loading the 2 kind of instruments simultaneously in the chart, a Future as primary and an Index as secondary, trying to match the script plot with what is loaded in the chart.
Well, nothing of this has worked in my side.
I think that maybe the problem is the different and “non-standard” Trading Hours of the VIX that maybe causes that where the Future has data for example at 8pm ET, then at that time the VIX doesn’t have data because its Exchange hours are different than the hours that could have a Future, so for the hours where the Future has data but the Index doesn’t have any data because “its Exchange is closed”, then I think that the most logical procedure would be that the plot could work in the way that it always takes the last Index price-quote found.
For example:
If any day at 9:41pm ET the VX 05-22 quote is 26.70 and the VIX doesn’t have present quote for that time but the last quote data found for the VIX for that day was 24.86 at its close at 4:00pm ET, then I think the way to proceed would be to automatically work with what has present data in X time and taking the last quote found of the other instrument, and in that way always have a result with the last available and more current data of the two instruments. But I haven’t found the way to get that because the idea would be to have the desired plot having data every time the instrument with more available data during day has available data, in this case taking the VX Future as reference and main data-source because is the instrument with a wider range of time during the day.
I’ve attached the modified “SampleSecondarySeriesAsInputSeries” script for more reference, to please see how you can help me to work these kind of cases where is needed to work with multiple instruments with different Exchange Hours.
Thank you in advance!
Comment