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.
How can I make an Ea which lok for the previous BAR open, close, high and low price and then depending on the conditions take long position or short...
I'm not strong in MT4 coding but I think you have to use this:
Open[Bars-1] => Previous open bar value.
Close[Bars-1] => Previous close bar value.
High[Bars-1] => Previous high bar value.
Low[Bars-1] => Previous low bar value.
How can I make an Ea which lok for the previous BAR open, close, high and low price and then depending on the conditions take long position or short...
It is Ask and Bid... babarmughal look: there is that saying - RTFM that is the short form of Read The Fucking Manual... Before you ask a question try to find some info in MT4 help files ... it will help you much more and you will find some extra info.
Best Regards
P7
Thanks for your help...can you please tell me how can I define the current price.....is it something like ASK or BID ????
Thanks
You can use Ask[] or Bid[], but I preffer using the current close.
double CurrentClose=iClose(Symbol(),NULL,0);
This is the current price, because the bar is not closed, and the CurrentClose is moving. So, let's say that you want the expert to act if the current price is higher than the previous close and the current open is higher than the previous open... you have to code it like this:
Code:
if ((CurrentClose>PreviousClose) && (CurrentOpen>PreviousOpen)) {......}