#define is a C pre-processor thingy. Think of it as a templating system. Wherever in the code you see D1, you replace it (either in your mind, or for real) with (1440/BarPeriod). It's only there in the code that it is actually executed, #defines are declarations only.