Controlling the opening time of new trades while a trade is open (dodging "No position" block)
-
Hey guys,
I had quite a hard time triggering my signals again while a trade was currently open, mainly because of "No position" block. The issue was that by using "No position" block I was missing all the other signals if I had a trade open. And not using it caused to open hundreds of new trades in a second!
Now, however, I have overcome this issue with a time formula and I believe I should share it as a thank you to all others who support in this forum free of charge.
You basically can adjust the period during which you don't want your signal trigger any trade (bypassing that hundreds trades in a second) and then after that your EA can freely search for new signals while your previous trade is still open.This looked easy in the beginning but since the way time works in the code, causes a lot of complications. I don't wanna go into that discussion now. So you can use the below link for your projects and only need to input the constant Delay-seconds based on your preferences. Just remember, regardless of timeframe you are trading in, the delay must be input in seconds. So if you just opened a new trade and you want no new trade during the next 3 candles in a 15 Min timeframe, simply put 2700 (= 60 * 15 * 3).
https://fxdreema.com/shared/RUqysmxQ
Good luck
-
sweet thanks.
-
why not just use once per bar or something of the like?
-
@tipsywisdom I believe once per bar may cause to lose the best entry position.
-
@zhahz Thank you very much for sharing.
-
thanks so much you are a lifestyle
-
thanks a lot. its what i needed
-
So i just copy the 3 blocks into my own project to make it work?
- Time formula
- Modify variables
- Formula
And add an int in the constant section, right?