How to use CopyRates() to search and filter through several timeframes for Bullish Engulfing pattern

前端 未结 2 1167
有刺的猬
有刺的猬 2020-12-14 11:11

I am trying to use CopyRates() to search for a bullish engulfing candlestick pattern (bearish candle followed by a bigger bullish candle) on several timeframes

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-14 11:36

    Assuming that MyPeriod is initialized to 2, the rest of the code seems correct. You should create a variable to keep the timeframe that had the greatest ratio. Inside your if you have to calculate the candlestick body size for candle+1 and candle and calculate the ratio, then if the calculated ratio is greater than the previous calculated you change the value AND update the timeframe in which you find it.

    By the end of your for loop you may decide in which timeframe you want to put your order.

提交回复
热议问题