I subscribed to Fundamentals extension,
But do not see EPS surprises item in Fundamentals items selection box.
What am I missing?
But do not see EPS surprises item in Fundamentals items selection box.
What am I missing?
Rename
Did you look at the Zacks Event Provider?
Thank you - eps surprise appears on the chart as advertised.
Trying EPS surprise code-based strategies.
Trying EPS surprise code-based strategies.
Here's an example that buys on a positive earnings surprise and sells after holding 10 bars.
CODE:
using WealthLab.Backtest; using System; using WealthLab.Core; using WealthLab.Data; using WealthLab.Indicators; using System.Collections.Generic; using System.Globalization; 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) { } //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 List<EventDataPoint> lst = bars.GetEventDataPoints("Earnings", idx); if (lst.Count == 1) { EventDataPoint edp = lst[0]; if (edp.Details.ContainsKey("Surprise")) { string s = edp.Details["Surprise"]; s = s.Replace("+", ""); //WriteToDebugLog(s); if (s.Trim() != "") { double surprise = Double.Parse(s, CultureInfo.InvariantCulture); if (surprise > 0) { PlaceTrade(bars, TransactionType.Buy, OrderType.Market); } } } //foreach(KeyValuePair<string, string> kvp in edp.Details) // WriteToDebugLog(kvp.Key + "=" + kvp.Value); } } else { if (idx - LastPosition.EntryBar >= 10) PlaceTrade(bars, TransactionType.Sell, OrderType.Market); } } //declare private variables below } }
@flanda
And for a strategy that tries to exploit a strong history of positive earnings surprises, check your strategy folders after installing the Fundamental extension.
And for a strategy that tries to exploit a strong history of positive earnings surprises, check your strategy folders after installing the Fundamental extension.
Your Response
Post
Edit Post
Login is required