Comments (3)
I plan to incorporate the breakout method into pysystemtrade and it would be quicker for me to do that than to try and fix your code, so please be patient. I'll leave this open until then.
from pysystemtrade.
I noticed that if I replace the above-mentioned code with:
def breakout(x, ws):
maxs = pd.rolling_max(x, ws, min_periods=min(len(x.index), int(ws/2)))
mins = pd.rolling_min(x, ws, min_periods=min(len(x.index), int(ws/2)))
avg = (maxs+mins)/2
bo = 40*((x - avg)/(maxs-mins))
bo = pd.ewma(bo, span = int(ws/4.0), min_periods = int(ws/8.0))
return bo
and add a series of breakout rules to the config and in rules.py, the breakout rule works. The issue with indexing is related to the second function (breakout_one_row(idx, x, max_x, min_x)
), which is not required, unless I am mistaken.
from pysystemtrade.
breakout is now in the latest version. See https://github.com/robcarver17/pysystemtrade/blob/master/systems/provided/moretradingrules/morerules.py
from pysystemtrade.
Related Issues (20)
- (?) csvFuturesSimData' object has no attribute 'get_instrument_object_with_meta_data HOT 1
- using current python (3.11) and current everything else is possible HOT 2
- span or com? HOT 1
- Manually setting capital for has errors with parquet HOT 7
- Make it easier to run as a system seperatef from IB
- contract data not pulling from mongodb, but now appears to reside in parquet HOT 1
- Start collecting open interest data? HOT 1
- Production Docs: FX data: Initialise the spot FX data in MongoDB from .csv files; error in repocsv_spotfx_prices.py HOT 1
- Euribor Data triggering weird results HOT 4
- Clean install, PyYAML 5.4 error HOT 2
- Add commissions from IB to spread check report and update script HOT 1
- Bunch of new markets added create error on whatif orders HOT 1
- robust_vol_calc(price.diff()) but robust_vol_calc expect daily_returns
- Rollconfig of NASDAQ_mini
- Migrating capital data from arctic to parquet does not work HOT 4
- Intraday futures strategies
- Installation problems HOT 1
- plan succession of ib_insync
- Non-monotonically increasing timestamp in spread data
- Initialize Capital Fails if __global_capital.parquet Doesn't Exist
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysystemtrade.