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

Re: [amibroker] Passing Param to Plot



PureBytes Links

Trading Reference Links

The list just returns text, you need to add definition of what the
text represents
Assuming the list is the same as indicator variables

Indicator = ParamList("Indicators",
"Close|OverSoldIndicator|OverBoughtIndicator" );

if( Indicator == "OverSoldIndicator" ) PlotIndicator = OverSoldIndicator;
else if( Indicator == "OverBoughtIndicator" ) PlotIndicator =
OverBoughtIndicator;
else PlotIndicator = Close;

Plot( PlotIndicator, _DEFAULT_NAME(), ParamColor( "Color",colorCycle
), ParamStyle("Style", styleLine) );

I am using IF without a loop here because the variable being checked
is not an array
Otherwise you could write it using IIF, but if the list is long then
counting brackets can be tiresome

PlotIndicator = iif( Indicator == "OverSoldIndicator", OverSoldIndicator,
                      iif( Indicator == "OverBoughtIndicator",
OverBoughtIndicator,
                      Close));

-- 
Cheers
Graham Kav
AFL Writing Service
http://www.aflwriting.com


2008/7/2 tipequity <l3456@xxxxxxxxxx>:
> Do you see the following code produces error? It point to ParamStyle
> and says Argument#1 has incorrect type. TIA
>
> PlotIndicator = ParamList
> ("Indicators", "Close|OverSoldIndicator|OverBoughtIndicator" );
>
> Plot( PlotIndicator, _DEFAULT_NAME(), ParamColor( "Color",
> colorCycle ), ParamStyle("Style", styleLine) );
>
>
>

------------------------------------

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/