-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathpbgui_help.py
More file actions
2377 lines (2000 loc) · 84.8 KB
/
pbgui_help.py
File metadata and controls
2377 lines (2000 loc) · 84.8 KB
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
assigned_balance = """
```
assigned_balance overriding balance fetched from exchange
On spot market it is recommended to fix wallet balance to a given value.
This because in spot trading there are no positions, no wallet balance
and no unrealized PnL. There is only plain buy and sell.
So wallet balance and position must be simulated by looking in past user
trade history.
```"""
price_distance_threshold = """
```
only create limit orders closer to price than threshold. default=0.5 (50%)
The grid is exactly the same it just does not place the buy/sell orders
which are far away from the current price. When the price moves in that
direction and gets into the threshold's % range it will place those orders too.
```"""
mode = """
```
n (normal); normal operation
gs (graceful stop): let the bot continue as normal until
all positions are fully closed, then not open any more positions.
p (panic): bot will close positions asap using limit orders
t (TP-only): bot only manages TP grid and will not cancel
or create any entries.
```"""
exposure = """
```
specify wallet_exposure_limit, overriding value from live config
0 = reset to value from live config
```"""
instance_min_markup = """
```
specify min_markup, overriding value from live config
0 = reset to value from live config
```"""
instance_markup_range = """
```
specify markup_range, overriding value from live config
0 = reset to value from live config
```"""
lev = """
```
On futures markets with leverage, passivbot may expose more than 100%
of the wallet's funds. Passivbot uses only (unleveraged) wallet balance
in its calculations, so adjusting leverage on exchange will make
no difference on risk, profit or bot behavior, as long as leverage is set
high enough for the bot to make its grid according to the configuration.
```"""
co = """
```
When in OHLCV mode, offset the execution cycle by a certain number of
seconds from the start of each minute. This can help avoid exceeding
the API rate limit when running multiple instances.
Default is random (-1)
```"""
ohlcv = """
```
use 1m ohlcv instead of 1s ticks
```"""
price_precision = """
```
Override price step with round_dynamic(market_price * price_precision, 1).
Default: None (0.0000) Suggested val 0.0001
```"""
price_step = """
```
Override price step with custom price step. Takes precedence over -pp
Default: None (0.000) Not every exchange has the same minimal step
```"""
api_error = """
Check your API-Key and enable spot and/or future trading if you need it
"""
api_keys_guide = """
**PBGui API-Keys guide (api-keys.json)**
PBGui supports both its own format and PB7/CCXT-style field names. When you edit & save users in the GUI, PBGui will preserve unknown fields (so PB7 configs keep working).
Upstream reference (PB7/Passivbot): https://github.com/enarjord/passivbot
Supported/recognized keys inside each user entry:
- Required: `exchange`
- Credentials:
- `key` (alias: `apiKey`, `api_key`)
- `secret`
- `passphrase` (alias: `password`)
- Hyperliquid:
- `wallet_address` (alias: `walletAddress`, `wallet`)
- `private_key` (alias: `privateKey`)
- `is_vault` (boolean)
- Optional PB7/CCXT passthrough:
- `quote` (string)
- `options` (JSON object)
- Any other keys (e.g. subaccount identifiers, exchange-specific fields) are kept under `extra`.
Example:
```json
{
"myuser": {
"exchange": "bybit",
"apiKey": "...",
"secret": "...",
"password": "...",
"quote": "USDT",
"options": {"defaultType": "swap"},
"uid": "123456"
}
}
```
"""
upload_pbguidb = """
```
Share your configuration with pbconfigdb
You can enter a name that will be displayed in pbconfigdb as source
```"""
instance_save = """
```
Save config
```"""
instance_restart = """
```
Save config and restart Instance
```"""
instance_enable = """
```
Save config and start/stop Instance
```"""
opt_iters = """
```
Number of backtests per optimize session.
```"""
opt_today = """
```
If selected, the optimizer will always take the current date as the
end date. This means that when the date changes, the next rerun is
executed up to the current day.
```"""
opt_reruns = """
```
n optimizer reruns
An optimizer reruns can yield better results with the following settings:
Iters=25000 Reruns=20. This approach is more effective compared to running
the optimizer only once with 500000 iterations. By rerunning the optimizer,
you have a higher chance of finding good configurations that are not overfitted.
```"""
backtest_best = """
```
automatic backtest n best results
```"""
backtest_sharp = """
```
automatic backtest n sharpest results
```"""
backtest_adg = """
```
automatic backtest n highest average daily gains results
```"""
backtest_drawdown = """
```
automatic backtest n lowest drawdown results
```"""
backtest_stuck = """
```
automatic backtest n lowest hours stuck results
```"""
backtest_twe_resolution = """
```
Resolution of the total wallet exposure limit in minutes.
Best is 1 minute, but it can be very slow.
```"""
pbrun = """
```
This is the Instance Manager from PBGUI.
Enable, to start all enabled Instances.
To start the Instance Manager after reboot your server, you have to
start PBRun.py when your Server starts.
This can be done in your crontab with @reboot
Example crontab
@reboot ~/software/pbgui/start.sh
Example start.sh
#!/usr/bin/bash
venv=~/software/venv_pb39 #Path to python venv
pbgui=~/software/pbgui #path to pbgui installation
source ${venv}/bin/activate
cd ${pbgui}
python PBRun.py
# python PBRemote.py
# python PBMon.py
# python PBStat.py
# python PBShare.py
# python PBData.py
# python PBCoinData.py
Run "chmod 755 start.sh" and change the path to your needs
Run "crontab -e" and add the @reboot with your path
```"""
pbremote = """
```
This is the Remote Server Manager from PBGUI.
Enable, to start sync Bots running on a Remote Server.
To start the Remote Server Manager after reboot your server, you have to
start PBRemote.py when your Server starts.
This can be done in your crontab with @reboot
Example crontab
@reboot ~/software/pbgui/start.sh
Example start.sh
#!/usr/bin/bash
venv=~/software/venv_pb39 #Path to python venv
pbgui=~/software/pbgui #path to pbgui installation
source ${venv}/bin/activate
cd ${pbgui}
# python PBRun.py
python PBRemote.py
# python PBMOn.py
# python PBStat.py
# python PBShare.py
# python PBData.py
# python PBCoinData.py
Run "chmod 755 start.sh" and change the path to your needs
Run "crontab -e" and add the @reboot with your path
```"""
pbmon = """
```
This is the Monitoring Manager from PBGUI.
Enable, to start monitoring your Bots.
To start the Monitoring Manager after reboot your server, you have to
start PBMon.py when your Server starts.
This can be done in your crontab with @reboot
Example crontab
@reboot ~/software/pbgui/start.sh
Example start.sh
#!/usr/bin/bash
venv=~/software/venv_pb39 #Path to python venv
pbgui=~/software/pbgui #path to pbgui installation
source ${venv}/bin/activate
cd ${pbgui}
# python PBRun.py
# python PBRemote.py
python PBMon.py
# python PBStat.py
# python PBShare.py
# python PBData.py
# python PBCoinData.py
Run "chmod 755 start.sh" and change the path to your needs
Run "crontab -e" and add the @reboot with your path
```"""
vps_settings = """
```
VPS Settings configures monitoring for your VPS servers.
The VPS monitoring runs inside the API Server — no separate daemon needed.
It maintains persistent SSH connections (asyncssh), monitors services
(PBRun, PBRemote, PBCoinData), auto-restarts them on failure,
and sends Telegram alerts on connection loss or service issues.
Requirements:
- SSH keys must be installed on VPS (via VPS Manager)
- VPS must be registered in VPS Manager
- Telegram config (shared with PBMon) for alerts
- API Server must be running
Only relevant on the Master node.
```"""
vps_auto_restart = """
```
When enabled, the VPS monitor will automatically restart services
(PBRun, PBRemote, PBCoinData) that are detected as down.
Rate limited to 3 restarts per service per hour.
```"""
vps_monitor_interval = """
```
How often the VPS monitor checks connections and services (in seconds).
Default: 15 seconds. Minimum: 5 seconds.
```"""
vps_enabled_hosts = """
```
Enable or disable monitoring for this VPS host.
Only enabled hosts will be connected via SSH and monitored.
Default: all hosts are disabled. Enable them individually
or use "Enable All" to activate all at once.
Changes take effect after saving (API Server picks up changes automatically).
```"""
vps_monitor_page = """
```
VPS Monitor provides real-time monitoring of all VPS servers
via the API Server's persistent SSH connections.
Dashboard: Live system metrics (CPU, RAM, Disk, Swap) with ~1-3s latency.
Instances: All bot instances across all VPS with PnL, errors, tracebacks.
Services: PBRun, PBRemote, PBCoinData status per VPS with restart buttons.
Live Logs: Real-time log streaming (tail -f) for services and bots.
Requires API Server to be running (start from Services → API Server).
```"""
pbstat = """
```
This is the Data Scrapper from PBGUI.
If you disable PBStat, you will not be able to see live exchange data.
Enable, to start scrapping data from Exchanges.
To start the Data Scrapper after reboot your server, you have to
start PBStat.py when your Server starts.
This can be done in your crontab with @reboot
Example crontab
@reboot ~/software/pbgui/start.sh
Example start.sh
#!/usr/bin/bash
venv=~/software/venv_pb39 #Path to python venv
pbgui=~/software/pbgui #path to pbgui installation
source ${venv}/bin/activate
cd ${pbgui}
# python PBRun.py
# python PBRemote.py
# python PBMon.py
python PBStat.py
# python PBShare.py
# python PBData.py
# python PBCoinData.py
Run "chmod 755 start.sh" and change the path to your needs
Run "crontab -e" and add the @reboot with your path
```"""
pbdata = """
```
This is the Data Manager from PBGUI.
It stores history, positions and orders in a local sqlite database.
Enable, to start fetching data from the exchanges.
To start the Data Manager after reboot your server, you have to
start PBData.py when your Server starts.
This can be done in your crontab with @reboot
Example crontab
@reboot ~/software/pbgui/start.sh
Example start.sh
#!/usr/bin/bash
venv=~/software/venv_pb39 #Path to python venv
pbgui=~/software/pbgui #path to pbgui installation
source ${venv}/bin/activate
cd ${pbgui}
# python PBRun.py
# python PBRemote.py
# python PBMon.py
# python PBStat.py
# python PBShare.py
python PBData.py
# python PBCoinData.py
Run "chmod 755 start.sh" and change the path to your needs
Run "crontab -e" and add the @reboot with your path
```"""
pbdata_ws_max = """
```
Global cap for private websocket clients across all exchanges
```"""
pbcoindata = """
```
This is the CoinData Manager from PBGUI.
It fetches coin data like marketcap from MarketCap and available coins from Exchanges.
Enable, to start fetching data.
To start the CoinData Manager after reboot your server, you have to
start PBCoinData.py when your Server starts.
This can be done in your crontab with @reboot
Example crontab
@reboot ~/software/pbgui/start.sh
Example start.sh
#!/usr/bin/bash
venv=~/software/venv_pb39 #Path to python venv
pbgui=~/software/pbgui #path to pbgui installation
source ${venv}/bin/activate
cd ${pbgui}
# python PBRun.py
# python PBRemote.py
# python PBMon.py
# python PBStat.py
# python PBShare.py
# python PBData.py
python PBCoinData.py
Run "chmod 755 start.sh" and change the path to your needs
Run "crontab -e" and add the @reboot with your path
```"""
score_maximum = """
```
score = adg per exposure weighted according to adg subdivisions
score metric thresholds
any improvement beyond threshold is ignored
maximum_x: don't penalize scores with values lower than maximum_x
set any to -1 (less than zero) to disable
```"""
clip_threshold = """
```
clip results: compute score on top performers only
clip_threshold=0.1 means drop 10% worst performers;
clip_threshold=0.0 means include all
clip_threshold>=1 means include exactly x symbols,
e.g. clip_threshold=4: include exactly 4 symbols
```"""
backtest_slices = """
```
to reduce overfitting, perform backtest with multiple start dates,
taking mean of metrics as final analysis
```"""
grid_span = """
```
per uno (0.32 == 32%) distance from initial entry price to last node's price
```"""
max_n_entry_orders = """
```
Max number of nodes in entry grid.
```"""
eqty_exp_base = """
```
if 1.0, spacing between all nodes' prices is equal
higher than 1.0 and spacing will increase deeper in the grid
```"""
eprice_exp_base = """
```
if 1.0, qtys will increase linearly deeper in the grid
if > 1.0, qtys will increase exponentially deeper in the grid
```"""
ema_span = """
```
ema_span_0: float
ema_span_1: float
spans are given in minutes
next_EMA = prev_EMA * (1 - alpha) + new_val * alpha
where alpha = 2 / (span + 1)
one more EMA span is added in between span_0 and span_1:
EMA_spans = [ema_span_0, (ema_span_0 * ema_span_1)**0.5, ema_span_1]
these three EMAs are used to make an upper and a lower EMA band:
ema_band_lower = min(emas)
ema_band_upper = max(emas)
which are used for initial entries and auto unstuck closes
```"""
ema_dist = """
```
offset from lower/upper ema band.
long_entry/short_close price is lower ema band minus offset
short_entry/long_close price is upper ema band plus offset
clock_bid_price = min(emas) * (1 - ema_dist_lower)
clock_ask_price = max(emas) * (1 + ema_dist_upper)
See ema_span_0/ema_span_1
```"""
qty_pct = """
```
basic formula is entry_cost = balance * wallet_exposure_limit * qty_pct
```"""
delay_between_fills_minutes = """
```
delay between entries/closes given in minutes
entry delay resets after full pos close
```"""
delay_weight = """
```
delay between clock orders may be reduced, but not increased.
if pos size is zero, the timer is reset for entries, but not for closes.
the formula is:
modified_delay = delay_between_fills * min(1, (1 - pprice_diff * delay_weight))
where for bids (long entries and short closes):
pprice_diff = (pos_price / market_price - 1)
and for asks (short entries and long closes):
pprice_diff = (market_price / pos_price - 1)
this means (given delay_weights > 0):
if market_price > pprice_long (upnl is green):
entry_delay is unchanged and close_delay reduced
if market_price < pprice_long (upnl is red):
entry_delay is reduced and close_delay is unchanged
if market_price < pprice_short (upnl is green):
entry_delay is unchanged and close_delay is reduced
if market_price > pprice_short (upnl is red):
entry_delay is reduced and close_delay is unchanged
```"""
we_multiplier = """
```
similar in function to Recursive Grid mode's ddown_factor
entry cost is modified according to:
entry_cost = balance * wallet_exposure_limit * qty_pct * (1 + ratio * we_multiplier)
where ratio = wallet_exposure / wallet_exposure_limit
```"""
initial_qty_pct = """
```
initial_qty_pct: float
initial_entry_cost = balance * wallet_exposure_limit * initial_qty_pct
```"""
initial_eprice_ema_dist = """
```
initial_eprice_ema_dist: float
if no pos, initial entry price is:
ema_band_lower * (1 - initial_eprice_ema_dist) for long
ema_band_upper * (1 + initial_eprice_ema_dist) for short
```"""
wallet_exposure_limit = """
```
wallet_exposure_limit: float
bot limits pos size to wallet_balance_in_contracts * wallet_exposure_limit
```"""
ddown_factor = """
```
next_reentry_qty = pos_size * ddown_factor
in recursive grid mode ddown factor is static;
in neat grid mode ddown factor becomes dynamic
```"""
rentry_pprice_dist = """
```
rentry_pprice_dist: float
```"""
rentry_pprice_dist_wallet_exposure_weighting = """
```
if set to zero, spacing between nodes will be approximately the same
if > zero, spacing between nodes will increase in some proportion to wallet_exposure
given long,
next_reentry_price = pos_price * (1 - rentry_pprice_diff * modifier)
where modifier = (1 + ratio * rentry_pprice_dist_wallet_exposure_weighting)
and where ratio = wallet_exposure / wallet_exposure_limit
```"""
min_markup = """
```
min_markup: float
```"""
markup_range = """
```
markup_range: float
```"""
n_close_orders = """
```
n_close_orders: int (if float: int(round(x)))
Take Profit (TP) prices are spread out from
pos_price * (1 + min_markup) to pos_price * (1 + min_markup + markup_range) for long
pos_price * (1 - min_markup) to pos_price * (1 - min_markup - markup_range) for short
e.g. if pos_price==100, min_markup=0.02, markup_range=0.03 and
n_close_orders=7, TP prices are [102, 102.5, 103, 103.5, 104, 104.5, 105]
qty per order is pos size divided by n_close_orders
say long, if one TP ask is filled and afterwards price dips below that price level,
bot recreates TP grid with reduced qty on each price level
```"""
auto_unstuck_wallet_exposure_threshold = """
```
Ratio of exposure to exposure_limit at which auto unstuck (AU) kicks in.
if wallet_exposure / wallet_exposure_limit > (1 - auto_unstuck_wallet_exposure_threshold): enable AU
E.g.
auto_unstuck_wallet_exposure_threshold == 0.0: auto unstuck is disabled.
auto_unstuck_wallet_exposure_threshold == 0.1: auto unstuck kicks in when exposure is 10% away from exposure_limit.
auto_unstuck_wallet_exposure_threshold == 0.9: auto unstuck kicks in when exposure is 90% away from exposure_limit.
auto_unstuck_wallet_exposure_threshold == 1.0: auto unstuck is always enabled.
```"""
auto_unstuck_qty_pct = """
```
How much of max pos size to close.
close_cost = balance * wallet_exposure_limit * auto_unstuck_qty_pct
For example, if balance is $1000, wallet_exposure_limit=0.3 and auto_unstuck_qty_pct=0.02:
close_cost == $1000 * 0.3 * 0.02 == $6.
```"""
auto_unstuck_ema_dist = """
```
ema_span_0, ema_span_1
Bot uses three emas of spans: [span0, (span0 * span1)**0.5, span1], given in minutes.
Close price distance from EMA band.
Lower auto unstuck EMA band is min(ema0, ema1, ema2) * (1 - auto_unstuck_ema_dist).
Upper auto unstuck EMA band is max(ema0, ema1, ema2) * (1 + auto_unstuck_ema_dist).
How much of max pos size to close.
```"""
auto_unstuck_delay_minutes = """
```
Timer for unstuck closes, given in minutes.
if now - prev_AU_close_ts > auto_unstuck_delay: enable AU
```"""
harmony_search = """
```
Parameters for Harmony Search. Don't change them as long as you not fully
unterstand how hardmony search work.
Chaning them will not get you better configs. But it can speed up or slow down
the algorithm.
```"""
particle_swarm = """
```
Parameters for Particle Swarm. Don't change them as long as you not fully
unterstand how particle swarm work.
Chaning them will not get you better configs. But it can speed up or slow down
the algorithm.
```"""
leverage = """
```
leverage set on exchange
```"""
logging_level = """
```
Controls global verbosity for Passivbot and tooling.
Accepted values: 0 (warnings), 1 (info), 2 (debug), 3 (trace).
```"""
backtest_balance_sample_divider = """
```
Minutes per bucket when sampling balances/equity for balance_and_equity.csv
and related plots.
1 keeps full per-minute resolution; higher values thin out the series
(e.g., 15 stores one point every 15 minutes) to reduce file sizes.
Default is 60, meaning that results are recorded every 60 minutes.
Warning: Lower values increase the size of the backtest result files.
A setting of 1 will create very large files and should only be used for small timeframes.
Viewing large backtest result files may be slow or crash the browser.
```"""
loss_allowance_pct = """
```
multisym auto unstuck: will use profits from other positions to offset
losses realized on stuck positions
how much below past peak balance to allow losses (default 1% == 0.01).
Set to 0.0 to disable multisym auto unstuck.
```"""
pnls_max_lookback_days = """
```
how far into the past to fetch pnl history
```"""
stuck_threshold = """
```
if wallet_exposure / wallet_exposure_limit > stuck_threshold
consider position as stuck
```"""
unstuck_close_pct = """
```
Percentage of full pos size * wallet_exposure_limit to close for each unstucking order.
```"""
execution_delay_seconds = """
```
wait x seconds after executing to exchange
delay between executions to exchange. Set to 60 to simulate 1m ohlcv backtest.
```"""
auto_gs = """
```
automatically enable graceful stop for positions on disapproved coins
graceful stop means the bot will continue trading as normal, but not
open a new position after current position is fully closed.
```"""
hedge_mode = """
```
If true, allow holding long and short simultaneously on the same coin
(two-way / hedge mode). If false, PB7 will avoid opening a position on
one side if there is already a position on the other side.
Note: effective hedge_mode also depends on exchange capability.
```"""
TWE_long_short = """
```
total wallet exposure limits long and short.
Exposure limit for each bot will be TWE_pos_side / len(active_symbols_pos_side)
The WE from single/local config takes precedence.
Example:
Configured TWE 2.0
2 symbols with local config WE 0.5
3 symbols with default/universal config
Result:
2 x 0.5 WE
3 x 0.4 WE (2.0/5)
Real TWE will be 2.2
```"""
multi_long_short_enabled = """
```
if true, mode defaults to 'normal'.
If false, mode defaults to 'manual'.
```"""
n_longs_shorts = """
```
Max number of positions to have open.
If n_longs and n_shorts are both zero, forager mode is disabled.
n_longs: 0 // if > 0, overrides longs_enabled
n_shorts: 0 // if > 0, overrides shorts_enabled
```"""
minimum_market_age_days = """
```
minimum market age. Don't trade markets younger than x days. Set to zero to allow all markets.
```"""
ohlcv_interval = """
```
interval of ohlcvs used for noisiness, volumes and EMAs
```"""
n_ohlcvs = """
```
number of ohlcvs used for noisiness, volumes and EMAs
```"""
relative_volume_filter_clip_pct = """
```
Volume filter: disapprove the lowest relative volume symbols. Default 0.1 == 10%. Set to zero to allow all.
```"""
max_n_per_batch = """
```
how many executions in parallel per batch
```"""
max_n_restarts_per_day = """
```
If the bot crashes for any reason, restart the bot up to n times per day before stopping completely.
```"""
ohlcvs_1m_rolling_window_days = """
```
How many days worth of OHLCVs for the bot to keep in memory.
Reduce this number if RAM consumption becomes an issue.
```"""
ohlcvs_1m_update_after_minutes = """
```
How many minutes old OHLCVs for a coin may be before the bot will fetch fresh ones from the exchange.
Increase this number if rate limiting becomes an issue.
```"""
inactive_coin_candle_ttl_minutes = """
```
to control how long 1m candles for inactive symbols are kept in RAM before being refreshed
```"""
max_disk_candles_per_symbol_per_tf = """
```
Maximum number of candles to store on disk per symbol per timeframe.
Older candles will be deleted when this limit is exceeded.
```"""
max_memory_candles_per_symbol = """
```
Maximum number of candles to keep in memory per symbol.
Older candles will be deleted from memory when this limit is exceeded.
```"""
filter_by_min_effective_cost = """
```
if true, will disallow symbols where balance * WE_limit * initial_qty_pct < min_effective_cost
e.g. if exchange's effective min cost for a coin is $5, but bot wants to make an order of $2, disallow that coin.
```"""
forced_mode_long_short = """
```
Force all positions to the same mode. Individually flagged modes take precedence.
Choices: [n (normal), m (manual), gs (graceful_stop), p (panic), t (take_profit_only)]
```"""
multi_approved_symbols = """
```
Approved symbols that are enabled and can be selected in forager mode
Forager mode = Dynamically enable bots on markets of higher noisiness.
Only select among approved_symbols defined.
If approved_symbols == [], all symbols are eligible.
```"""
multi_ignored_symbols = """
```
put on graceful_stop if auto_gs, else manual
```"""
multi_config_type = """
```
Choose between default or universal config.
```"""
multi_universal_config = """
```
Example format for universal config:
{
long:
{
ddown_factor: 0.8697
ema_span_0: 776.7
ema_span_1: 774.3
initial_eprice_ema_dist: -0.008465
initial_qty_pct: 0.01167
markup_range: 0.002187
min_markup: 0.008534
n_close_orders: 4.0
rentry_pprice_dist: 0.04938
rentry_pprice_dist_wallet_exposure_weighting: 2.143
}
short:
{
ddown_factor: 1.114
ema_span_0: 1074.0
ema_span_1: 786.2
initial_eprice_ema_dist: -0.07048
initial_qty_pct: 0.01296
markup_range: 0.006174
min_markup: 0.003647
n_close_orders: 1.675
rentry_pprice_dist: 0.05371
rentry_pprice_dist_wallet_exposure_weighting: 2.492
}
}
```"""
default_config = """
```
If symbol has no config, default to this config
```"""
config_version = """
```
The Version number of the configuration. This number is required for
synchronisation to your VPS. If the bot that runs this configuration
see a new higher version number, it will switch to the new config.
No need to manual change this number. It will automatical increased
if you hit save.
```"""
pbshare_grid = """
```
enable for generate grid picture and share them on gphoto
```"""
pbshare_bucket = """
```
Select the rclone remote server where the grid pictures should be uploaded.
```"""
pbshare_interval = """
```
Interval in seconds to generate grid pictures.
```"""
pbshare_upload_images = """
```
Enable to upload grid pictures.
```"""
pbshare_download_index = """
```
Download the index.html for preview.
You can open and view it in your browser.
You can upload it to your webserver to share your grid pictures.
A simple free way to share it, is using github pages.
```"""
pbremote_bucket = """
```
Select the rclone bucket to use for sync.
```"""
worst_drawdown_lower_bound = """
```
will penalize worst_drawdowns greater than %
```"""
limits_lower_bound_drawdown_worst = """
```
The optimizer will penalize backtests whose metrics exceed the given values
lowest drawdown during backtest
```"""
limits_lower_bound_drawdown_worst_mean_1pct = """
```
The optimizer will penalize backtests whose metrics exceed the given values
mean of the worst 1% of drawdowns
```"""
limits_lower_bound_equity_balance_diff_mean = """
```
The optimizer will penalize backtests whose metrics exceed the given values
mean of the difference between equity and balance
```"""
limits_lower_bound_loss_profit_ratio = """
```
The optimizer will penalize backtests whose metrics exceed the given values
abs(sum(losses)) / sum(profit)
```"""
limits_lower_bound_position_held_hours_max = """
```
The optimizer will penalize backtests whose metrics exceed the given values
max hours a position is held
```"""
limits = """
```
Optimizer Limits - Penalize backtests whose metrics exceed thresholds
Penalties are added to every objective as a positive modifier; they do not
disqualify a config but will push it far from the Pareto front when violated.
Select a metric and configure when to penalize:
- Metric: The performance metric to evaluate
- Currency: For currency metrics, choose USD or BTC (default: USD)
- Penalize If: Comparison operator (>, <, outside_range, inside_range)
- Stat: Override aggregation statistic (min, max, mean, std)
- Value/Range: The threshold value or [low, high] range
═══════════════════════════════════════════════════════════════════════
RETURNS & GROWTH (currency metrics - append _usd or _btc):
═══════════════════════════════════════════════════════════════════════
adg, adg_w Average Daily Gain (smoothed geometric)
and its recency-biased counterpart
mdg, mdg_w Median Daily Gain and recency-biased variant
gain Final balance gain (end/start ratio)
*_per_exposure_{long,short} Above metrics divided by exposure limit per side
═══════════════════════════════════════════════════════════════════════
RISK METRICS (currency metrics - append _usd or _btc):
═══════════════════════════════════════════════════════════════════════
drawdown_worst Maximum peak-to-trough drawdown
drawdown_worst_mean_1pct Mean of worst 1% drawdowns (daily)
expected_shortfall_1pct Mean of worst 1% daily losses (CVaR)
equity_balance_diff_neg_max Largest negative equity-balance divergence
equity_balance_diff_neg_mean Average negative equity-balance divergence
equity_balance_diff_pos_max Largest positive equity-balance divergence
equity_balance_diff_pos_mean Average positive equity-balance divergence
═══════════════════════════════════════════════════════════════════════
RATIOS & EFFICIENCY (currency metrics - append _usd or _btc):
═══════════════════════════════════════════════════════════════════════
sharpe_ratio, sharpe_ratio_w Return-to-volatility ratio
sortino_ratio, sortino_ratio_w Return-to-downside-volatility ratio
calmar_ratio, calmar_ratio_w Return divided by maximum drawdown
sterling_ratio, sterling_ratio_w Return divided by avg worst 1% drawdowns
omega_ratio, omega_ratio_w Sum(positive returns) / sum(abs negative returns)
═══════════════════════════════════════════════════════════════════════
EQUITY CURVE QUALITY (currency metrics - append _usd or _btc):
═══════════════════════════════════════════════════════════════════════
equity_choppiness, equity_choppiness_w Normalized total variation (lower=smoother)
equity_jerkiness, equity_jerkiness_w Normalized mean absolute 2nd derivative
exponential_fit_error, exponential_fit_error_w MSE from log-linear equity fit
peak_recovery_hours_equity Longest time equity stayed below prior peak
═══════════════════════════════════════════════════════════════════════
POSITION & EXECUTION METRICS (shared - no currency suffix):
═══════════════════════════════════════════════════════════════════════
positions_held_per_day Average positions opened per day
position_held_hours_max Maximum holding time (hours)
position_held_hours_mean Average holding time (hours)
position_held_hours_median Median holding time (hours)
position_unchanged_hours_max Longest span without modifying a position
volume_pct_per_day_avg Average traded volume as % of account/day
n_fills_per_day Average number of fills per day