Quick-tip 61 | Change text object when close greater than close of the previous bar

3 years ago
12

_Quick-tip 61 is a TradeStation EasyLanguage tutorial for TradeStation 10.

The object of Quick-tip 61 is to draw some text on the chart when the close of a bar is greater than the close of the previous bar. When the close is less than or equal to the close of the previous bar no text should be drawn.

When the ‘problem code’ below was used, the text was permanently displayed on the chart, irrespective of whether the closing price was greater than the close of the previous bar or not.

In fact, the ‘problem code’ was redrawing the text every tick where the current close was greater than the close of the previous bar. The print log displays the count of the text objects drawn.

The modified code creates and draws the text object once using a once statement. For every tick following the text string is modified depending on whether close is greater than the close of the previous bar.

https://markplex.com/free-tutorials/tradestation-easylanguage-quicktips/quick-tip-61-change-text-object-when-close-greater-than-close-of-the-previous-bar/

Loading comments...