[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Detecting bar interval after SetForeign()



PureBytes Links

Trading Reference Links

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
////////////////////



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/