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)
- Bug in spawn_children_from_instrument_orders HOT 4
- Hold turnover calculation HOT 1
- stack handler crash - creating contract orders from instrument orders HOT 1
- weird expiry date format for GASOIL, EURIBOR-ICE, ROBUSTA HOT 10
- Close order did not work as expected HOT 4
- Error splitting passive roll order HOT 1
- Repeatedly "Sending order ((Order ID:230) Type best for _ROLL_PSEUDO_STRATEGY/......" HOT 6
- modify auto roll code so rolls adjusted if price contract has expired HOT 2
- add correlations to duplicate markets
- remove markets report points out double counting of bad/stale/ignored/trading restriction markets
- Another trade_qty, integer issue HOT 1
- Sending Reports by Email HOT 3
- Stack Handler Crash
- Stack Handler Crash Not Resolved HOT 8
- missing get_demeanded_factor_value HOT 1
- private_config_trading_hours.yaml gets deleted by run_cleaners HOT 3
- Crash on Futures when the last Contract is expired HOT 2
- (?) 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
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.