Is there a way to detect the bar length of a new series after using SetForeign? (Not the bar interval selected in AA; the bar length of the price data itself.)
Suppose the 1st series contains daily bars, the 2nd series contains weekly bars. I'm trying to prototype a vector-oriented interest payment rather than use a constant interest rate across an entire decades-long backtest. For high-performance systems the interest paid might be irrelevant to the client. For a relatively slow bond timing system, changes in the interest rate on cash have a tangible effect on the final result. For example, the bond fund series being traded might be in daily bars, but the interest rate series might be in weekly bars. To credit interest correctly to the portfolio, we need to convert the weekly rate to a daily rate. The following code tests the Interval function. It appears to report the bar interval selected in AA, not the bar interval of the symbol's data. Thoughts? Best regards, //////////////////// SetForeign( "$TY5Yr", fixup = True, tradeprices = False ); // daily bars NumToStr( Interval( 1 ), 1.0, separator = False ); // 86400 in Interpretation dasymbol = ParamStr( "Sym", "CD1M_LDOW" ); // weekly bars SetForeign( "dasymbol", fixup = True, tradeprices = False ); NumToStr( Interval( 1 ), 1.0, separator = False ); // 86400 in Interpretation ////////////////////
