- ago
Hello,

is there a possibility to get an indicator for the value [%] of contango. Could be helpfull in strategies.

Thank you.
Marko

0
530
Solved
7 Replies

Reply

Bookmark

Sort
- ago
#1
Hello Marko,

I see a couple sources that return the VIX term structure but none so for the contango value - apparently it's calculated on-the-fly. Since this isn't frequently requested, the VIX futures term structure looks like a candidate for our Concierge Support Service:

https://www.wealth-lab.com/Discussion/WealthLab-Concierge-Support-Service-8517
0
Cone8
 ( 25.51% )
- ago
#2
An indicator isn't required. Request the contracts you want to measure, and create a TimeSeries by subtracting them.

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript1 { public class ContangoSample : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) {          BarHistory Ubars = GetHistory(bars, "VIXU22");          BarHistory Zbars = GetHistory(bars, "VIXZ22");          _contango = Zbars.Close - Ubars.Close;          PlotTimeSeriesLine(_contango, "Contango", "CPane"); } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { }       //declare private variables below       TimeSeries _contango; } }
0
Best Answer
- ago
#3
@Cone, looks elegant. Which data provider is this?
0
Cone8
 ( 25.51% )
- ago
#4
Strange question! It's not provider-dependent, although the symbols shown are the November (U) and December (Z) VIX contracts for the IB Provider. IQFeed would be @VIXU2 and @VIXZ2.

A real elegant solution would create a new indicator for each month automatically.
0
- ago
#5
Eugene and Cone,

thank you for thinking about how to implement it. One more hint so that you understand how I would like to use it in the building blocks. For example, I would like to include the height of the last historical "% Contango" value (last day/today or yesterday-it changes every day...) as a condition in the entry.

Eugene: Did you mean the Vix-Central website? There is the current but also all historical values ​​are "retrievable" (pic below). Does that help you?

Marko



0
- ago
#6
0
Cone8
 ( 25.51% )
- ago
#7
If you can access the data, then you'll be able to use the current building blocks for your rule. Scraping the data from that site would be right up Eugene's alley, but, that's a custom job for the Concierge Service.
https://www.wealth-lab.com/Support/Concierge
0

Reply

Bookmark

Sort