Many thanks. I'm enjoying this nice conversation.
Always very appreciated.
@backtrader : You're always right. I'm not accurate, however I do my best to improve the ability. Also thanks to you.
Finally, you're also right: It's a modified piece of the library.
No, it cannot work for me, because that doesn't read from Yahoo. It tries
@Mario-Pellegrini said in float division by zero:
It is not a random code since you also say that the ticker works
It is random, because you apparently want to read from Yahoo and apply Quandl. The code has also nothing to do with the code from the homepage (3 snippets) that directly reads data from Yahoo.
Why don't you start from one of the scripts on the home page, change the ticker to FCA.MI and then slowly modify it? The link again for your reference
@Dimasik007 said in Observers/Analyzers per asset in multi-asset strategy?:
Is it possible to modify DataTrades Observer to implement something similar to what I've made on the picture below?
You can for sure write an Observer which looks at the current position value to determine the PnL.
@ab_trader said in IndexError: array index out of range:
In the __init()__ indexing should be done with (), not with  brackets, ref Docs - Lines: DELAYED indexing:
Pointed out some days ago by @ab_trader
thanks for your reply, I understand it now. From the log information, I see the buy order is submitted, accepted and completed on the next bar, So it cannot be cancelled. The system is designed wisely.
Track it with the notifications of notify_order or notify_trade - https://www.backtrader.com/docu/strategy/
Use the TradeAnalyzer which already includes this calculation - https://www.backtrader.com/docu/analyzers-reference/#tradeanalyzer
Write a custom analyzer which only tracks that value.
@Roger-Bos said in Full example of custom indicator:
import backtrader.indicator as btind
Notice that the original problem is the lack on an s. The code is importing backtrader.indicator and not backtrader.indicators
And yes, MovAv.Simple and all other aliases aforementioned, do exist.