[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: Discussion about Params, hierarchical, conditional, tricks...



PureBytes Links

Trading Reference Links

Hi,

Sorry to respond with criticism of my own post so soon, but one of  
the things I do not like about my new Params methods is that when a  
new chart is started, a new set of param files have to be created,  
and the only way to initialize them to their defaults is to open  
every level (which can be tricky with a lot of sub menus) and click  
the reset all open params.  I would like to be able to just start out  
with everything initialized by a single "Reset ALL" button.

I can do that easily enough.  However, I did not want to give up the  
ability to also reset only the open params.  Doing both means that I  
would have to supply the default values in two different places in  
the AFL.  I really only wanted to specify the default value in one  
place to remove possible errors --so I would have to assign another  
bunch of intermediate variables just to hold default values.

The reason I am mentioning this is because I want to publish this in  
the UKB, but I want to do it right the first time that covers all the  
bases with a solution that is simple to use.  I wanted to get some  
other takes or implementation ideas on this reset to default issue  
before I do a lot of rewriting of my AFL and examples.

Just to recap, the form that a param takes is two parts.  The first  
reference is the one that always reads in the param value every AFL  
pass (first pass from a file, other passes from a static variable).   
The second reference is made inside some conditional AFL and is  
executed only if the param is open in the Parameters window.  The new  
form would look like:

myParamVar = GetParamVar("ParamName", defaultxxx=default);  //this  
default on for Reset ALL Params

if (thisMenuIsOpen)
{
	myParamVar = Param2("paramName", "ButtonText", defaultxxx, minVal,  
maxVal, stepVal);  //this default on for Reset Visible Params
}

Comments?

Best regards,
Dennis

On Sep 8, 2007, at 12:13 AM, Dennis Brown wrote:

> Thanks for your interest.
>
> I created and uploaded an Example AFL to the AmiBroker Library under
> the name:
> Flexible Parameter Layouts Version 2.0
>
> Enjoy, and please give feedback for improvements.
>
> Best regards,
> Dennis
>
> On Sep 7, 2007, at 12:53 PM, Dennis Brown wrote:
>
>> Experienced AFL Scripters,
>>
>> I have completed coding a complete replacement set of AFL Param...()
>> functions that save the parameters in files and allow hierarchical
>> menus including conditional menus (like if different ParamList()
>> selections need to show additional or different parameters).  It also
>> remembers the last state of the open menus.
>>
>> They look just like the old param... statements, except with the
>> addition of a name for the saved parameter, and there are some
>> differences with how they are used in the AFL structure.
>>
>> It requires installing the free AutoIt (see below) to function
>> properly (AutoIt installs a COM that lets AFL push the "Reset all"
>> button on the parameters window).
>>
>> You can not successfully mix old style and new style params in the
>> same set window (because the new ones will keep resetting the old
>> ones to default values),
>>
>> The new top level menus do not have the nice darker tan color of the
>> original.
>>
>> I will go to the effort of uploading an example set of these if
>> anyone is interested in using or playing with them.
>> However, only more experienced AFL scripters should attempt to use
>> these.
>>
>> Just let me know.
>>
>> (I attached a couple of screen shots to the end of this email for
>> those who get the email version)
>>
>> Dennis
>>
>>
>> On Aug 15, 2007, at 11:51 PM, Dennis Brown wrote:
>>
>>> Bruce,
>>>
>>> Thank you.  This is great!
>>>
>>> I have it running and I am recoding my params AFL logic to take
>>> advantage of single click operation (since the second click is
>>> automatic now).  This opens up a lot of other things I wanted to do
>>> with the UI but could not do it with AFL before.
>>>
>>> Stay tuned!
>>> Thanks again,
>>>
>>> Dennis
>>>
>>> On Aug 15, 2007, at 8:43 PM, bruce1r wrote:
>>>
>>>> AFL code fragment -
>>>>
>>>> autoit = CreateStaticObject( "AutoItX3.Control" );
>>>> if ( ! IsNull( autoit ) )
>>>> {
>>>>      rc = autoit.controlclick( "Properties of:", "Reset all",  
>>>> 403 );
>>>> }
>>>>
>>>>
>>>> AutoItX COM control can be found at -
>>>>
>>>> http://www.autoitscript.com/autoit3/downloads.php
>>>>
>>>>
>>>>
>>>> --- In amibroker@xxxxxxxxxxxxxxx, Dennis Brown <see3d@xxx> wrote:
>>>>>
>>>>> Tomasz,
>>>>>
>>>>> Thank you for your comments.  That helps me understand how far I
>>>>> might take this idea on my own.
>>>>> I appreciate that you are open minded about how people may use
>>>>> AB in
>>>>> ways not originally intended.
>>>>>
>>>>> A question for you or anyone else:
>>>>> I am not a Windows programmer (I run everything on Macs --I use a
>>>>> virtual XP for AB).
>>>>> I was wondering if it is possible for AFL (perhaps through a
>>>>> DLL) to
>>>>> click the Parameter Window "Reset all" button for me?
>>>>> (short of a robotic mouse of course)
>>>>>
>>>>> Thank you,
>>>>> Dennis
>>>>>
>>>>> On Aug 15, 2007, at 11:29 AM, Tomasz Janeczko wrote:
>>>>>
>>>>>> Param window was designed to be used as parameters for indicators
>>>>>> exactly the way as
>>>>>> formulas shipped with AmiBroker use them. And that won't be
>>>>>> changed.
>>>>>>
>>>>>> You are free however to (ab)use it in any other way you want :-)
>>>>>> Here is the beauty of AmiBroker that it actually allows to be  
>>>>>> used
>>>>>> in ways that were not
>>>>>> originally designed for unlike products from other, bigger
>>>>>> companies that usually
>>>>>> apply the design of "the program knows better than you".
>>>>>>
>>>>>> I am often asked why program "does not prevent from doing this or
>>>>>> that". And the answer
>>>>>> is the flexibility - you can do what you want as long as you know
>>>>>> what you are doing.
>>>>>>
>>>>>> Best regards,
>>>>>> Tomasz Janeczko
>>>>>> amibroker.com
>>


Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/