In a large mixing bowl, combine the rolled oats, grated carrots, almond butter, maple syrup, vanilla protein powder, cinnamon, nutmeg, and salt. Stir until well mixed.
Fold in the raisins, walnuts, and shredded coconut if using. Mix until all ingredients are evenly distributed.
Line an 8x8 inch baking dish with parchment paper, leaving some overhang for easy removal.
Transfer the mixture into the prepared baking dish and press it down firmly with the back of a spatula or your hands to create an even layer.
Refrigerate for at least 2 hours to set. Once firm, lift the bars out of the dish using the parchment paper and cut into squares or rectangles.
Store any leftovers in an airtight container in the refrigerator for up to one week.