Comments (3)
Hm, I'm not 100% sure I understand what you mean. Are you saying that you want to place a buy order, and then, if at a later point a sell order at your price is placed, you want the order to be executed? I'm afraid this is currently not possible since the backtesting broker executes your order instantly.
DevAlpha has no notion of an order book, but you could model this yourself very easily. Maybe something like this could suffice?
// Holds pending orders
const orders = []
// Create DevAlpha trader
const trader = createTrader({ ... }, (context, action) => {
if (action.type === 'myOrderbookFeed') {
orders.forEach((order, index) => {
if (order.quantity > 0 && action.payload.bestAsk <= order.price) {
// Place DevAlpha order
context.order({ ... })
// Update pending orders
orders = orders.filter((o, j) => j !== index)
} else if (...) {
// Do the same but for sell-side
}
})
}
if (action.type === 'myMagicSignal') {
// Add to pending orders
orders.push({ ... })
}
});
// Run the thing
trader.resume()
Do you have an example of what you want to accomplish?
from devalpha-node.
The notions of:
-order book.
-limit order
-Cancel not filed limit order.
Are missing that is too bad. It is very hard to find a back testing platform. Also the back-testing broker makes assumption that you always get a fill. While in real life it is a pain because of orders queuing ...
from devalpha-node.
One nice thing about DevAlpha is that you're able to provide as many data sources as you like, and DevAlpha will emit each data point as if they were sorted by timestamp.
On the other hand, this flexibility means that DevAlpha does not know what type of data you feed it, so it does not know whether you feed tick data for a cryptocurrency or a time series of car sales for Toyota.
Regarding limit orders: They're currently the only supported order type, but as you say, during backtesting orders will always get filled instantly. I've added the order book feature to the icebox, and if there's enough need for it I'll make sure to implement it.
from devalpha-node.
Related Issues (16)
- Realtime trading? HOT 1
- backtesting cash synchronization problem
- API Documentation HOT 6
- broken links on Github HOT 1
- Roadmap HOT 1
- Provide a realtime example
- error TS2304: Cannot find name 'Element'. HOT 1
- Allow charting of custom variables
- Quickstart problems HOT 1
- README.md Quickstart problem HOT 1
- Another doc mistake on devalpha.io HOT 1
- Missing Custom Broker docs
- generality of dashboard HOT 3
- Cannot connect to backtester HOT 2
- favicon
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 devalpha-node.