Thank you very much kprsa. Based on your great code, i made a small modification to fullfil my needs. Previously i do not understand where to start, but toDay i think i made it, still not sure how to get the pivot, i just take the Low or High value ...