Strategy Debugger

From FxCodeBaseWiki
Jump to: navigation, search

Strategy Debugger

The Strategy Debugger is located in the root folder of the SDK and is called luadbg1.exe. You can use the shortcut "Strategy Debugger" created in Start->Programs->IndicoreSDK.

You can use the Strategy Debugger to:

  • Execute a strategy step-by-step (Debugging Strategy)
  • Check strategy performance
  • Backtest a strategy over a long historical period
  • Optimize strategy parameters
  • Compile a strategy

File Locations

In the default configuration:

  • The price data is located in the data subfolder of the IndicoreSDK folder.
  • User strategies are located in the strategies subfolder of the IndicoreSDK folder.
  • Standard strategies are located in the strategies\standard folder of the IndicoreSDK folder.

You can change default folder locations in Lua Editor configuration.

Using Debugger

Debugging Strategy

For common debugging, see Lua Debugging.

For strategy specific issues, see Debugging Strategy.

Check Strategy Performance/Backtesting

Performance

Performance is an ability of a strategy to process a lot of data fast. You cannot estimate real performance when you debug a strategy because running strategies in the debugging mode has a big overhead and is much slower than the real execution of the same strategies in Marketscope.

Strategy performance can be checked using the Check Performance/Backtest command (Tools->Check Performance/Backtest). Strategy configuration is the same as for Debugging Strategy. The debugger executes the strategy as quickly as Marketscope and prints statistics into the Output page of the debugger.

Recommended performance for bar strategies: not less than 20,000 bars per second. This will provide just 15 seconds of testing of the strategy over 1 year even if the strategy is applied on 1-minute data.

Recommended performance for tick strategies: not less than 50,000 ticks per second. This will provide just 60 seconds (one minute) of testing of the strategy over 1 year even if the market is simulated on 1-minute data.

See also Strategy Optimization.

Backtesting

Backtesting is collecting trading statistics when a strategy is executed over a chosen period (for example, 1 year). As for the performance testing, the debugging mode is too slow for backtesting, so in order to check the performance for a long period, you need to run it in Marketscope-alike execution mode, without the debugging overhead.

In backtesting, you cannot see the step-by-step execution, only the final result, but you still have the statistics and chart.

Backtesting is always performed by default when you check the strategy performance.

For details, see Backtesting Strategy.

Parameter Optimizer

The parameter optimizer is used for finding the best set of parameters for running a strategy over a chosen period. Optimizing is basically running many backtests and choosing the parameters which have produced best results.

Parameter optimization can be executed using the Optimize command (Tools->Optimize).

For details, see Optimizing Strategy Parameter.

Compiling Strategy

A strategy can be distributed in two forms:

  • As source code (just .lua and, optionally, .rc file).
  • As a compiled (.bin) file.

If the strategy is distributed as a compiled file, other users cannot see or change its code. Compilation does not affect further performance of the strategy because exactly the same LuaJIT (just-in-time) compiler is used to execute Lua code. The compilation of the code into a virtual machine is much faster than data loading, so there is no effect even during strategy loading. So, the only reason to compile is to hide the source code to protect your business idea or to prevent others from changing the code.

This Article in Other Languages

Language: English  • español • français • русский • 中文 • 中文(繁體)‎