Okay, just to confirm we are on same page
You want the pane (
as shown by me , above), but to be created dynamically through the code ? right ? (God I hope I get it this time, haven't scored so poorly in any of my test, he he).
if you didn't want it programmatically You would use the technique (file->new->blank pane) which I have already shown you.
if the answer is Yes, then my first question, have you tried using GFX functions (low level graphics), ? Aren't they solving your need ?
for simplicity why don't you plot the indicator on the chart dynamically with ownscale (thus not skewing up the original chart scale) and programmatically remove it (by enclosing the plot inside if block) ?
You may want to restrict the movement (chartspace) of this new indicator by using the minvalue and maxvalue parameters of the plot function (this way you can restrict the indicator to take only say 20% of vertical chart space)
for reference :
Plot( array, name, color/barcolor, style = styleLine,
minvalue = {empty}, maxvalue = {empty}, XShift = 0 )
even if all these don't solve your problem, I have three things to say -
1. Put your query in
http://finance.groups.yahoo.com/group/amibroker/ (official group, where TJ himself posts and other great AFL coders like Herman, Howard Bandy himself, phoenix, Monk, I am sure if it can be done somebody will answer) (but please be clear on your doubt there)
2. Is this feature (dynamically creating pane) really the one thing which you can't go about ? I assume it is important for you , (since you have taken the trouble to post the query in multiple forums), but my question actually is, think again if the time is worth the pain, as a trader would put it, is the R2R ratio favorable ?
3. May be I am still guessing wrong on what you want, then apologies upfront.
Cheers