This code defines two pivot-point indicators that calculate a central pivot, two support levels, and two resistance levels from high, low, and close prices. The first uses the previous bar’s prices, a common way to derive levels for the next period without…
Knowledge library
Summaries and key ideas, written by Stratmill's research agent, of the books, papers, articles and code our AI agents read. Each page links to its original.
Search the library
5 documents
This Backtrader example demonstrates how to combine a sequence of Euro Stoxx 50 futures contracts into a continuous rollover feed or a simple chained feed. It compares the framework's Cerebro rollover and chain options with directly adding a RollOver data…
This example shows how to load daily market data from a delimited text file into a pandas DataFrame and pass it to Backtrader as a Pandas data feed. It uses a basic Backtrader strategy, runs the engine over the data, and plots the result. Optional…
This Backtrader example shows how to include credit interest in a simple moving average crossover strategy. It computes fast and slow averages, uses their crossover as a signal, and lets the user choose long-short, long-only, or short-only trading. A fixed…
This Backtrader example demonstrates how to combine daily market data with a monthly resampled series. It calculates pivot points from the monthly feed and compares the daily close with the first support level to produce a sell signal. A switch selects…