Back to Posts
Listen to Thread

Hello All,

This is what I had in mind but I don't know why it works. (The Upper and Lower labels are reversed.)

Regards,

Peter

Clone Algorithm
581
Loading...
Backtest from to with initial capital ( data)
Cumulative performance:
Algorithm Benchmark
Custom data:
Week
Month
All
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Information Ratio
--
Benchmark Returns
--
Volatility
--
Max Drawdown
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Information Ratio 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.

def handle_data(context, data):
if str(data['CMG'].datetime.year) == "2011":
record(CMG=data['CMG'].price)
record(Upper=data['CMG']['LOWER_BB'])
record(MA20=data['CMG']['MA20'])
record(Lower=data['CMG']['UPPER_BB'])

Your setting "Upper" as "LOWER_BB" and "Lower" as "UPPER_BB"

Log in to reply to this thread.
Not a member? Sign up!