StockFetcher Forums · Filter Exchange · HYG vs. TLT<< 1 2 >>Post Follow-up
tomm1111
202 posts
msg #109586
Ignore tomm1111
12/21/2012 11:26:21 PM

Look for the bond ratio to cross bollinger band (20 ,2) upper/lower bands for entry.

http://seekingalpha.com/article/297401-making-money-in-credit-hyg-vs-tlt

Fetcher[
symlist(spy)
and chart-time is 6 months

set{num,ind(tlt,close)}
set{denom,ind(hyg,close)}
set{br,num/denom}

/* BB */
set{brMA10,CMA(br,20)}
set{brSD,cstddev(br,20)}
set{brSD10,2 * brSD}
set{brBOLU,brMA10 + brSD10}
set{brBOLD,brMA10 - brSD10}

set{long,count(br greater than brbolu,1)}
set{short,count(br less than brbold,1)}
draw long
draw short on plot long

draw br
draw brbold on plot br
draw brbolu on plot br
draw brvma10 on plot br
]



Cheese
1,374 posts
msg #109594
Ignore Cheese
modified
12/22/2012 11:02:17 PM

Tomm1111:
Thank you for sharing this information.

Were there a couple of typos in your filter?

You wrote:
set{brMA10,CMA(br,20)}
set{brSD,cstddev(br,20)}

Did you perhaps mean to write:
set{brMA10,CMA(br,10)}
set{brSD,cstddev(br,10)}



tomm1111
202 posts
msg #109596
Ignore tomm1111
12/23/2012 12:56:41 AM

Thanks Cheese.

I probably started with the period at "10" when I wrote the filter then changing it to "20" later on. There really is no answer to this, except what works best for you. Both 10 and 20 provide decent entry signals.

Tom


Cheese
1,374 posts
msg #109598
Ignore Cheese
modified
12/23/2012 2:20:50 AM

Thank you, Tomm1111:
In my limited review of past results, I found that your TLT and HYG appeared to give
good signals more often than the following pairs mentioned on blog-o-sphere:
IEF and LQD
TLT and JNK
TIP and TLT.

Since your filter requires advanced subscriptions, I took the liberty of providing
the following version for the cheap seats. The long and short signals are shown
as columns in the table view.


Fetcher[
symlist(SPY)
and chart-time is 6 months

set{num,ind(tlt,close)}
set{denom,ind(hyg,close)}
set{br,num/denom}

set{brMA10,CMA(br,20)}
set{brSD,cstddev(br,20)}
set{brSD10,2 * brSD}
set{brBOLU,brMA10 + brSD10}
set{brBOLD,brMA10 - brSD10}


set{long,count(br greater than brbolu,1)}
set{short,count(br less than brbold,1)}


/* ********************* */
add column separator
add column long
add column short

add column separator
add column br
add column brbold
add column brbolu
add column brma10
/* ********************* */


draw br
draw brbold on plot br
draw brbolu on plot br
draw brma10 on plot br
]



tennisplayer2
210 posts
msg #109599
Ignore tennisplayer2
12/23/2012 6:17:17 AM

How does this filter work? Do we buy SPY if there is a 1 in the long column and only sell when there is a 1 in the short column and vice versa? Thanks for sharing and Cheese, your knowledge of writing code overwhelms me. Many thanks and have a Merry Christmas.

wkloss
231 posts
msg #109600
Ignore wkloss
12/23/2012 1:05:25 PM

tomm1111

The way I read the article, it appeared to suggest long term trades. If that is correct, could you explain why your filter appears to be set up for short term trades?

Bill

Cheese
1,374 posts
msg #109601
Ignore Cheese
modified
12/23/2012 1:51:14 PM

Thank you, tennisplayer2, and Merry Christmas to you and everyone.

It's Tomm1111's thread and filter, so I defer to Tom's expertise
and look forward to learning more from Tom about how to use his filter and info.

In the meantime, I would like to share a little insight from my experience with studying Tom's filter.

For me, the long and short signals in the columns of the cheap seat version or on the graph
of the advanced version ONLY covered those cases where BR crossed the Upper and Lower BB.
Also, I only took the signals under advisement. They may not be precise enough to support
buy and sell decisions on their own. Perhaps, signals from Kevin_in_GA's TRADING DIVERGENCES
thread would nicely complement Tomm1111's signals for decision support.

