How to maintain 2 versions (chart vs explore)

Dear Experts,

Right now if I have a AFL that can be used for exploration as well as plots the chart, I keep 2 copies of the program and But if make a change I have to keep track of changes in the other as well which is inconvenient. I recently started using a param
pseudo code:
if (chart){
plot ()
else {
Filter = buy or sell;
Using parameter setting I am using single afl for both charting and exploration. How do you people do this ? Is there a better approach?

Any help or pointers are highly appreciated.


Please read Status() and may be use something like this:

Rest of your code
action = Status( "action" );
switch( action ) {
	 case actionIndicator:
		 // Things for charts
	 case actionExplore:
		 // Things for explorations

Quoting from same function guide:

Status("action") will always return actionIndicator and Status("actionex") will either return actionExInterpret (when chart pane has focus and intepretation window is visible) or actionIndicator otherwise (when pane does not have focus or interpretation is NOT visible). Be careful NOT to disable Plot() depending on Status("actionex") code. If you really think you need to execute Plot() conditionally you should only check for Status("action")==actionIndicator.

So depending on what you're procuring, either Status( "action" ) or Status( "actionex" ) is required to be chosen.