This repository has been archived by the owner on Jul 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathbacktester.lua
59 lines (42 loc) · 1.71 KB
/
backtester.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
-- The tested strategy.
strategy = "MaCross"
-- Path to the parameters file for the strategy.
strategyParams = "data/params/MaCross-backtest.lua"
-- Ask user confirmation before launching the backtest.
confirmLaunch = true
-- If false, only the start parameters will be used with one thread.
optimizationMode = false
-- What paramters generator to use ("genetic" coming later) (optmization mode only).
-- Choices: "complete"
paramsGenerator = "complete"
-- How to sort the results and find the best generated parameters.
-- Choices: "profit"
resultRanking = "profit"
-- If true, show the details of each trade at the end (non-optimization mode only).
showTradeDetails = true
-- If true, log every trade action in real time (buy/sell/adjust/close).
showTradeActions = true
-- Number of threads used for the test (optimization mode only).
threads = 3
-- Source bars.
history = "data/history/EURUSD_MetaQuotes_2011-10-31_2011-11-04.csv"
pair = "EURUSD" -- Two 3 characters currencies ISO 4217.
digits = 5
maxGapSize = 60 -- Generate up to X 1 minute bars before creating a gap in history.
-- Deposit in units of the counter currency.
deposit = 10000
-- Period in minutes.
period = 1
-- Spread in pips.
spread = 1.3
-- Minimal offset in pips between current price and target SL/TP price for opening and adjusting positions.
minPriceOffset = 5
-- false -> Maximum tick generation (up to 12 per 1-minute bar).
-- true -> Simple and faster tick generation (up to 4 per 1-minute bar).
fewerTicks = false
-- If true, the 2 plot files will be generated (non-optimization mode only).
plotOutput = true
-- Path to the plot data file.
plotDataFile = "backtest-result.dat"
-- Path to the plot settings file.
plotSettingsFile = "backtest-result.plt"