Are there some genetic reasons I get depression off and on?

Quite possibly. Depression has many causes, some biological or genetic, others environmental. It often "runs in families, " and that too may be partly genetic and partly learned behavior--we tend to react like our parents did to stress. Some people are less likely to respond to stress or bad events with depression. That's called resilience, and it too has a genetic compnent.
Quite Possibly. Depression tends to occur with people who have a history of close family members who also struggle with depression. There are risk factors related to genetics that are still not well understood.