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
cmmp last edited by
Sorry to bring up an old thread, but it would be nice if in the documentation https://www.backtrader.com/docu/indautoref.html , the parameters of
bt.ind.CrossOverwere defined. There is no
paramsfield, so I was not sure if it could be used along with other indicators.
CrossOverhas no parameters. It takes data feeds which will generate a
-1depending if there is a cross-over to the upside, nothing or a cross-over to the downside.
From the documentation:
This indicator gives a signal if the provided datas (2) cross up or down - 1.0 if the 1st data crosses the 2nd data upwards - -1.0 if the 1st data crosses the 2nd data downwards