My use case is I am trying to use SetForeign to trade on a foreign (read futures series) ticker using current base ticker (underlying of futures).
The rationale is that the number of bars of futures is less due to low liquidity as compared to the current underlying hence I want to use underlying as the base ticker on which signals are generated and then the trade prices are picked from the futures of same.
The issue that I am facing is I see a crash every time I run the backtest. Note the number of bars of futures is less I want to run on underlying ticker but use the trade prices from futures (using fixup = 1 and tradePrices = true) but whenever I try to SetForeign or RestorePrices(True) I get a crash report. Can someone please help me figure what I might be doing wrong?
futName = Name()+"FUT"; // that is how names for futures series are stored in my database
if(SetForeign(futName, 1, True))
{
BuyPrice = SellPrice = ShortPrice = CoverPrice = Close;
SetPositionSize(100000, spsValue);
e = Equity();
RestorePriceArrays(True);
}
PS: I have already increased In-memory cache and also number of tickers (I don’t use more than two tickers at once)