I am trying to code a signal for some bar setups, but I am uncertain of the easiest way to proceed. Say I have several different bar types: TypeA, TypeB & TypeC. I then want to search for a setup where the bars occur in the following order: TypeA, TypeB, TypeA, TypeC, TypeA. With Type B & C, I usually know what number of consecutive bars I am searching for, so I can set up an MRO to do the searches. But TypeA bars may occur anywhere from 1 to 7 consecutive times @ each TypeA position. What is the easiest way to code the MRO when I do not know the number of consecutive TypeA bars I am looking for. For example, if there are 4 TypeA bars in position 1, I might search for the 1st instance of this, but if I do not know that was the number of TypeA at position 1, how do I code for the next set of TypeA to search for, that is I cannot just code to find the 2nd instance of 4 Consecutive TypeA, as it may be the 1st instance of 6 Consecutive TypeA in that position. It also becomes difficult to code which TypeA TypeB should be >< etc. Is it possible to set up an MRO within an MRO? So I code MROs for all possible permutations of TypeA, then I include all of them under another MRO to find the 1st, 2nd etc to occur? Or include a counter within the MRO code. Any help much appreciated.
Thank you.
Comment