Overlay or insert problem?

Suppose in the AFL code I have used plot function twice

one to insert a moving average which I want to insert on the price chart
second any other customized indicator which I have to insert it in the new pane

How do I do that in the same AFL code without inserting indicator manually from basics charts option. If I insert the AFl code, then moving average is not visible, and if i overlay the AFL code, the price chart becomes very small.