Hi there
I am attempting to construct a easy EA. Here is the code I am using now - that opens one transaction per bar for the current interval (H4).
Inserted Code .... Datetime prevTime; int start() { if (prevTime==Time#91;0#93;-RRB- return(0); prevTime=Time#91;0#93;;....
The problem is that it occasionally opens the second trade on the next H4 bar and this will be to shortly. Basically, if the trend reverses I shall lose 2 trades, equally opened predied on the same signal. I desire a delay of X pubs to make sure the current trade signal died. I really don't want to use the sleep function, I have discovered it uses to much of the CPU.
Any idea how to?
Btw, please know that I am still experimenting with coding, so in case you can help post the whole code. In other words, don't bother using directions because there's a 99% chance I will not know them