- ago
Back to even more basic questions. How do I create a FRED bar history? Does not appear in datasets.
0
625
Solved
4 Replies

Reply

Bookmark

Sort
- ago
#1
QUOTE:
How do I create a FRED bar history? ... not appear in datasets.

FRED is not a WL8 dataset, so it won't appear there. Rather FRED comes to WL8 as a DataExtensions extension, which you need to download and install first.
https://www.wealth-lab.com/extension/detail/DataExtensions

After installing, go to the WL Help docs and lookup DataExtensions > FRED

That should get you started. There's a link in that help section that will take you to the FRED website that will tell you the different names of the FRED SeriesNames. Pick the SeriesNames you're interested in.
0
Best Answer
- ago
#2
@superticker is right, the point is that the legacy way (WL6) of creating a FRED DataSet and updating data prior to backtesting no longer applies. There's no need to set it up like before, the new indicator (see Help) does it all under the hood. Just feed it with a FRED series name from their website.
1
- ago
#3
@ gbullr
- Here is a quick snip of code for creating a FRED Pane. Example Below:

CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; namespace WealthScript5 { public class MyStrategy : UserStrategyBase { //create indicators and other objects here, this is executed prior to the main trading loop public override void Initialize(BarHistory bars) {          // FRED Fed Funds Data          _rates = new Fred(bars, "ff", false, "Fed.Funds.Rate");          PlotIndicator(_rates, WLColor.FromArgb(255, 0, 0, 255), PlotStyle.Line);          SetPaneDrawingOptions(_rates.PaneTag, 30, 130);          // FRED 10 Minus 2 Yield Curve          _YieldCurve102 = new Fred(bars, "T10Y2Y", false, "10Yr.Minus2Yr.");          PlotIndicator(_YieldCurve102, WLColor.HotPink, PlotStyle.Line);          // FRED 10 Minus 3 Month Yield Curve          _T10Y3M = new Fred(bars, "T10Y3M", false, "10Yr,Minus3Month");          PlotIndicator(_T10Y3M, WLColor.DarkRed, PlotStyle.Line);          // FRED UNEMPLOYMENT RATE          _UNRATE = new Fred(bars, "UNRATE", false, "UnEmploymentRate");          PlotIndicator(_UNRATE, WLColor.YellowGreen, PlotStyle.Line);          // FRED CPI Data          _CPI = new Fred(bars, "MEDCPIM158SFRBCLE", false, "CPI");          PlotIndicator(_CPI, WLColor.Yellow, PlotStyle.Line);          // FRED 10 Year Constant Maturity          _DGS10 = new Fred(bars, "DGS10", false, "10-Year Constant Maturity");          PlotIndicator(_DGS10, WLColor.Orange, PlotStyle.Line);          // FRED 30-Year Fixed Rate Mortgage Average in the United States          _UNRATE = new Fred(bars, "MORTGAGE30US", false, "30YrMortgageRate");          PlotIndicator(_UNRATE, WLColor.Black, PlotStyle.DashedLine);                              // White Dashed Line at Zero on Scale          DrawHorzLine(0, WLColor.White, 1, LineStyle.Dashed, _rates.PaneTag);                     } //execute the strategy rules here, this is executed once for each bar in the backtest history public override void Execute(BarHistory bars, int idx) { if (!HasOpenPosition(bars, PositionType.Long)) { //code your buy conditions here } else { //code your sell conditions here } }       //declare private variables below       IndicatorBase _rates; // Fed.Funds.Rate       IndicatorBase _YieldCurve102; // FRED 10 Minus 2 Yield Curve       IndicatorBase _T10Y3M; // FRED 10 Minus 3 Month Yield Curve       IndicatorBase _UNRATE; // FRED UNEMPLOYMENT RATE             IndicatorBase _CPI; // FRED CPI Data             IndicatorBase _DGS10; // FRED 10 Year Constant Maturity    } }
1
- ago
#4
Thank you all.

0

Reply

Bookmark

Sort