CloseD[1] – Bid : How to find the current gap in pips?
3 replies
Julianrob
6 years ago #193407
Hi there,
I am writing an EA which looks at the previous day’s close price (typically on a Friday close) and it compares the opening day’s price with the intention of finding a gap in the market and trading back to the Friday close price. However I have trouble trying to obtain a value –
In the buy rule for example, the last line of code, and important one, I have
And (CloseD[1] – Bid) >= ConvertToRealPips(10)
The 10 pips is a variable set in the inputs. Here, my condition says, only if the difference between Friday close price and CURRENT BID PRICE now is at least 10 pips, then enter a buy trade. However this is not working for me. I can only get it to work if I specify difference between previous day close and current day open, but the spread is variable and my bid price is critical to measure my entry point. Please can someone assist me?
Thanks in advance! My code attached.
Julian
Julianrob
6 years ago #193411
Also, when I go to get the Daily[1] Close price, it always seems 3 pips higher than the actual close price of the bar. And my spread is set to 5 pips. What could be wrong?
Thanks
Julian
tomas262
6 years ago #194528
Hello,
I can make an example on this but I will also need to test this. Can you send your MondayGapTraderJR-V4.sqw to [email protected]? It seems there was an issue when attaching the file
tomas262
6 years ago #195575
Julian,
it works for me if set like this for example. See file attached
Don’t forget to use everytick testing precision
Viewing 3 replies - 1 through 3 (of 3 total)