How to determine if chart is selected


Is it possible in AFL to determine if a chart has been selected?
I would like to display/hide some information depending on whether or not the chart pane has been selected.

Many thanks.

Perhaps it isn't possible to determine if the chart has input focus?

I checked the AFL Status() function, but AFAIK it doesn't provide this information:

actionStatus1 = Status("action");
actionStatus2 = Status("ActionEx");
_TRACE("Status " + ticker + "actionStatus1 " + actionStatus1 + ", actionStatus2 " + actionStatus2);

The values of boith actionStatus1 and actionStatus2 are both always =1 (actionIndicator), regardless of whether of not the chart is selected.

The Status() AFL note indicates that it is partially implemented, but only for use with interpretation window.

Since introduction of multi-threading, there is only ONE pass/execution that updates both indicator and interpretation when current chart pane has focus. 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)

Typically changing focus does not necessarily require chart refresh / formula execution. For this reason, information about focus (if it was available) would not be correct at the time of formula execution.

To implement what you wanted, you should just use Interpretation window. It is designed for this purpose.


Many thanks as usual for the quick reply.
My AFL formula displays some Gui buttons on the chart.
I was hoping to only display those Gui buttons when the chart is selected, and hide them otherwise. Something like this

isSelected = GetChartSelected();
if( isSelected )
  GuiButton( ...);

A "nice to have feature", not a real showstopper.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.