QuantConnect Trading Strategy implementation

I need a trading strategy written in Python for Quantconnect which can be backtested and optimized.

This is basically for me to get a template for changing in future.


- The trading algorithm must trade US equities only

- Must be written in Python

- Must use Coarse/Fine selection

- Will trade both sides

1. Universe Selection in timeframe 1:

The universe selection happens in one timeframe and the actual trading in another faster timeframe.

For example, we want to select a set of stocks every night for the next day.

- Must use Coarse/Fine selection

- Coarse equity selection must have

HasFundamentalData and

[login to view URL] > priceThreshold, where priceThreshold is a parameter with default value of 5 and

minimum avg volume of avgVolThreshold, where avgVolThreshold is a parameter with default value of 50000, and minimum average volume of the symbol is computed over a parameterized period say AvgVolPeriod e.g. symbolSMAv = SimpleMovingAverage([login to view URL])

- Fine equity selection

This needs to be clearly written such that another algorithm may be substituted by me later.

For this project we will use a parameterizable Bollinger Band squeeze as a threshold.

i.e. we will select only those where the bollinger bandwidth is below a certain threshold and has become smaller in the last m periods versus over the prior n periods

(see [login to view URL] for a reference)

The resulting list must be sorted by Float

2. Trading Algorithm in timeframe 2:

We want to trade in a shorter timeframe. E.g. if the universe selection happened on the day timeframe, then we are trading next day on the 1 min or 5 min timeframes.

- The trading algorithm for longs and shorts should be in seperate blocks so that one may comment the Long OR short versions for testing.

- The trading algorithm is breakout (or breakdown) over a certain % from its previous close in the universe and certain % over (or under) its bollinger band value.

- breakout is used for long positions, breakdown for short positions.

- e.g. we want to buy if the stock breakouts 2.5% over its previous close and is above its upper bollinger or vice-versa for shorting. This part needs to be clean and nicely modifiable.

- these two % values should be parameterizable.

- The algorithm must not enter into a trade for a symbol if it has earnings that day

- Similarly it must close out positions by close of trade which have earnings in the following day

- Must be able to set a buy and sell window times for all trades: e.g. enter new positions from 9:45 a.m. to 10:45 a.m. etc.

- The algorithm can trade up to 10 stocks in a single day but only 4 to prevent pattern day trading.

3. Position Sizing and Loss Control:

- The algorithm should allocate capital per position based on a fixed risk % of the currently available capital

- First: the stop loss price for Long positions = Minimum of AverageTrueRange(n periods, close), yesterday's close, Invert this for Short positions

- Capital Risk per position = 2% (parameter)

- e.g. if the parameter risk is 2% and 100K capital exists then 2k can be risked. hence the number of shares

- Number of shares = Risk-amount/(current_price - stop loss price)

- Based on the above conditions, The algorithm can allocate 100% of available capital or an equal dollar amount into each equity if there are more than one at that time.

4. Position Exit

- STOP LOSS: Upon entering the position a stop limit loss must be entered using the above value.

- PROFIT TARGET: A profit target based exit must also be entered e.g. 10% from entry

- TIME based EXIT: The position should be closed after N bars where N is a parameter.

[login to view URL] Criteria:

- Must show via backtesting that the algorithm works without errors before completion acceptance.

- Cleanly separated code and parameters for the major blocks as mentioned.

6. Skills required:

- Python

- Quantconnect

- Basic Trading Knowledge: ATR, Float, Stop Loss, Short/Long etc.

Skills: Python, Algorithm

See more: trading strategy applications development guidelines, backtesting excel trading strategy, trading strategy backtest source code, automated trading strategy ninjatrader, forex fix api trading strategy sample, trading strategy library, arbitrage trading strategy, cointegrated pairs trading strategy, correlation equity trading strategy, ninja script free trading strategy, program trading strategy, trading strategy source, trading strategy afl, seo strategy implementation, matlab trading strategy, pairs trading strategy, trading strategy report, city harare water sanitation department history strategy implementation, adx trading strategy, rsi 3 trading strategy

About the Employer:
( 0 reviews ) San Jose, United States

Project ID: #24115039

6 freelancers are bidding on average $177 for this job


Hello, I have am good at Python, and I have implemented trading strategies on Quantconnect before. I can easily implement your strategy in Python on Quantconnect. Kindly check my previous projects to see that I have More

$200 USD in 7 days
(8 Reviews)

Hi, nice to e-meet you. We have a team of experience Python, Django developers. We have developed a sophisticated trading platform ([login to view URL]) using Python, Django, PostGreSQL. We have 50+ years of cumulative experi More

$150 USD in 3 days
(17 Reviews)

we will do your QuantConnect Trading Strategy implementation I am writing this proposal in order to work for you in Software and Web Development. We are highly trained professional developers seeking to freelance and e More

$130 USD in 7 days
(3 Reviews)

Hi, I am kahan. I am python developer and have much experienced. Waiting for further discussion. Thank you.

$140 USD in 7 days
(2 Reviews)

Hi I'm very interested in your post. As a senior Python developer, I can help you perfectly. I have rich experience with Python/Django/Flask/ML/AI/Scraping. Let's discuss more detail via private chat. Thanks.

$220 USD in 4 days
(1 Review)

Dear Employer, Yes you are at the right place. I am a pretty smart freelancer equipped with good skills of writing, Data Science and Python programming. I am here to consult and work on your projects. Here are my More

$220 USD in 7 days
(0 Reviews)