工作已完成
指定
Hi friends. I hope that you are fine. I built an strategy and I want to make an EA of it. I've already written the basic code, but I have a problem that I will explain:
I'll attach a picture to this post showing the indicator's results of my strategy with arrows up and down. In this picture you will see four vertical lines. I'll tell you what those lines mean. The blue line is on the candle that shows an arrow up after its last arrow which is down with a red vertical line on the candle. The candle after the candle which has a blue vertical line is my long entry. My exist will be the candle after the candle which has an arrow down and a brown vertical line on it. Also notice that the last arrow is an up one which is on the candle with a green vertical line. At the exit, I want to open a short position too, and exit when a candle after the candle which an arrow up appears on it; And not to mention that there's an arrow down before it. And here again is a long position entry and this cycle goes on and on. I want to check previous candles to see two candles; one with arrow up after the one with arrow down, and vice versa, to make a new position at the current candle and also close the last position.
So basically if the 2nd last arrow was down (candle 1) and the last arrow was Up (candle 2) then buy on the open of the current candle and close the last (obviously sell) trade.
When 2nd last arrow up (candle 1) and last arrow Down (candle 2) then on current candle's open: close the last (obviously buy) trade and open new Sell trade.
I'll also share you my source code with you, but it's lacking the conditions of my buy and sell signals, for obvious reasons.
If you have additional question, don't hesitate to ask me :)