Yes, but different syntax required.
IIf is an assignment type statement. Try
this:
b_plot = ParamToggle("Plot Bands","1(y)
or 0(n)",1); //Toggles between two states. Sets b_plot to True or False
if (b_plot) Plot(BT,"BT",colorBlack,styleThick); else Plot(BT,"BT",colorBlack,styleNoLine);
if (b_plot) Plot(BB,"BB",colorBlack,styleThick); else Plot(BB,"BB",colorBlack,styleNoLine);
Note: I may have your conditions listed
backwards since I can’t tell which plot is which from your code. If you
get opposite results than expected just reverse the text in the paramToggle to:
"0(n) or 1(y)"
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Rakesh Sahgal
Sent: Saturday, September 03, 2005
06:01
To: Amibroker Yahoogroup
Subject: [amibroker] Plot
Statements control via Param - Possible?
Hi All,
Is it possible to control the plot statements via Param commands. If so, is the
following code correct?
b_plot=Param("Plot Bands-1(y)0(n)",0,0,1);
b_p=IIf(b_plot==1,Plot(BT,"BT",colorBlack,styleThick),Plot(BT,"BT",colorBlack,styleNoLine));
b_p=IIf(b_plot==1,Plot(BB,"BB",colorBlack,styleThick),Plot(BB,"BB",colorBlack,styleNoLine));
The only purpose of the exercise is to unclutter the chart and have an option
to plot the bands without having to resort to code ammendments etc or fresh
indicator insertions.
TIA for any help.
Regards
Rakesh
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 other support material please check also:
http://www.amibroker.com/support.html
YAHOO! GROUPS LINKS