This algorithm was developed to save the history of market data. This is useful when you want to analyze your trades or develop a new strategy based on past data. The flexible settings of the algorithm will help you to enable/disable selected markets or markets individually.
IMPORTANT: For the algorithm to work, you must enable the archiving of market data in the general settings of the MoonTrader!
To add a new algorithm, click the «Add Algorithm» button on the «Algorithms» tab. The following pop-up window will appear:
Select Markets Saver.
General:
- Info: specify the name of your algorithm in order to easily identify it in the full list of algorithms. For convenience, you can specify parameters in the name, for example — «Saver USDT» or «Saver BTCUSDT/ETHUSDT».
- Auto start: the on/off switch allows the user to choose whether the algorithm will start automatically after the kernel starts.
Market Filters:
- Market type: allows the user to select the desired market type for saving history: Spot/USDT-M/COIN-M.
- Quote Assets: quoted asset (e.g. usdt or btc). If you want to save tick data of the whole market to Tether currency, specify usdt and press Enter.
- Whitelist: «Whitelist» currency pairs. If you fill out this field, you should leave the «Combined by Quotation Pair» item blank! Suppose you want to save history for only two pairs BTCUSDT and ETHUSDT, specify them in this field separated by comma. You will not save ticks at other pairs. The format is btcusdt, ethusdt, etc..
- Blacklist: «blacklisted» currency pairs. Let’s say you specified the quoted asset usdt in «United by Quotable Pair», but don’t want to save history on «volume» pairs BTCUSDT and ETHUSDT, then specify them separated by comma. The format is btcusdt, ethusdt, etc.
Next, be sure to enable the archiving of market data in the general settings!
To do this, go to the MoonTrader main window and select Settings —> Core Profile —> Trade archive
- Trade archive enabled: allows the user to enable/disable history archiving. The checkbox must be enabled for the Markets Saver algorithm to work! It also saves tick history in case you have an open position or just a chart window.
- Max Ram load: specify the maximum amount of RAM to use. This volume is used as a memory buffer for subsequent recording to disk. It is not recommended to specify a low value, because there will be frequent load on the CPU. Optimal is 30% of the total amount of RAM.
- Tradearchive auto clean-up: allows the user to enable/disable automatic deletion of archives with market data.
- Max store time on disk: specify the storage time for market data. If you specify a large number of days, the archive may take up all free space on the hard disk.