Pause or Temporary Stop AFL Formula Refreshing/Executing

Hi all,

I code a Trading strategy, and it quite heavy now. It's still ok on realtime trading.
However, The problem is when I review this strategy on Chart (with Old Data), I have to take action on the Chart like spaning, clicking, scrolling, zooming,... The Chart Windows is TOO LAGGING.

I tried change RequestTimedRefresh(), but chart is till updated when doing any chart actions.

Is there any way to Pause or Temporary Stop AFL Formula Refreshing/Executing when I need to Review Chart?

Thank you,
Quoting from a KB - When and how often AFL code is executed? :

  1. In a local database, which is not updated by a realtime plugin, the formula would get refreshed if we perform any actions, such as clicking, scrolling, zooming, changing parameters, choosing another symbol or interval, importing new data etc.
  2. In addition to the actions listed in (1), if we are running a plugin-based realtime feed, then the chart is refreshed based on “Intraday refresh interval” defined in Tools –> Preferences –> Intraday. If we enter 0 into this field, then it will result in chart being refreshed with every new tick (up to 10-times per sec).
  3. It is also possible to force certain refresh rate using dedicated RequestTimedRefresh() function in the AFL code:
  4. It is also possible to manually refresh chart (or all chart and windows) using View->Refresh (or View->Refresh All ) menu.

Proof that your code is inefficiently written.

Harmful and wrong approach... The chart needs normal refresh for its proper execution... Instead, with help of Staticvar you can execute a section of your code once - How to run certain piece of code only once. Still hard to comment anything without seeing the code!

Please refer to:

Besides there are some new forum rules in place:

1 Like