-
Notifications
You must be signed in to change notification settings - Fork 4
/
sample-eth-btc.yml
155 lines (140 loc) · 3.21 KB
/
sample-eth-btc.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# YATA.BOT SAMPLE
# Sample ETH/BTC bot to trade RSI crosses - using a dataset on file
# Playbook schema version, required
version: 1
# Paper trading (default is `true`)
# WARNING: Set to `false` for real transactions
# dryrun: false
# Will test the entire bredth of a chart dataset, instead of the leading edge.
# Derived from provided data; `windowTime`, `candleTime`, scenario condition size.
# NOTE: This currently works by testing complete candles within a timeframe,
# not the evolution of candles.
backtest: true
# Analysis
analysis:
rsi14:
config:
inRealField: candle.close
optInTimePeriod: 14
type: RSI
# Assets
asset:
btc:
# label: Bitcoin
symbol: BTC
eth:
# label: Ethereum
symbol: ETH
# Charts
chart:
ethBtcKraken4h:
datasetFile: test/Kraken-ETHBTC-2023-01-02-13-04-20.json
pair: ethBtcKraken
pollTime: 5s # Five seconds
candleTime: 4h # Four hours
# Exchanges
exchange:
# paper:
paper:
class: Paper
# Optional override the item `name`
# Be careful to use unique values,
# or you may run into strange problems
name: paper
# Orders
order:
ethBtcKrakenBuy:
# dryrun: true
pair: ethBtcKraken
side: buy
type: market
quantity: 10%
ethBtcKrakenSell:
# dryrun: true
pair: ethBtcKraken
side: sell
type: market
quantity: 10%
# Pairs
pair:
ethBtcKraken:
a: eth
b: btc
exchange: paper
# Scenarios
scenario:
rsi14BearishOverbought:
analysis:
- rsi14
condition:
- # Previous candle
- [rsi14.outReal, '>=', 70]
- # Latest candle
- [rsi14.outReal, '<=', 70]
rsi14BullishOversold:
analysis:
- rsi14
condition:
- # Previous candle
- [rsi14.outReal, '<=', 30]
- # Latest candle
- [rsi14.outReal, '>=', 30]
# Storage
storage:
file: # Default
class: File
# redis: # Currently supports localhost
# class: Redis
# Strategies
strategy:
rsi14BearishOverbought:
action:
# Optional second parameter strategy
# Executed whenever the scenario matches
# i.e. [scenario, strategy]
- [rsi14BearishOverbought]
analysis:
- rsi14
chart: ethBtcKraken4h
rsi14BullishOversold:
action:
# Optional second parameter strategy
# Executed whenever the scenario matches
# i.e. [scenario, strategy]
- [rsi14BullishOversold]
analysis:
- rsi14
chart: ethBtcKraken4h
# Subscriptions
subscription:
ethBtcKrakenSubscription:
# See `eth-btc-mockup.ts`
action:
- actionEthBtcBuy
chart: ethBtcKraken4h
# match: all # Action everytime seen
match: new # Default, action once when first seen
condition:
- [total, '>=', 1]
timeframeAny:
- rsi14BullishOversold
ethBtcKrakenSell:
action:
- actionEthBtcSell
chart: ethBtcKraken4h
condition:
- [total, '>=', 1]
timeframeAny:
- rsi14BearishOverbought
# Timeframes
timeframe:
rsi14BearishOverbought:
intervalTime: 0 # Default, run once
strategy:
- rsi14BearishOverbought
windowTime: 10d # Ten days
rsi14BullishOversold:
intervalTime: 0 # Default, run once
strategy:
- rsi14BullishOversold
windowTime: 10d # Ten days