As a Python-savvy trader, I'm in need of a professional who can help me create an efficient and reliable Python solution framework that will be used to backtest a specific trading strategy.
An independent model has produced a column of desired trading positions per hour. However, these positions are not always achieveable due to a number of complexities:
- is the trading hour during "trader sleeping times"? If yes, then the position is actually the last feasible position that was traded at "non-sleep" times.
- have we actually hit a stop loss, which would imply the position should be 0
I provide a microsoft word doc that has a flow diagram that shows these cases.
I also provide an excel sheet, which can be used as a test case (ie. consume the excel sheet as a pandas dataframe for testing).
The solution should produce a new pandas column called "Actual Position". More columns can be produced if required but ideally this is what will eventually be used for backtesting.
The preferred solution should be vectorised to ensure fast computation. For-loop or while-loop methods are not completely forbidden as long as they are still speedy and efficient.
Key Requirements:
- Backtesting using Python DataFrame: The solution should work specifically with Python DataFrame, ensuring seamless integration with my existing setup.
- Independent Model: The strategy I need to backtest is an independent model that already has desired positions per time period. The solution should be capable of producing additional DataFrame columns including actual positions achieved but handling complexities such as stop losses, trading times (eg. no trading can occur during sleeping hours), cooldown periods (eg. if stop loss is triggered then no trading occurs for the next 5 hours).
Ideal Skills & Experience:
- Python Proficiency: Expertise in Python programming is a must, with a deep understanding of Python DataFrames (Pandas).
- Trading Strategy Backtesting: Proven experience in backtesting trading strategies, ideally with flexibility on the trading strategies encountered.
Please bid with a brief overview of your relevant experience, and how you plan to approach this project. I'm looking for a freelancer who can deliver a clean, well-documented solution.