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

Re: Bond System



PureBytes Links

Trading Reference Links

At 8:48 PM -0500 3/16/98, Patrick Wahl wrote:

>I tested the following system, posted by The Code, on bonds from '88
>to '97. Original name was xe3 bonds. It did quite well on the Long
>side, not so well on the short side.  This is pretty typical of
>everything I have tested on bonds - works ok long, barely profitable
>or lose money on the short side.
>


I also did some investigation of the bond system. I rewrote it to make more
apparent what it was doing. My revised code is below. (It uses my
XAverage.V function instead of XAverage to allow using a variable as the
price series.) It gives identical results as the original.

It is simply the MACD difference signal filtered by a RateOfChange.

It is curious that the default FastMA input value is larger than the SlowMA
input value. Normally they are reversed. This has the effect of changing
the sign of the MACD function so that the buy signal occurs when the MACD
difference signal is inverted from normal. I wonder if this is intentional
or a typo.

I tried reversing them, making the FastMA input smaller than the SlowMA
input and the results were not much better.

Bob Fulks

-------------------------
{***********************************************************

   System:      _Bond.xe3

   Date:        3/17/98

   By:          Bob Fulks

   Description: A recoding of a system posted by "The Code"
      as XE3 US Bonds (0316:16:20:13) on the Omega List.

      Note that the default inputs for FastMA and SlowMA are
      reversed from normal.

***********************************************************}

Inputs:  FastMA(22),  {Note that this is longer than SlowMA}
         SlowMA(6),
         MacdMA(13),
         Length4(23),
         Input2(46);

Vars:    VMacd(0),
         XMacd(0),
         MADiff(0),
         VRoc(0);

VMacd  = MACD(Close, FastMA, SlowMA);
XMacd  = XAverage.V(VMacd, MacdMA);
MADiff = VMacd - XMacd;
VRoc   = RateOfChange(Close, Length4);

if CurrentBar > 1  and
   MADiff[1]  > 0  and
   MADiff     > 0  and
   VRoc       > 0  then
   Buy next bar at market;

if CurrentBar > 1  and
   MADiff[1]  < 0  and
   MADiff     < 0  and
   VRoc       < 0  then
   Sell next bar at market;

{ *******************************************************************

  Study        : XAverage.V

  Last Edit    : 11/2/96

  Provided By  : Bob Fulks

  Description  : This is a recoding of the XAverage function as a
      "simple function" rather than as a "series function". For
      correct results it must be evaluated on every bar, as is
      normal for Omega simple functions.

********************************************************************}
inputs : Price(NumericSeries), Length(NumericSimple);
vars   : Factor(0), XLast(0);

if Length + 1 <> 0
then begin
  if CurrentBar <= 1
  then begin
     Factor = 2 / (Length + 1);
     XAverage.V = Price;
     XLast = Price;
  end
  else begin
     Value1 = Factor * Price + (1 - Factor) * XLast;
     XAverage.V = Value1;
     XLast = Value1;
  end;
end;