Closed lolygagv2 closed 9 years ago
Do you think I could use this library to record this succesfully? in Both backtesting and Live trading?
Not simply. It's always possible but you will have to do some things manually.
For backtesting you will have to reimplement the algorithm of the TimeSeries#run()
method. Nowadays you can backtest on only one series.
For live trading it should be easier: you just have to improve the trading bot example with more time series and if
statements.
About your 1st point
You can build one time series per symbol, and one strategy per symbol too. Then all your strategies have to share the same instance of TradingRecord
.
Since I use ta4j only for one-symbol trading (for now) I didn't try, but it should be possible (restriction: I just think TradingRecord
is filled with tick indexes, so attached to a time series, you'll have to make some adjustements).
About your 2nd point
Should be possible. You will have to implements your own trading rules (Rule
interface). I will be glad to merge that kind of rules if you would like to make a PR. :)
About your 3rd point
Sure. Have a look to the trading rules ta4j provides. There's already StopLossRule
and StopGainRule
. You just have to add them to all your strategies (reminder: one per symbol).
About your 4th point
The TradingRecord
object could be used to sync your different strategies. But again it relies on tick indexes from a specific series.
About your 5th point
Seems like I'd want the broker to send a "trade confirmation" and upon the broker "confirming" the trade was executed, then I would enter the trade into the traderecord and continue with the strategy?
It has to work like this. I didn't take the responsibility of automatically "record" the trade. So it's up to the bot designer and it won't change.
About your point point
It's feasible (at least for live trading) but it may need some work. Sorry no example, for now I use ta4j only for one-symbol trading.
Thank you for your interest. Don't hesitate to contribute if some indicators are lacking or if you want to improve something. (see the CONTRIBUTING.md file)
If it doesn't fit your needs (for whatever reason) have a look to other TA libs: https://github.com/mdeverdelhan/ta4j/wiki/Alternative%20libraries
Thanks! Since it's definitely not plug and play, I'll probably try to adopt some of the methods and classes and then do my own implementations to work with my strategy and FIX protocol. If I come up with anything interesting, I'll submit a PR or contribute it!
So I'm looking over porting a multi-symbol, multi trade with hedging strategy to see if I can backtest. Until now it's been impossible to backtest due to the fact it hedges on multiple symbols. Do you think I could use this library to record this succesfully? in Both backtesting and Live trading?
This is kind of the list of things I need to find a way for it to do:
I became interested in this library, because I was looking for some API that had all the indicators I use to determine trading rules, without having to program them all myself :) like 3 different Moving averages, crosses over different time periods etc.
Right now, I was just basically planning to model a FIX engine simulator, have it send all the market data to the strategy, and dummy make a trade confirmation. Then record the trading record and evaluate the results after, but this TA library seems useful for backtesting as well.
(Attaching a screenshot, so u can see what kind of strategy I'm looking at, the main purpose for this GUI was just to monitor, stop/start the strategy with optional "kill" buttons for positions and hedging strategy separately.)![strategyscreenie](https://cloud.githubusercontent.com/assets/5916036/7978366/7792ffa2-0a62-11e5-81ed-461744747b95.png)