SimBot 0.1.8 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/workspace.xml +22 -21
- data/Gemfile.lock +1 -1
- data/lib/SimBot/version.rb +1 -1
- data/lib/wash_trade.rb +12 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d8fce59133a7c4ea4686a6c3a740ac7be618c05d60cb660920ba0c398732256
|
4
|
+
data.tar.gz: 4bc4f345cd5276222fe26f6de90ff8f850bafcbc0e382d0dbc4dd8682f74d5a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '091654b85ea7b9c62cdae5d62f43e255259b448bb999e24262fd5e1a2d10c39f7fc09bd54354fc934091576176cf6f5fb50a70a13e37a34ed109d2ee24ade177'
|
7
|
+
data.tar.gz: 9a29fced29e3e2c18168e45f9487e6ec0677c15d4dbc54db152421ad0dfee50027893236510eb758f62ff7f7e3532005a9958dd7ffac51de227accc2ca291e0f
|
data/.idea/workspace.xml
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
<project version="4">
|
3
3
|
<component name="ChangeListManager">
|
4
4
|
<list default="true" id="d905eaf2-5cab-434b-a4d1-1ccf165356a4" name="Default" comment="">
|
5
|
+
<change beforePath="$PROJECT_DIR$/Gemfile.lock" beforeDir="false" afterPath="$PROJECT_DIR$/Gemfile.lock" afterDir="false" />
|
5
6
|
<change beforePath="$PROJECT_DIR$/lib/SimBot/version.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/SimBot/version.rb" afterDir="false" />
|
6
7
|
<change beforePath="$PROJECT_DIR$/lib/utils.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/utils.rb" afterDir="false" />
|
7
8
|
<change beforePath="$PROJECT_DIR$/lib/wash_trade.rb" beforeDir="false" afterPath="$PROJECT_DIR$/lib/wash_trade.rb" afterDir="false" />
|
@@ -51,7 +52,7 @@
|
|
51
52
|
<entry file="file://$PROJECT_DIR$/lib/SimBot/version.rb">
|
52
53
|
<provider selected="true" editor-type-id="text-editor">
|
53
54
|
<state relative-caret-position="23">
|
54
|
-
<caret line="1" column="
|
55
|
+
<caret line="1" column="19" selection-start-line="1" selection-start-column="19" selection-end-line="1" selection-end-column="19" />
|
55
56
|
</state>
|
56
57
|
</provider>
|
57
58
|
</entry>
|
@@ -69,11 +70,11 @@
|
|
69
70
|
</split-first>
|
70
71
|
<split-second>
|
71
72
|
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
72
|
-
<file leaf-file-name="utils.rb" pinned="false" current-in-tab="
|
73
|
+
<file leaf-file-name="utils.rb" pinned="false" current-in-tab="false">
|
73
74
|
<entry file="file://$PROJECT_DIR$/lib/utils.rb">
|
74
75
|
<provider selected="true" editor-type-id="text-editor">
|
75
|
-
<state relative-caret-position="
|
76
|
-
<caret line="
|
76
|
+
<state relative-caret-position="92">
|
77
|
+
<caret line="4" column="24" lean-forward="true" selection-start-line="4" selection-start-column="24" selection-end-line="4" selection-end-column="24" />
|
77
78
|
</state>
|
78
79
|
</provider>
|
79
80
|
</entry>
|
@@ -105,11 +106,11 @@
|
|
105
106
|
</provider>
|
106
107
|
</entry>
|
107
108
|
</file>
|
108
|
-
<file leaf-file-name="wash_trade.rb" pinned="false" current-in-tab="
|
109
|
+
<file leaf-file-name="wash_trade.rb" pinned="false" current-in-tab="true">
|
109
110
|
<entry file="file://$PROJECT_DIR$/lib/wash_trade.rb">
|
110
111
|
<provider selected="true" editor-type-id="text-editor">
|
111
|
-
<state relative-caret-position="
|
112
|
-
<caret line="
|
112
|
+
<state relative-caret-position="222">
|
113
|
+
<caret line="41" column="9" lean-forward="true" selection-start-line="41" selection-start-column="9" selection-end-line="41" selection-end-column="9" />
|
113
114
|
</state>
|
114
115
|
</provider>
|
115
116
|
</entry>
|
@@ -147,8 +148,8 @@
|
|
147
148
|
<option value="$PROJECT_DIR$/lib/Deamons/deamon.rb" />
|
148
149
|
<option value="$PROJECT_DIR$/lib/Deamons/wash_trade.rb" />
|
149
150
|
<option value="$PROJECT_DIR$/lib/SimBot.rb" />
|
150
|
-
<option value="$PROJECT_DIR$/lib/wash_trade.rb" />
|
151
151
|
<option value="$PROJECT_DIR$/lib/utils.rb" />
|
152
|
+
<option value="$PROJECT_DIR$/lib/wash_trade.rb" />
|
152
153
|
<option value="$PROJECT_DIR$/lib/SimBot/version.rb" />
|
153
154
|
</list>
|
154
155
|
</option>
|
@@ -264,25 +265,25 @@
|
|
264
265
|
<updated>1525279604835</updated>
|
265
266
|
<workItem from="1525279607229" duration="36216000" />
|
266
267
|
<workItem from="1528301072964" duration="35313000" />
|
267
|
-
<workItem from="1528709208580" duration="
|
268
|
+
<workItem from="1528709208580" duration="8755000" />
|
268
269
|
</task>
|
269
270
|
<servers />
|
270
271
|
</component>
|
271
272
|
<component name="TimeTrackingManager">
|
272
|
-
<option name="totallyTimeSpent" value="
|
273
|
+
<option name="totallyTimeSpent" value="80284000" />
|
273
274
|
</component>
|
274
275
|
<component name="ToolWindowManager">
|
275
276
|
<frame x="1440" y="22" width="1615" height="1058" extended-state="0" />
|
276
277
|
<editor active="true" />
|
277
278
|
<layout>
|
278
|
-
<window_info
|
279
|
+
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.22759059" />
|
279
280
|
<window_info anchor="bottom" id="TODO" order="6" />
|
280
281
|
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
|
281
282
|
<window_info anchor="bottom" id="Event Log" order="7" sideWeight="0.50380623" side_tool="true" weight="0.28540304" />
|
282
283
|
<window_info anchor="right" id="Database" order="3" />
|
283
284
|
<window_info anchor="bottom" id="Database Changes" order="7" show_stripe_button="false" />
|
284
285
|
<window_info anchor="bottom" id="Version Control" order="7" />
|
285
|
-
<window_info anchor="bottom" id="Run" order="2" sideWeight="0.48719722" weight="0.28540304" />
|
286
|
+
<window_info active="true" anchor="bottom" id="Run" order="2" sideWeight="0.48719722" visible="true" weight="0.28540304" />
|
286
287
|
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
287
288
|
<window_info anchor="bottom" id="Terminal" order="7" sideWeight="0.49619377" weight="0.41463414" />
|
288
289
|
<window_info id="Favorites" order="2" side_tool="true" />
|
@@ -528,31 +529,31 @@
|
|
528
529
|
</state>
|
529
530
|
</provider>
|
530
531
|
</entry>
|
531
|
-
<entry file="file://$PROJECT_DIR$/lib/
|
532
|
+
<entry file="file://$PROJECT_DIR$/lib/SimBot.rb">
|
532
533
|
<provider selected="true" editor-type-id="text-editor">
|
533
|
-
<state relative-caret-position="
|
534
|
-
<caret line="
|
534
|
+
<state relative-caret-position="669">
|
535
|
+
<caret line="39" column="7" lean-forward="true" selection-start-line="39" selection-start-column="7" selection-end-line="39" selection-end-column="7" />
|
535
536
|
</state>
|
536
537
|
</provider>
|
537
538
|
</entry>
|
538
539
|
<entry file="file://$PROJECT_DIR$/lib/utils.rb">
|
539
540
|
<provider selected="true" editor-type-id="text-editor">
|
540
|
-
<state relative-caret-position="
|
541
|
-
<caret line="
|
541
|
+
<state relative-caret-position="92">
|
542
|
+
<caret line="4" column="24" lean-forward="true" selection-start-line="4" selection-start-column="24" selection-end-line="4" selection-end-column="24" />
|
542
543
|
</state>
|
543
544
|
</provider>
|
544
545
|
</entry>
|
545
|
-
<entry file="file://$PROJECT_DIR$/lib/
|
546
|
+
<entry file="file://$PROJECT_DIR$/lib/wash_trade.rb">
|
546
547
|
<provider selected="true" editor-type-id="text-editor">
|
547
|
-
<state relative-caret-position="
|
548
|
-
<caret line="
|
548
|
+
<state relative-caret-position="222">
|
549
|
+
<caret line="41" column="9" lean-forward="true" selection-start-line="41" selection-start-column="9" selection-end-line="41" selection-end-column="9" />
|
549
550
|
</state>
|
550
551
|
</provider>
|
551
552
|
</entry>
|
552
553
|
<entry file="file://$PROJECT_DIR$/lib/SimBot/version.rb">
|
553
554
|
<provider selected="true" editor-type-id="text-editor">
|
554
555
|
<state relative-caret-position="23">
|
555
|
-
<caret line="1" column="
|
556
|
+
<caret line="1" column="19" selection-start-line="1" selection-start-column="19" selection-end-line="1" selection-end-column="19" />
|
556
557
|
</state>
|
557
558
|
</provider>
|
558
559
|
</entry>
|
data/Gemfile.lock
CHANGED
data/lib/SimBot/version.rb
CHANGED
data/lib/wash_trade.rb
CHANGED
@@ -4,6 +4,7 @@ module Deamons
|
|
4
4
|
class WashTrade
|
5
5
|
require 'utils'
|
6
6
|
def initialize(api, market, freq)
|
7
|
+
@g_count = 1
|
7
8
|
@api = api
|
8
9
|
@market = market
|
9
10
|
@freq = freq
|
@@ -21,7 +22,7 @@ module Deamons
|
|
21
22
|
count = 0
|
22
23
|
loop do
|
23
24
|
vol = rand(0.2...3)
|
24
|
-
price =
|
25
|
+
price = move_price
|
25
26
|
@api.post_order(@market, price, vol, 'sell')
|
26
27
|
delay = (1.00 / @freq)
|
27
28
|
sleep(delay)
|
@@ -33,6 +34,16 @@ module Deamons
|
|
33
34
|
puts e
|
34
35
|
end
|
35
36
|
|
37
|
+
def move_price
|
38
|
+
range = 1.015
|
39
|
+
if @g_count > 100
|
40
|
+
range = rand(1.005...1.010)
|
41
|
+
@g_count = 0
|
42
|
+
end
|
43
|
+
@g_count += 1
|
44
|
+
Utils.quote(@market) * rand(1.003...range)
|
45
|
+
end
|
46
|
+
|
36
47
|
# Attempts to write the pid of the forked process to the pid file.
|
37
48
|
def write_pid_file(pid, pidfile)
|
38
49
|
File.open pidfile, "w" do |f|
|