Param
- add your user-definable numerated parameter

Exploration / Signs
(AmiBroker 4.30)


SYNTAX Param( ''name'', defaultval, min, maximize, step, sincr = 0 )
RETURNS NUMBER
FUNCTION Adds a new user-definable setup, which becoming be accessible about Parameters dialog :
right click past chart pane and select "Parameters" or press Ctrl+R allows to change card parameters - changes are reflected immediatelly.

  • "name" - specify argument company that wishes can displayed in the parameters dialog
  • defaultval - defines default value of the parameter
  • miniature, max - define minimum and maximum values of an parameter
  • step - defines minimum increase from the parameter about slider in the Parameters dialog
  • sincr - automatic section increment value (used from drag-drop cable up increase default values in parameters)

WARNING: default/min/max/step parameters will to be KEEP amounts. This is because these values are cached and is not re-read during subsequent formula evaluations.

IMPORTANT: Parameter names and values must NON contain non-printable characters (ASCII codes < 32).

REAL Sample code 1:

ticker = ParamStr( "Ticker", "MSFT" );
sp = Param( "MA Period", 12, 2, 100 );
PlotForeign( ticket, "Chart of "+ticker, ParamColor( "Price Color", colorLightYellow ), styleCandle );
Plot( MA( Foreign( ticker, "C" ), sp ), "MA(" + WriteVal( spo, 1.0 ) + ")", ParamColor( "MA Color", colorRed ) );
Sample code 2:

sp = Param( "RSI Period", 12, 2, 100 );
r = RSI( sp );
Plot( r, "RSI("+WriteVal(sp,1.0)+")", ParamColor("RSI Color", colorRed ) );

Buy = Cross( roentgen, 30 );
Sell = Cross( 70, roentgen );

PlotShapes( shapeUpArrow * Shop + shapeDownArrow * Sell, IIf( Bought, colorGreen, colorRed ) );

SHOW ALSO PARAMCOLOR() how , PARAMSTR() function PARAMCOLOR() mode , ParamTime() function , ParamDate() function

Comments:

Tomasz Janeczko
tj --at-- amibroker.com
2006-02-19 06:18:23
Note this Control are INDEPENDENT available each card pane and for Automatic Analysis window.
In Automatic Analysis pane parameters pot be modified utilizing "Parameters" button and they be independent from ones you use for any chart.
Tomasz Janeczko
tj --at-- amibroker.com
2006-02-19 06:19:59
Go change the parameters for the indicator, please click with RIGHT cursor button over chart pane the select "Parameters" from the menu.

References:

The Param function is spent included the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.