This project is a trading strategy that integrates concepts from the Smart Money Concept Indicator, specifically focusing on bullish and bearish order blocks across three different temporalities. Utilizing the Backtesting.py library, the tool is designed to simulate and optimize trading strategies in historical market conditions, offering insights into the potential viability and profitability of these strategies.
- Integration of bullish and bearish order blocks from the Smart Money Concept Indicator.
- Multi-temporality analysis to determine aligned trading signals.
- Automatic trade placement when all three temporalities coincide in direction.
- Parameter optimization feature, allowing variation in temporalities, trade direction, swing length, etc.
Complete simulated run of trades with a specific strategy and parameters. Upward arrows are long entries, downward arrows are short entries. Green are profitable trades and red are losing trades.
Heatmap illustrating optimization of specific parameters. The optimal configuration suggests large order blocks. Without trailing stop loss, 3:1 risk ratio, 20% bigger stop loss than the indicator suggests, 48hs order duration. (further testing demonstrated this to be an overfitted example to these specific market conditions)
Example of traded order blocks. Structure is visible as dotted lines indicating ChoCh and BOS. An order block (in this case only buy types are visible) is composed by take profit (green upper bound) and stop loss (red lower bound). Limit price is down the middle.
Follow these steps to set up and run the project:
-
Python: The project is built using Python. If you don't have Python installed, download and install it from python.org.
-
CSV with Ticker Data: You need a CSV file containing ticker data for backtesting. Place this file in the
backtest_datafolder within the project directory.
-
Clone the Repository: First, clone the repository to your local machine:
git clone https://github.com/jmlacasa/backtesting_simulation.git cd backtesting_simulation -
Install Required Libraries: Use the
requirements.txtfile to install the necessary Python libraries. Run the following command:pip install -r requirements.txt -
Prepare the Data: Ensure you have the CSV file with your ticker data. The file should be placed in the
backtest_datafolder of your project directory. The file should be in the correct format as expected by the scripts.
After installation, you can run your scripts or modules within the project's directory.
- LuxAlgo for the Smart Money Concept Indicator
- Backtesting.py - Python framework for backtesting trading strategies.