"* Close $>$ MA(10) $>$ MA(20) $>$ MA(50) $>$ MA(100)\n",
"\n",
"Close the position when:\n",
"* Close more than 2% _below_ MA(10)\n",
"* Daily close is more than 2% _below_ MA(10)\n",
"* 8% fixed stop loss is hit\n",
"\n",
"We need to provide bars data in the _lowest time frame_ (i.e. daily) and resample it to any higher time frames (i.e. weekly) that our strategy requires."
"We need to provide bars data in the _lowest time frame_ (i.e. daily) and resample it to any higher time frame (i.e. weekly) that our strategy requires."
]
},
{
@@ -481,7 +481,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Meager four trades in a span of nine years with effectively zero return? How about if we optimize the parameters a bit?"
"Meager four trades in the span of nine years and with zero return? How about if we optimize the parameters a bit?"
# We need to provide bars data in the _lowest time frame_ (i.e. daily) and resample it to any higher time frames (i.e. weekly) that our strategy requires.
# We need to provide bars data in the _lowest time frame_ (i.e. daily) and resample it to any higher time frame (i.e. weekly) that our strategy requires.
# +
from backtesting import Strategy, Backtest
@@ -122,7 +122,7 @@ def next(self):
backtest.run()
# -
# Meager four trades in a span of nine years with effectively zero return? How about if we optimize the parameters a bit?
# Meager four trades in the span of nine years and with zero return? How about if we optimize the parameters a bit?
0 comments on commit
74ff445