How to generate CrossOver signal with "slowK and slowD" from TALIB and or BT Stochastic fonction ?
Hello gas !!!
I discover BT tool with Remroc.
Could you please help me to find out the solution to display CrossOver signal coming from "slowK and slowD" of TALIB Stochastic fonction ?
In Unix everything is a file and in backtrader (mostly) everything is a lines object.
Stochasticindicators (own and from
ta-lib) declare lines.
Lines are reachable under
linesattribute as in:
percK = Mystochastic.lines.percK
And backtrader contains an indicator to generate signals:
CrossOver. There was a recent blog post using it (actually mixing with numbers).
In the docs you can also see additional crosses from data feeds and sma
When no line is specified the 1st line of the object will be used.
It's finally so easy as:
crossover = bt.ind.CrossOver(line1, line2)
See also this new sample - Blog - Plotting Date Ranges
Great it's working fine !
How can I generated Stochastic signal from other line like "ema of (data)" in Backtrader ?
See the front page: https://www.backtrader.com