- ago
Hi
(test code),
CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Indicators; using System.Drawing; using System.Collections.Generic; using System.Linq; namespace WealthScript1 { 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) {          string sym = bars.Symbol;          TimeSeries cls = bars.Close;          lstDividends = bars.EventDataPoints.Where(i => i.Value > 0 && i.Name == "Dividend").ToList();          //check          int cnt = lstDividends.Count;          WriteToDebugLog("Dividend list count = " + cnt);          if (cnt <= 10)          {             for (int a = cnt -1; a > -1; a--)                WriteToDebugLog(lstDividends[a].Name + ", " + lstDividends[a].Date.ToShortDateString() + " "                   + lstDividends[a].ProviderName + " " + lstDividends[a].Value.ToString("$##0.00"));          }          else          {             for (int a = cnt - 1; a > cnt - 1 - 10; a--)                WriteToDebugLog(lstDividends[a].Name + ", " + lstDividends[a].Date.ToShortDateString() + " "                   + lstDividends[a].ProviderName + " " + lstDividends[a].Value.ToString("$##0.00"));          }       } //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       List<EventDataPoint> lstDividends;    } }


Seems like the "Dividend" list gets populated by dividend data from all providers you've selected that offer that item:


I have 2 Qs:
1) Is there a way to access Provider-specific Event Data series like one could in WL6?
2) Is there a way to edit a Provider's event data in case an error is discovered? [Deleting the FundamentalData subfolder doesn't always work as WL7 doesn't d/l the data thinking it's up to date - even after you close & restart the app multiple times.]
0
542
8 Replies

Reply

Bookmark

Sort
- ago
#1
Oops,
I forgot to add point to issue to pic abv...
Yahoo shows two dividends for 8/7/20 - 0.21 (actually 0.205) which is split-adjusted and 0.82 (which is pre-split and shouldn't be there), I wish to remove the latter from the event data series.
0
- ago
#2
QUOTE:
1) Is there a way to access Provider-specific Event Data series like one could in WL6?

The WL7 way is to uncheck the provider if you don't want its events to appear.

Also, EventDataPoint has the ProviderName property which lets you filter items by provider:
https://www.wealth-lab.com/Support/ApiReference/EventDataPoint

CODE:
lstDividends = bars.EventDataPoints.Where(i => i.Value > 0 && i.Name == "Dividend" && i.ProviderName == "Yahoo! Finance").ToList();
0
- ago
#4
Thanks for the code snippet, I should have thought of that. :(

So why would I (or anyone) d/l event data from more than 1 provider?
I use M*, Yahoo & Zacks currently:
- Z is best for Earnings
- M* is the most comprehensive event data provider and I use various event data points in various scripts (or plan to)
- Yahoo is for convenience, as a secondary source/backup and b/c items update much faster e.g. it posted SPY's last dividend of 3/19/21 a day or two later whereas M* still has to. A user would never know this unless they were watching it regularly.
Fidelity was an excellent source of fundamental data but, alas, that's history now.
----------------------------

2) If I were to edit event data which app can I use to open/edit the data files?
0
- ago
#5
Event items are not editable by users.
0
- ago
#6
Heads-up: the Dividend item by Morningstar is broken, they have decommissioned the endpoint it was requested from.
0
- ago
#7
Thanks for the heads up. Seems like other fundamental items may also be affected.

If/when it's fixed please do it for WL6.9 also!
0
- ago
#8
Other (annualized) fundamental items by Morningstar are not affected, including the "dividends" one.

Sorry, I no longer produce fixes for 6.9 extensions.
0

Reply

Bookmark

Sort