We could do that but in stead i'm just gonna tell you this: "Pastperformance is no guarantee of future results."
If you really want you can filter
OrderOpenTime()
But you can also just use a boolean or integer called
bool direction;
And set it when you open the order then there is no need to select orders for that.
Bare in mind there is practically nothing that has not been programmed for MQ4/5 yet! So search first!
Its easier and the result has fff: far fewer faults than a do-it-yourself-EA generally speaking!
For example look here: https://www.mql5.com/en/docs/event_handlers/ontester!
And there are many many others following this idea!
Bare in mind there is practically nothing that has not been programmed for MQ4/5 yet! So search first!
Its easier and the result has fff: far fewer faults than a do-it-yourself-EA generally speaking!
For example look here: https://www.mql5.com/en/docs/event_handlers/ontester!
And there are many many others following this idea!
if(PositionDirection==POSITION_TYPE_BUY)
{
}
if(PositionDirection==POSITION_TYPE_SELL)
{
}
Using this you can pick what do you want to do with specific trade. So if its short then . . .
I think you can also use it as:
PositionDirection=POSITION_TYPE_BUY - and this should give you direction into variable
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Good Day to all traders. I am developing an ea that will buy or sell if the price will crosses the trend line. I want to refine some conditions that makes the EA buy and sell and buy and so on...and vice versa. Is it possible to have a code that will determine the last open position (buy/sell) so that the position will not be repeated (buy, buy, sell, sell)?
it like
if there is a buy open, then the next well be sell open, and then buy open ans so on... and vice versa.
is it possible to insert the date and time i think something is lack in here
Thank you in advance and God Bless you all.