I believe that an exploration using the code below should result in a listing of opening values for the current symbol and corresponding values for the other symbol (in my case, AAN). If I understand the mode parameter, there should always be a corresponding value for the other symbol as long as that value occurred some time prior to the occurrence of the current symbol's value. I am only getting corresponding values when the opening time of the current symbol's value corresponds to the opening time of the other symbol. I assume my syntax is wrong but I would appreciate any advice.
I was originally using tick data and I wanted to find the most recent "foreign" price that occurred before the current price of the current symbol. With your recommendation, changing the third parameter in the foreign function to FALSE and using a short interval, I think I can accomplish pretty much the same thing.
See the comment under Foreign function documentation. It specifically described that Foreign does that kind of timestamp lookup automatically out-of-the-box so you don't need to do anything yourself.
The foreign symbol is exactly aligned with the current symbol but, if I understand it correctly, if you don't use padding, you can miss values of the foreign symbol. If you do use padding, you get padded values of the current symbol which are not easy to detect and ignore because the volume value of the current symbol is padded with a previous value. I am trying to discern actual trades of the current symbol and actual trades of the foreign symbol synced. If there are no corresponding trades of one symbol or the other, I would like that time period to be blank for the respective symbol. Without padding, I miss some trades of the foreign symbol. With padding, I cannot discern whether the current symbols values are the result of a trade or padding.
I cannot find an easy way to do this which shows actual rather than padded values without skipping some actual trades.
Somewhere else in the documentation, you (or someone else) suggest creating a composite of the sum of the volumes of the two symbols (without padding) as a way of discerning actual trades and I am working on that but, as you can see, I have very limited programming talent. I think it would be much easier if the volume value of the current symbol were padded with a zero or a null value but I assume there is a good reason for not doing that.
I run a scan on a watchlist that just contains the two symbols. Then, I run an exploration on the ~cV symbol and I think I am getting the values I am looking for.