Back

Algo: Reversals 2

Hi,

Here is the Reversals 2 strategy kernel.

Reversals 2 uses a slightly more sophisticated approach than Beer Money and TMA2. The following assumptions are made. Some stocks are range-bound and are a suitable match for the algo. A rolling window will be maintained. The maxima and minima of the rolling window are particularly relevant and will be calculated and utilized. The lowest minima are more relevant than the highest minima. The highest maxima are more relevant than the lowest maxima. The maxima and minima that are more recent in time are more relevant. The more relevant maxima and minima are given a higher weight, and buy and sell prices are calculated through appropriate weighted averaging of the maxima and minima.

The main calculations have been componentized in the Reversal class so that you can readily utilize the Reversals 2 strategy kernel. I don't recommend trading the default stock as too many others will likely try the same. You can tweak the settings as well to make it your own. The algo is in second resolution as you can get higher gains, but I do most of my testing at minute resolution as that's faster. Just the strategy kernel with a single stock algo are being provided for free, screening for more suitable stocks and multi-stock algos are another endeavor.

Use at your own risk.

Regards,
Warren Harding

Update Backtest








0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Thanks for the contribution Warren. I have toyed with some other market making strategies that are based around this seminal paper:

https://arxiv.org/abs/1105.3115

Can I ask what is the theoretical basis for your algorithm? Is this your original strategy? At first glance the calculations involving minima and maxima sound like they could be considered linear regession problems. My instinct is that the weight parameters could probably be chosen by a suitablly trained model prior to execution. Have you considered how this could be elaborated?

0

Hi James. This is my original strategy as best I know, if some-one else thought of it previously I'm unaware of it. It doesn't have much of a theoretical basis, at the time of writing it I just wanted some minimalistic strategies that I wanted to try in many situations to see if there were times when stocks fell into certain patterns. I hadn't considered using machine learning to choose the weights, you could.

1

Exiciting strategy to test Warren. Quick question, any idea how to find any other proper stocks for this strategy? I mean how did you come with "MLAB" after all.

 

0

Hi Sadullah.

I ranked by returns on a per stock basis. Quantconnect doesn't let you do this easily but you can recalculate returns from the trades log or integrate a simple backtester into the script. I used the latter approach. Note that there is an overfitting type problem with this approach, but enough trades have been put through that the results are intriguing.

0

Hi, someone has tried in a real account?

0

Oh, I see thanks Warren.

I have tried this on my Real account I am attaching the result. It was a total heart-attack. It made 10's of orders in 1 min and no idea what was the problem. Any ideas will be appreciated. Everything started good, on Friday night when the market was closed I was holding the position for Monday. After market opened it made 10's of orders filled. Here are some examples;

  1. 2019-10-28 13:31:13 New Order Event: Time: 10/28/2019 13:31:13 OrderID: 73 Symbol: MLAB Status: Filled Quantity: 22 FillPrice: 223.49 USD OrderFee: 0.420657 USD Message: Interactive Brokers Order Fill Event
  2. 2019-10-28 13:31:14 New Order Event: Time: 10/28/2019 13:31:14 OrderID: 74 Symbol: MLAB Status: Submitted Message: Interactive Brokers Order Event
  3. 2019-10-28 13:31:14 New Order Event: Time: 10/28/2019 13:31:14 OrderID: 74 Symbol: MLAB Status: Filled Quantity: -22 FillPrice: 223.13 USD OrderFee: 0.524889 USD Message: Interactive Brokers Order Fill Event
  4. 2019-10-28 13:31:15 New Order Event: Time: 10/28/2019 13:31:15 OrderID: 75 Symbol: MLAB Status: Submitted Message: Interactive Brokers Order Event
  5. 2019-10-28 13:31:15 New Order Event: Time: 10/28/2019 13:31:15 OrderID: 75 Symbol: MLAB Status: PartiallyFilled Quantity: 2 FillPrice: 223.49 USD OrderFee: 0.356657 USD Message: Interactive Brokers Order Fill Event - 20 remaining
  6. 2019-10-28 13:31:15 New Order Event: Time: 10/28/2019 13:31:15 OrderID: 75 Symbol: MLAB Status: Filled Quantity: 20 FillPrice: 223.52 USD OrderFee: 0.064 USD Message: Interactive Brokers Order Fill Event

 

0

I'm not sure. One thing I noticed is that if you haved a limit order visible on the table some traders will manipulate the price. They can really take you for a ride when the limit orders are close to the price like this. You definitely have to watch the algo and turn it off right way if it's not behaving, especially at first.

0

Sadullah Dinç were you able to resolve this issue?

0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed