Difference between revisions of "AtCommentaryBar"

From MultiCharts
Jump to navigation Jump to search
 
Line 1: Line 1:
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 PowerLanguage to skip all commentary-related calculations for all bars except for the one where the commentary is requested
+
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.  
  
'''Usage'''
+
This allows you to optimize your trading strategies, analysis techniques, and functions for speed, as it will allow PowerLanguage to skip all commentary-related calculations for all bars except for the one where the commentary is requested
<syntaxhighlight>
 
AtCommentaryBar
 
</syntaxhighlight>
 
  
'''Notes'''
+
== Usage ==
 +
<syntaxhighlight>AtCommentaryBar</syntaxhighlight>
  
The difference between [[AtCommentaryBar]] and [[CommentaryEnabled]] is that [[CommentaryEnabled]] returns a value of True for ''ALL'' bars when the Expert Commentary window is open, while the [[AtCommentaryBar]] returns a value of True only for the bar clicked.
+
== Notes ==
 +
* The difference between [[AtCommentaryBar]] and [[CommentaryEnabled]] is that [[CommentaryEnabled]] returns a value of True for ''ALL'' bars when the Expert Commentary window is open, while the [[AtCommentaryBar]] returns a value of True only for the bar clicked.
  
'''Example'''
+
== Example ==
 +
The following statements display a 50-bar average of the volume in the [[:Category:Expert_Commentary|Expert Commentary]] window but avoid calculating this 50-bar average for every other bar of the chart:
  
The following statements display a 50-bar average of the volume in the '''Expert Commentary''' window but avoid calculating this 50-bar average for every other bar of the chart:
 
 
<syntaxhighlight>
 
<syntaxhighlight>
If AtCommentaryBar Then
+
if AtCommentaryBar = True then
Commentary("The 50-bar vol avg: ", Average(Volume, 50));
+
    Commentary("The 50-bar vol avg: ", Average(Volume, 50));
 
</syntaxhighlight>
 
</syntaxhighlight>
  
  
 
[[Category:Expert Commentary]]
 
[[Category:Expert Commentary]]

Latest revision as of 05:42, 3 April 2013

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 PowerLanguage to skip all commentary-related calculations for all bars except for the one where the commentary is requested

Usage

AtCommentaryBar

Notes

Example

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

if AtCommentaryBar = True then 
    Commentary("The 50-bar vol avg: ", Average(Volume, 50));