Trend follower sample in MT4 - illogical

 
Why do you check suffiecent no. of bars at end of program - this should be done first, so experts can calculate properly - re MT4 trend follower example.

you have done the right thing tho in MACD example.