Comments (4)
Not sure it is wise to automatically make bracket orders not using extendedHours if the config says you want extendedHours.
This might confuse less experienced traders and people expect orders to be placed when they are not.
However, perhaps the default in config should be false for extendedHours. The main reason it is set to true is that I'm in Europe and a lot of testing is done on outside regular trading hours :)
As a short term solution, you can always use the following when creating your broker instance:
val broker = AlpacaBroker {
extendedHours = false
}
from roboquant.
extendedHours
is a part of AlpacaConfig
but is hard coded. So the ask is to make it configurable.
Alpaca live trading does not allow extended hours trading for bracket orders (while paper trading has no issue). So it may be better to add a check before creating a bracket order.
From Alpaca Docs
Extended hours are not supported. extended_hours must be βfalseβ or omitted.
from roboquant.
I'll some logic so you can also configure it via a property file. Then it is the same as the public/private keys. I also put the default to false, that is the safer option.
But just to be sure: you can already configure it in your code using the following pattern:
val broker = AlpacaBroker {
extendedHours = false
}
From then on the BracketOrder uses automaticallyfalse
. So nothing is stoping you from using bracket orders right now (unless I still misunderstand something?).
from roboquant.
As usual, the latest snapshot now has the following included:
- Default for extended hours is set to false
- Next to in your own code, you can also configure this attribute via property files.
data class AlpacaConfig(
var publicKey: String = Config.getProperty("alpaca.public.key", ""),
var secretKey: String = Config.getProperty("alpaca.secret.key", ""),
var accountType: AccountType = AccountType.PAPER,
var dataType: DataType = DataType.IEX,
var extendedHours: Boolean = Config.getProperty("alpaca.extendedhours", false),
)
from roboquant.
Related Issues (20)
- Variable Required BarAdjustment for Alpaca Historical Bars HOT 1
- Return metrics as a map
- slf4j simple logger conflicts with other slf4j implementations HOT 3
- Indicator Selector
- Variable Engineering
- Feature Chart HOT 1
- Remove OANDA support HOT 1
- binance enum issue HOT 4
- Advanced policies HOT 6
- Issue with PriceQuote Parser HOT 2
- Build failing CalendarChartTest.test:33 HOT 3
- Improve order placement HOT 1
- Cannot create an Alpaca Bracket order with entry of type LimitOrder HOT 2
- Add support for Alpaca Live Trading HOT 3
- Issue parsing dates in IBKR Historical Feed HOT 2
- The LiveFeed#send ignores the onBufferOverflow of the EventChannel HOT 2
- Weird Error HOT 8
- PriceBarSeries.get(timeline) should use filtered timeline HOT 3
- Having some trouble with IBKR module - historical feed and charts printing HOT 8
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 roboquant.