QUOTE:
if(fi.Date == Date[bar-2] && fi.Date != Date[bar-1])
While hardcoding like that is inelegant, it might do the job with liquid stocks. But I would rather use
Bars.IntradayBarNumber( bar ) == 0 to find the first bar of today (see the QuickRef). You should find enough examples of mixing intraday and daily data in the Wiki:
Intraday / Multi-Time FrameQUOTE:
sells after 4 days.
Wealth-Lab Wiki Knowledge Base >
Intraday | Building blocks of Intraday trading strategies >
Exiting after N days in an intraday strategyIntraday / Multi-Time Frame | Mixing intraday and daily data >
Selling a position at close at after the 2nd market day after purchasingQUOTE:
"[msn] eps"
The MSN provider is broken beyond repair and has been taken down years ago. You have to change that to "eps" (Fidelity data), "[si] eps" (StreetInsider), "[ms] Earnings Per Share" (annual data by Morningstar), or "[yc] eps" (YCharts free/paid data). Note that the "eps" item is also available in the free part of YCharts data but is limited to the few recent releases which should be sufficient for your task.