Your paper trading account uses the same data permissions as your standard account. It won't simply use your real money. You still need permissions.
If you have an Interactive Brokers account you should familiarize yourself with what the DOs and DONTs are.
As an alternative you can use the faux data demo, but it won't be any good to test any algorithm because the data is completely fake (even in the demo, you cannot use each and every ticker. The forex tickers tend to work most of the time)
@backtrader BTW, do you know how can I replace the following line?:
exec('self.lines.' + i + ' = DfMresistances.value.take([n])')
I tried to use thes two alternatives, but they don't work:
setattr(self, 'lines.' + i + '', DfMresistances.value.take([n]))
setattr(self.lines, + i + '', DfMresistances.value.take([n]))
By the way ... in all cases it's a very bad idea to go All-In (no, All-In is not the new black)
If you use futures and try to go All-In, the slightest move against your entry price will have your broker closing your position until you meet the margin again (read the documentation from your broker), which means you can no longer 100% recover.
Use proper position sizing.
There isn't enough information to even attempt anything. For example: the only provided output is from the modified source, without having the actual command line execution
As such one can only try to point the low hanging fruits. One would be:
Are you pointing to the right port? (usually 7496 for production and 7497 for paper trading)
The default port used by the sample and the IB ecosystem is 7496.
You quote above the following command:
./ibtest.py --data0 EUR.USD-CASH-IDEALPRO --resample --timeframe Minutes --compression 1
and this is theoretically working with the demo. But the demo also runs (default, can be of course be changed) on port 7497.
Cash Products like EUR.USD-CASH-IDEALPRO are allowed (afaik) to all IB customers (as long as your account is funded I think). Whether demo, paper trading or real account, that product is available for everyone. And the code (which relies on IBPy for interfacing to TWS) doesn't know what it is connecting to. The account type is controlled by the TWS (or IbGateway) instance you connect to.
Such calculation is probably what's already being done: the unleveraged value.
The idea seems to be to swap the current value with the current unleveraged value, so that the actual value curve doesn't spike. The leveraged value would still be accessible.
It makes sense
@steffen Is there a quantitative trading platform support the new python3 tws api? I'm looking for something could backtest and trade using Interactive Brokers, just like the BackTrader, but the ibpy is too old to use.
The idea of capturing your own ticks is in theory sound, but has always practical problems. And that's why companies that collect and curate data make money out of it.
Collecting ticks or minute bars or anything else with backtrader is just a python statement away (see for example the trace that run with 2 instruments collecting 1-minute bars during approximately 35 minutes)
The data points could have been stored somewhere (hierarchically or not) instead of simply having printed them out.
Thank you for the post! Currently I am looking on the testing couple ideas for american futures. The way that I think to go forward is to use back-adjusted prices and have continuous contacts. I've checked Quandl already and their continuous contracts are not suitable for me. I was thinking to chain data series based on max volume to match reality, so in the continuous contract I have prices only from the months with max volumes, but Quandl just chains contracts based on expiration months.
backtrader makes continuous contracts based on certain conditions (date and volume), but does not shift prices. As a result you will have gaps between contracts. So to make this shift ones need to re-write bt rollover method or just write a strategy which will make it and save prices into csv files. I am not a super-python guy, so I will probably go second way.
I don't think that adjusted prices in the past will harm the tests. I am going to use dollar value stats, no % stats. Also trades price delta will be the same as for real prices.
@RandyT said in v1.x -Quick Roadmap:
To achieve this,
AcountManager(based Acount LEVEL)/Order and Position Tracker & Recovery(based Engine LEVEL)/Strategy Position Manager(based Strategy LEVEL)
just like IB:
Thanks @backtrader, yes I understand the definition of prenext() as your quotes above show.. but they don't show how to use it to manage differing timeframes :-)
The sample code looks like it is useful though! It appears all I need after all is this?!
@backtrader How to read dataset in following cases:
When there is no time column:
When time is in separate column:
For "1" case I am trying in this way but is it not working:
It is giving me this error:
ValueError: unconverted data remains: 00