Skip to content

Commit 051501f

Browse files
committed
CI: Fix CI/docs breakage with sites banning bot access
1 parent 3a83e71 commit 051501f

5 files changed

Lines changed: 16 additions & 10 deletions

File tree

β€Žbacktesting/backtesting.pyβ€Ž

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ class Order:
395395
All placed orders are [Good 'Til Canceled].
396396
397397
[filled]: https://www.investopedia.com/terms/f/fill.asp
398-
[Good 'Til Canceled]: https://www.investopedia.com/terms/g/gtc.asp
398+
[Good 'Til Canceled]: https://en.wikipedia.org/wiki/Order_(exchange)#Time_in_force
399399
"""
400400
def __init__(self, broker: '_Broker',
401401
size: float,
@@ -463,8 +463,8 @@ def limit(self) -> Optional[float]:
463463
Order limit price for [limit orders], or None for [market orders],
464464
which are filled at next available price.
465465
466-
[limit orders]: https://www.investopedia.com/terms/l/limitorder.asp
467-
[market orders]: https://www.investopedia.com/terms/m/marketorder.asp
466+
[limit orders]: https://en.wikipedia.org/wiki/Order_(exchange)#Limit_order
467+
[market orders]: https://en.wikipedia.org/wiki/Order_(exchange)#Market_order
468468
"""
469469
return self.__limit_price
470470

@@ -474,7 +474,7 @@ def stop(self) -> Optional[float]:
474474
Order stop price for [stop-limit/stop-market][_] order,
475475
otherwise None if no stop was set, or the stop price has already been hit.
476476
477-
[_]: https://www.investopedia.com/terms/s/stoporder.asp
477+
[_]: https://en.wikipedia.org/wiki/Order_(exchange)#Stop_orders
478478
"""
479479
return self.__stop_price
480480

@@ -532,7 +532,7 @@ def is_contingent(self):
532532
You can modify contingent orders through `Trade.sl` and `Trade.tp`.
533533
534534
[contingent]: https://www.investopedia.com/terms/c/contingentorder.asp
535-
[OCO]: https://www.investopedia.com/terms/o/oco.asp
535+
[OCO]: https://en.wikipedia.org/wiki/Order_(exchange)#One_cancels_other_orders
536536
"""
537537
return bool((parent := self.__parent_trade) and
538538
(self is parent._sl_order or
@@ -1374,7 +1374,7 @@ def optimize(self, *,
13741374
`backtesting.backtesting.Backtest.run`-returned results series,
13751375
or a function that accepts this series object and returns a number;
13761376
the higher the better. By default, the method maximizes
1377-
Van Tharp's [System Quality Number](https://google.com/search?q=System+Quality+Number).
1377+
Van Tharp's [System Quality Number](https://altpower.app/?q=System+Quality+Number).
13781378
13791379
`method` is the optimization method. Currently two methods are supported:
13801380

β€Žbacktesting/lib.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ class SignalStrategy(Strategy):
378378
This makes the backtest of the strategy simulate a [vectorized backtest].
379379
See [tutorials] for usage examples.
380380
381-
[vectorized backtest]: https://www.google.com/search?q=vectorized+backtest
381+
[vectorized backtest]: https://altpower.app/?q=vectorized+backtest
382382
[tutorials]: index.html#tutorials
383383
384384
To use this helper strategy, subclass it, override its

β€Ždoc/build.shβ€Ž

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ echo 'Testing for broken links'
6969
echo
7070
problematic_urls='
7171
https://www.gnu.org/licenses/agpl-3.0.html
72+
https://www.investopedia.com/terms/c/contingentorder.asp
73+
https://www.investopedia.com/terms/n/nfa-compliance-rule-2-43b.asp
74+
https://www.investopedia.com/terms/b/backtesting.asp
75+
https://altpower.app/?q=vectorized+backtest
76+
https://altpower.app/?q=System+Quality+Number
7277
'
78+
user_agent='Mozilla/5.0 (X11; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0'
7379
pushd "$BUILDROOT" >/dev/null
7480
WEBSITE='https://kernc\.github\.io/backtesting\.py'
7581
grep -PR '<a .*?href=' |
@@ -100,7 +106,7 @@ print(html.unescape(unquote(sys.argv[-1])))' "$url")"
100106
url="${url// /%20}"
101107
echo "$url"
102108
curl --silent --fail --retry 2 --retry-delay 2 --connect-timeout 10 \
103-
--user-agent 'Mozilla/5.0 Firefox 128' "$url" >/dev/null 2>&1 ||
109+
--user-agent "$user_agent" "$url" >/dev/null 2>&1 ||
104110
grep -qF "$url" <(echo "$problematic_urls") ||
105111
die "broken link in $file: $url"
106112
done

β€Ždoc/examples/Multiple Time Frames.ipynbβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"\n",
1010
"Best trading strategies that rely on technical analysis might take into account price action on multiple time frames.\n",
1111
"This tutorial will show how to do that with _backtesting.py_, offloading most of the work to\n",
12-
"[pandas resampling](http://pandas.pydata.org/pandas-docs/stable/timeseries.html#resampling).\n",
12+
"[pandas resampling](https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#resampling).\n",
1313
"It is assumed you're already familiar with\n",
1414
"[basic framework usage](https://kernc.github.io/backtesting.py/doc/examples/Quick%20Start%20User%20Guide.html).\n",
1515
"\n",

β€Ždoc/examples/Multiple Time Frames.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#
1919
# Best trading strategies that rely on technical analysis might take into account price action on multiple time frames.
2020
# This tutorial will show how to do that with _backtesting.py_, offloading most of the work to
21-
# [pandas resampling](http://pandas.pydata.org/pandas-docs/stable/timeseries.html#resampling).
21+
# [pandas resampling](https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#resampling).
2222
# It is assumed you're already familiar with
2323
# [basic framework usage](https://kernc.github.io/backtesting.py/doc/examples/Quick%20Start%20User%20Guide.html).
2424
#

0 commit comments

Comments
Β (0)