Back

Beginner EMA Day Trading Forex Algorithm Questions and Review!

Hey all!

Somewhat new to Quant Connect and was wondering if I could get a review or advice with a simple EMA 5, 20 (Minute, Intra-Day) cross over algorithm I've developed.

Advice moreso on the implementation itself and less on the strategy. A few particular things I wish to have feedback on:

1. Am I using the best practices for orders? I have read that for trading, limit orders are a must.

2. I am using the ATR indicator value to gauge my stop loss (2 x ATR below current) and take profits (1 x ATR above current). Anyone have anything thoughts on this? I thought it was better than having a fixed X amount of pips.

3.  I've made it so that my stop loss and take profit orders are in sync. I cancel the other when one order if filled. Is this the correct thinking?

Any other feedback is appreciated and applied when I get this to apply to multiple currency pairs.

Thanks!

Marc

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.


Also note the false condition in the code (I forgot to exclude it before attaching). I was trying to implement some sort of trailing stop if the orders were not getting fulfilled (fluctuates between my stopLoss and stopProfit).

0

Hi Marc Khristian Partoriza ,

For the buy limit order, we need to set the limit price above the current one. Moreover, since the algorithm is trading forex that is really liquid, we probably would be OK using market orders.

I am not sure about the part of placing stop and take-profit orders after an MA cross. We normally place them as soon as the order that opens a position is filled. That should be done in the OnSecuritiesChanged method. Additionally, if the MA crosses down, then we send a market order to exit and cancel then stop and take-profit orders.

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.


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