- ago
There are News Feed Providers who use throttling, i.e. they allow for example 200 requests per hour.

If I have a single symbol for which I want to download 500 news items I'd need 3 hours to do so with such an provider - theoretically.

The Event Provider API seems to remember the last download effort - no matter if it succeeded or not. This means: in my first try I get 200 items and there are no future trials, WL does not try to load the remaining 300 items.

I think the API needs a mechanism to remember the start/end timestamps of successful downloads and start over if more data is requested.
1
330
5 Replies

Reply

Bookmark

Sort
- ago
#1
Probably you ask yourself what I want to do with 500 news articles.

1. There are some news providers which attach a sentiment value. It is of course possible to run a backtest to find out if this sentiment value helps in getting better trades.

2. with recent advances in NLP (Natural Language Processing) it became feasible to use some modern/advanced LLM (Large Language Model) to analyze news-items and calculate an AI-generated sentiment value. And then, like above, use this sentiment to generate or filter some trades.
0
- ago
#2
QUOTE:
there are no future trials


My thinking was flawed here.

The WL Event Provider plugin gets called again the next day. Now the throttling starts anew and the plugin can do all fancy things to fill the holes.

Solved.
0
- ago
#3
QUOTE:
I think the API needs a mechanism to remember the start/end timestamps of successful downloads and start over if more data is requested.

You can reset the downloaded event item cache in Data Manager > Event providers > right click on it > "Delete local files".

QUOTE:
There are News Feed Providers who use throttling, i.e. they allow for example 200 requests per hour.

If you're up to develop an event provider for such feed, Wealth-Lab has a (probably undocumented) Throttler class that can throttle your provider to ensure that call don't exceed N times within specified interval. So for example, to limit a news provider to 200 items per hour

CODE:
using WealthLab.Core; private static Throttler throttle = new Throttler(200, 60 * 60); ... public void SomeMethod() { throttle.Throttle();


QUOTE:
1. There are some news providers which attach a sentiment value.

Sure thing. Set the base.Value of your news item accordingly (positive, neutral or negative value) and attach a different glyph. The AlphaVantage "News" provider does this.
0
- ago
#4
QUOTE:
attach a different glyph


can you please show a code snippet which sets glyph and color?

(These properties of EventDataPoint are readonly)
0
- ago
#5
Of course. The idea is to inherit from EventDataPoint. Here's how we do it:

CODE:
public class MyEvent : EventDataPoint ... public override string GlyphResource { get { if (base.Value < 0) return "red.bmp"; else if (base.Value > 0) return "green.bmp"; else return "neutral.bmp"; } }
0

Reply

Bookmark

Sort