I wonder if I could exclude earning days for backtesting and/or live trading? I saw EarningsDate, but could not get it to show the past earnings date. Can anyone help me with this? Thank you in advance!
Size:
Color:
EarningsDate from Community Components is for
next earnings dates. It's meant for live trading. And there you have this excellent discussion:
Reducing overnight risk by avoiding trades around next earnings dateIt's good that you discovered EarningsDate. In addition, here's another place to browse - our
downloadable Strategies. There you'd find this example easy to learn and modify:
Earnings release dates (Rev.A)Earnings release dates (Rev.C)So, for backtesting you should use the built-in
FundamentalDataItems collection (QuickRef for more). For the Fidelity fundamental data, it's "
earnings per share. Make sure you've updated the fundamental data
before running your Strategy (Data Manager > "Update Data" tab > check your fundamental provider > go to "DataSets" tab > click "Update DataSet").
CODE:
Please log in to see this code.
Size:
Color:
Thank you Eugene, it works perfect!
Size:
Color:
You're welcome!
Size:
Color:
Size:
Color: