Reading previous signal of a given strategy

Coding help required for
how to code in AFL, reading of last five to eight signals as desired fared and depending on those signal trade should or should not be executed on next signal arrivals in a given Strategy