Hello DRo,
Do you plan to use TWS API python for backtrader as Interactive Brokers as released their own python API ?
https://www.interactivebrokers.com/en/index.php?f=5041
Many thanks for your answer.
Cheers,
Remroc
Hello DRo,
Do you plan to use TWS API python for backtrader as Interactive Brokers as released their own python API ?
https://www.interactivebrokers.com/en/index.php?f=5041
Many thanks for your answer.
Cheers,
Remroc
U welcome and more info here on python in TWS API here :
http://interactivebrokers.github.io/tws-api/#gsc.tab=0
Really nice discussion. Check out this talk by John Reese on multithreading out of GIL and asyncio (be warned that your laptop may spontaneously combust :P ) : https://www.youtube.com/watch?v=0kXaLh8Fz3k&feature=youtu.be&t=10m30s
To learn more on asyncio : https://realpython.com/async-io-python/#the-asyncio-package-and-asyncawait
To learn more on GIL : https://realpython.com/python-gil/
Keep the good work guys ;)
Indeed, TWS API is on python 3. What's the roadmap for backtrader 2 ?
Thanks for your answer...
Cheers,
remroc
Really nice discussion. Check out this talk by John Reese on multithreading out of GIL and asyncio (be warned that your laptop may spontaneously combust :P ) : https://www.youtube.com/watch?v=0kXaLh8Fz3k&feature=youtu.be&t=10m30s
To learn more on asyncio : https://realpython.com/async-io-python/#the-asyncio-package-and-asyncawait
To learn more on GIL : https://realpython.com/python-gil/
Keep the good work guys ;)
Wow 1 year already and so many good souvernirs of our BacktraderCon with DRo !!! Time is flying...
@alpha can you share... :P No just kidding
Yes you are right. Thank you @backtrader :)
@backtrader , damn you are right, this is due to limit order instead of market. Thanks a lot for that one !
Hello @backtrader ,
Thanks for your answer. I have printed out the steps (see below) and notice that 3 bars are required to have order passing following steps : submitted, accepted, completed. Then trade is plotmarked as Buy.
LONG ENTRY 2018-02-05 01:40:00 0.01782714
2018-02-05 01:41:00 - Order Submitted
2018-02-05 01:41:00 - Self.orderid = Ref: 41
OrdType: 0
OrdType: Buy
Status: 2
Status: Accepted
Size: 1
Price: 0.01782714
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 2
ExecType: Limit
CommInfo: None
End of Session: 736730.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
2018-02-05 01:41:00 - Order Accepted
2018-02-05 01:41:00 - Self.orderid = Ref: 41
OrdType: 0
OrdType: Buy
Status: 2
Status: Accepted
Size: 1
Price: 0.01782714
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 2
ExecType: Limit
CommInfo: None
End of Session: 736730.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: True
{} - NEXT is returned 2018-02-05 01:41:00
{} - NEXT is returned 2018-02-05 01:42:00
{} - NEXT is returned 2018-02-05 01:43:00
2018-02-05 01:44:00 - BUY COMPLETE, price = 0.01782714
2018-02-05 01:44:00 - Self.orderid = Ref: 41
OrdType: 0
OrdType: Buy
Status: 4
Status: Completed
Size: 1
Price: 0.01782714
Price Limit: None
TrailAmount: None
TrailPercent: None
ExecType: 2
ExecType: Limit
CommInfo: <backtrader.comminfo.CommInfoBase object at 0x7fe0e81d2780>
End of Session: 736730.9999999999
Info: AutoOrderedDict()
Broker: None
Alive: False
Hello @backtrader and guys,
Quick question on the same topic but with indicators. When all conditions are met (which is the case, see 4 circled indicators in picture), buy order is sent but why my trade is plotmarked after 3 bars ?
In the code, the 4 indicators are consolidated in strategy init like this :
long_condition = bt.And(cond1,cond2,cond3,cond4)
Then in strategy next :
if long_condition>0: buy
Can this create more delay on top of incoming price with the next bar which is expected behavior (no cheat-on-close desired) ?
Thanks for your clarifications
Reaaaally impressed ! Nice contribution guys :D
historical option is for downloading historical data in order to feed your strategy. Sometimes you need those data to compute a moving averages or other indicator before actually trading with LIVE data...
Hope it makes sense...
Hello @samk
This strategy might have some flaws but it shows quite well the intention to buy when the price is in bullish trend...
How would you change it to fit more your ideas ?