I'm just getting started with live data from the IB Gateway API. However, it appears that run() is executed on every tick, instead of once per day according to my BarPeriod of 1440. At least, that is my understanding of how run() works. Am I doing something wrong? Thanks.

Here is the setup in my run() function. Based on the debug printfs I have in the script, the various indicator series like EMA and RSI are updated at every tick, which is not correct.

void run() 
	StartDate = 20160101;
	EndDate = 20180831;
	BarPeriod = 1440;	
	BarZone = ET;
	BarOffset = 15*60+5; // trade at 15:05 ET
	LookBack = 250;
	PlotMode = PL_ALL;