This was already answered in another post and your assumption is nowhere to be found that things are separated by strategy.
The broker is a single account broker. Anything you do, you do it on a single account. Positions will be closed on that account and tradeid is just a marker for the separation of an artificial thing which is a Trade (a collection of operations)
@blonc said in tradeid - multiple strategies on same symbol:
do I need to also include the data?
If you don't, the 1st data in the system will be used. This is in the documentation.
@blonc said in passing data to strategy via an *args:
the bellow issue:
And what's exactly the issue?
That's a well defined and documented behavior of the platform. It has also been discussed before by people who wanted to access data before all warm-up periods were fulfilled and worked using prenext and adding multiple checks.
@predri said in Including data from a database:
AttributeError: 'DataFrame' object has no attribute 'setenvironment'
Yes. You cannot pass a DataFrame to cerebro and expect things to work.
As pointed out by @Laurent-Michelizza, showing us what you do could be helpful.
@laurent-michelizza said in more data more problems:
That could happen if your data doesn't have the same start/end dates or is not properly aligned
Only the 1st. The system won't enter the next phase of the strategy until all data feeds (and also the associated indicators) have covered the warm-up period (aka as minperiod)
The reason is clear: in next all elements are guaranteed to have a value available at index . Hence the need to await the minimum period of all elements to be consumed.
If you need to access data before, use prenext, but each element will have to be checked for actual data.
Docs - Operating the Platform
Docs - Strategy
@blonc said in analyzer with multiple strategies - results[n] no matter n gives identical results.:
it seems to be giving me results for the entire system not independent strategies.
Yes. The broker is a single account broker. Nowhere it is stated that strategies operate on individual accounts. Actually, the examples that show multiple strategies operating, show that they operate on the same account.
If you want strategies that operate on different accounts, run them with different cerebros.
The main point here is: there is a single strategy which is used against different pairs.
The optimization is to optimize the parameters of a strategy. What you want is to optimize for pairs and that's something which is not the target of the optimization. For each pair you can optimize the other parameters.
But if you insist (from your other post) in that data feeds are passed as params you will probably hit a wall with the optimization approach.
@blonc said in drawdown per trade in def notify_trade()::
I know you can get drawdown in the analyzer as wellbut that seems to just be the max drawdown
Wrong knowledge then. Docs - Analyzers
Quoting from the DrawDown docs:
Returns a dictionary (with . notation support and subdctionaries) with
drawdown stats as values, the following keys/attributes are available:
- ``drawdown`` - drawdown value in 0.xx %
- ``moneydown`` - drawdown value in monetary units
- ``len`` - drawdown length
- ``max.drawdown`` - max drawdown value in 0.xx %
- ``max.moneydown`` - max drawdown value in monetary units
- ``max.len`` - max drawdown length
The IB API is far from being any real API ... but it was never expected that the messages would be different when using different interface languages. Good to know.
So far changing things in API according to display language was a Microsoft Delikatessen ...
Further testing shows that if I remove the "next" method from the recursive indicator (rendering it non-recursive), that the indicator correctly receives the data from the parent class. That makes me start to think that this is actually a bug.