Help is need to CreatePane in afl indicator

#12
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
 
#13
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
Gee, I donno how to thank you for your consistent effort.

You see, sometimes it's quite helpful to have some modified indicators merged in one indicator and use it as you please without having to setting them up again. Kana lazy, Lol.

Sorry your suggestion wont solve my problem, GFX is just function like other suggested functions, and as long as there is no function in AB that allow creating separate pane that enables you to put individual indicator procedures I don't think my problem can be solved.

Now back to your three saying:
1- I'll try the query link you specified, but what do you mean by
(but please be clear on your doubt there)
What are the consequences? Is it that bad? Lol...

2- No it's not, it's just a feature WealthLab has that enables creating Panes to insert various procedures:

Here is just a sample of WealthLab's CreatePane's command which allows creating a Pane and specify the required size for each Pane.
// Aroon -----------------------------------------------------------------------
chartPane := CreatePane( 75, true, true );
PlotSeries( AroonUpSeries( #Close,14 ), chartpane, 050, #Thin );
PlotSeries( AroonDownSeries( #Close,14 ), chartpane, 905, #Thin );
DrawHorzLine( 50, chartPane, 666, 0);

// MACD ------------------------------------------------------------------------
{ This system buys a new position whenever MACD crosses the signal
line from below 0. It sells all open positions when MACD crosses
below the signal line from above 0. }

MACDPane := CreatePane( 75, true, true );
PlotSeries( MACDSeries( #Close ), MACDPane, #blue, #Thick );
MACDSignal := EMASeries( MACDSeries( #Close ), 9 );
PlotSeries( MACDSignal, MACDPane, #red, #Thick );
3- Don't mind, I'm sure we both have benefited from this brain storm.

Cheers and have a good day,,,
 

SavantGarde

Well-Known Member
#14
As Jamaaditya, suggested you can create as many panes as you want and put whatever in each of those.....since you feel lazy about recalling the.. many Panes again.......that is if I have understood it correctly this time.....

Solution would be to save it as Template and all you need to do is recall the Template and you would have all your different Panes...

Saving the chart window as Template is available in Ami


SG
 
#15
As Jamaaditya, suggested you can create as many panes as you want and put whatever in each of those.....since you feel lazy about recalling the.. many Panes again.......that is if I have understood it correctly this time.....

Solution would be to save it as Template and all you need to do is recall the Template and you would have all your different Panes...

Saving the chart window as Template is available in Ami


SG
I don't think you got our discussion point!!!

If you are really in a position to help, PLEASE READ the previous posts carefully.
 
#16
Gee, I donno how to thank you for your consistent effort.
anytime bro !

You see, sometimes it's quite helpful to have some modified indicators merged in one indicator and use it as you please without having to setting them up again. Kana lazy, Lol.
Finally I get it what you want. Unfortunately that thing is currently not possible in AB. but Fortunately a similar recommendation is in the top suggested 'enchancement' (saving the Params by GUI & programmtically, and loading them)

Sorry your suggestion wont solve my problem, GFX is just function like other suggested functions, and as long as there is no function in AB that allow creating separate pane that enables you to put individual indicator procedures I don't think my problem can be solved.
Yes now that I understand your requirement exactly ya I know it will not solve your problem, unless you are willing to give away the leeway by hardcoding the parameters to be used.

may be one final suggestion is, since AB allows easy read/write functions to a file, store the params there and load it, (it will certainly cause it to be relatively slower, but it seems you will be using this more for GUI purposes rather than backtesting so few milliseconds can be spared. just a thought. think about it. If we are not flexible, we are nothing.... (only metaphysically implied )

Now back to your three saying:
1- I'll try the query link you specified, but what do you mean by What are the consequences? Is it that bad? Lol...
yes, that place can be hard (read: cruel) for those asking stupid (i mean stupid from experts perspective) questions and especially those which are put in rather intangible or less verbal ways.

3- Don't mind, I'm sure we both have benefited from this brain storm.
Cheers and have a good day,,,
yes, we are students here and we learn together.

cheers and happy trading
 
Last edited:
#17
I wish Mac would get as popular as PC and people write enough programs so we throw PCs and Microsoft Windows in the trash bin...

It was around 0500 AM, and after putting all my thoughts together replying your post... Bingo I got me a BLUE SCREEN!!! Let me tell you, I HATE Microsoft... For some funny reason it never crashes except when you're in the middle of an important thing!?

I don't know iamaaditya what I wrote, I'm trying to put things together now but I couldn't, it's 0520 AM now and if I stay a minute later I'll collapse, so I better retire to bed and try again some other time.

Have a good one now...