The long and short signals did not pick up some cases where BR came NEAR the Upper and
Lower BB. Unfortunately, I was not able to code the cheap seat version to
handle these "near BB" cases. So, visual inspections of BR chart and vertical line drawings
from BR chart to the price chart abovehead came in handy.

Another suggestion is for Kevin_in_GA or mahkoh to consider testing and incorporating Tomm1111's
long and short signals with the entry and exit signals in the TRADING DIVERGENCES filters.

Once again, thank you Tomm1111 for bringing attention to this particular pair.
Cheers.



fortyfour
189 posts
msg #109605
Ignore fortyfour
12/23/2012 10:14:37 PM

To my knowledge directly testing spreads ( custom price streams) such as TLT-HYG is not directly supported in Stratasearch.
What I have done is download several years of historical data in Yahoo for HYG and TLT.
Then, calculate the day change percentage for each TLT and HYG
Next, net the day change for the day in Excel
Next, (net day change) * (85) , where 85 is any initial price stream value.
Next, (next day net day change) * (previous day price stream value)
Repeat until end.
Now you have a custom price stream of closing values.
In excel set open = close
Set high to close + .5
Set low to close - .5. (High and low are set for visual purposes only in SS chart)
Save date, open,high,low,close columns to file TLT_HYG and convert to file type CSV.
Import prices, ASCII, and set folder stocksTLT_HYG (Get symbol name from file name setting)
Done importing price stream.
Next, create sector, any name, and select single symbol TLT_HYG.
Done, but don't expect to update daily.

I must confess I only have about 10 price streams and have been away from them a while,
But , this peaks my interest again and, frankly, since it is a lot of work, collaborating on these price streams
May be the way to go as there are many issues to address and info on spreads/trading is hard to get.
It is easy to go to stockcharts.com and plug in AAPL:QQQ or TLT:HYG to see relatively equal volatility/neutral spreads
But useless if you want to trade dollar and volatility neutral OIL+YEN it has to be the custom price stream OIL+ 3*YEN.
This gives unique, uncrowded opportunities whereas OIL+YEN chart virtually looks like OIL chart.
PS I don't have the example price stream TLT-HYG. Mostly I look for a hedge and would look at TLT+HYG or -TLT-HYG.
But for what it's worth Tomm11 I am long 5 year notes going into this week. Merry Christmas to all.



tomm1111
202 posts
msg #109617
Ignore tomm1111
modified
12/25/2012 12:08:37 AM

tomm1111

"The way I read the article, it appeared to suggest long term trades. If that is correct, could you explain why your filter appears to be set up for short term trades?

Bill"

@ wkloss, why not try?

__________________________

@ Cheese, my work on backtesting/walk forward has been limited on this. Entry's are easy, exit's are hard. Kevin_in_GA, and others, speaks to this.

_______________

@ fortyfour, Thank you for the tutorial. I have run some back tests on NT, but haven't found suitable exit conditions yet.

_________________

I am going to run some backtests on this to see if this will work on walk forward testing. Retail traders are at a significant disadvantage. Anything we can do to try to even the odds is a testament to the generosity of this forum . Merry Christmas.

Tom



tomm1111
202 posts
msg #109618
Ignore tomm1111
12/25/2012 1:55:27 PM

I have fixed the time period on variables to reflect 20 days. Also, I set proposed stops when the bond ratio (br) crosses it's 20 moving average. Enter at "1", Exit at "1".

Fetcher[
symlist(spy)
and chart-time is 6 months

set{num,ind(tlt,close)}
set{denom,ind(hyg,close)}
set{br,num/denom}

/* BB */
set{brMA20,CMA(br,20)}
set{brSD,cstddev(br,20)}
set{brSD20,2 * brSD}
set{brBOLU,brMA20 + brSD20}
set{brBOLD,brMA20 - brSD20}

set{long,count(br greater than brbolu,1)}
set{short,count(br less than brbold,1)}
draw long
draw short on plot long

set{exit_long,count(br crossed below brma20,1)}
set{exit_short,count(br crossed above brma20,1)}
draw exit_long
draw exit_short on plot exit_long

draw br
draw brbold on plot br
draw brbolu on plot br
draw brma20 on plot br
]



StockFetcher Forums · Filter Exchange · HYG vs. TLT<< 1 2 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.