I am trying to recreate a strategy that I have running in TradeStation with Amibroker. It is an intraday VIX futures (VX) strategy. In TradeStation it uses two datastreams. Data1 is a one minute, and only the day session (8:30am-3:15pm CST). Data2 uses daily data. Part of the conflict is that when using a day session in Amibroker it truncates all datastreams. So to get around this so it matches the way TS does it, I imported a secondary daily datastream into Amibroker and just tacked on "_Daily" to the back of the symbol, and then I am using SetForeign to access this data. The problem is that it is only recognizing the closing values for each day. For the Open, High, and Low it is returning the Close. I see in the documentation that it will do this if it does not have the data for the Open, High, Low, but it DOES have the data. I can plot the "_Daily" data on a separate chart and it is there. Why would it not let me access this via the code? Here is how I am trying to do it:
This is probably not your only problem, but you should begin by adding a TimeFrameRestore() call to match your TimeFrameSet() call. Also, did you tick the box for "Allow mixed EOD/Intraday data" in your database settings?
I thought RestorePriceArrays() also does a TimeFrameRestore(). Anyway, I added that too right before RestorePriceArrays() and nothing changed. Then I tried checking "Allow mixed EOD/Intraday data" in the database settings and all daily prints returned {Empty}.
@fxshrat , I've changed everything as you have above here. The most notable thing is fixup=2. That did make the O, H, L appear, but they are off by a day. For instance, when I click on 9/6/18, I should be getting the most recent daily values for 9/5/18, but nope, it is returning the values for 9/4/18. So odd. Why would this be?
Check your timestamps in imported data. That is very first thing to do.
Second thing is that you know daily close at the END of day, not at the start, so you may think they are "off by one day" as you say, but not, they aren't. Again this is explained in http://www.amibroker.com/guide/h_timeframe.html
Expecting to know current day's (final) High/Low/Close at 9:30 (on session start) is expecting future leak. These data are known when session closes.
On unaligned timestamps Foreign would (CORRECTLY) only report PAST data, and would not allow to leak the future. Note that EOD record is considered as THE LAST record for the day. So any intraday record preceed EOD record.
But if you WANT TO LEAK the future (BAD idea but anyway if you want it for some reason), you can import those "_Daily" data with 00:00:00 timestamp (so they appear as they happening as very first price for the day - which is of course NOT true, but as I said - that is only when you want to LEAK the future)