Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
I have been searching around for an EA with no luck and have been unable to create one that does exactly what I want it to do.
What I am looking for is an EA that will place a buy or sell order based on the opening and closing of the last two bars in the current chart.
Specifically, if the close of bar[1] is greater than the open of bar[1] and the close of bar[2] was less than the open of bar[2] (a price reversal), a buy order is placed on the open of bar[0]. A sell would be the opposite.
The EA doesn't need to be fancy or anything like that. Actually, what I could probably work with is just the formula that is needed to satisfy these conditions.
Any help that is offered will be greatly appreciated. In the mean time, I will continue to try to create the proper formula.
Thanks for the replies everyone. I wanted a statement that would work for any time frame.
I came up with this and it seems to work.
// get the open and close for last two bars
OpenLastBar = iOpen(NULL,0,1);
OpenPreviousBar = iOpen(NULL,0,2);
CloseLastBar = iClose(NULL,0,1);
ClosePreviousBar = iClose(NULL,0,2);
// check if conditions are met
if(OpenLastBar<CloseLastBar && OpenPreviousBar>=ClosePreviousBar) siCurrentDirection = 1; //up
if(OpenLastBar>CloseLastBar && OpenPreviousBar<=ClosePreviousBar) siCurrentDirection = 2; //down
This is just the beginning of what I want to accomplish but, it is a start.