It seems like you are in a situation that is nasty. You can look at restructuring your code so that iCustom isn't called for every single tick. If that is not possible, then you have to incorporate the indior's code.