AtCommentaryBar (Reserved Word)

image\trumpet2.gif Disclaimer

This reserved word returns a value of True on the bar clicked by the user. It will return a value of False for all other bars. This allows you to optimize your trading strategies, analysis techniques, and functions for speed, as it will allow EasyLanguage to skip all commentary-related calculations for all bars except for the one where the commentary is requested.

AtCommentaryBar

The difference between CommentaryEnabled and AtCommentaryBar is that CommentaryEnabled returns a value of True for ALL bars when the Analysis Commentary window is open, while the AtCommentaryBar returns a value of True only for the bar clicked with the Analysis Commentary pointer.

Example

The following statements display a 50-bar average of the volume in the Analysis Commentary window but avoid calculating this 50-bar average for every other bar of the chart:

If AtCommentaryBar Then
  
Commentary("The 50-bar vol avg: ", Average(Volume, 50));

Additional Example

More than one statement can be executed on the selected bar by using nested statement syntax:

If AtCommentaryBar Then Begin
  
{Your Commentary Code Here}
End
;