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 want to avoid taking a trade if a trade just closed UNprofitably in the direction I am considering.
How do I get my EA to check the current and the previous bar to see if an unprofitable trade closed, and whether it was long or short?
(If it closed uprofitably in the opposite direction, that would be OK.)
Show code if you can.
You would need to search the history. Also check the close time of the order to see if it falls within your exclusion range. Something like the following...
Code:
void CheckOrderHistory(){
// orders history is most recent at the bottom
// zero based so OrdersHistoryTotal()-1
for(int i=OrdersHistoryTotal()-1; i > -1;i--){
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false) break;
if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC_NUMBER && (OrderType() == OP_SELL || OrderType() == OP_BUY)){
switch(OrderType()){
case OP_BUY:
// do something here...
return(0);
break;
case OP_SELL:
// do something here
return(0);
break;
default:
break;
}
}
}
}
Hi, I was wondering if you guys could help me on creating a script that enables to close the last two opposite type orders depending on the current orders.
e.g if the current OP is sell, therefore if the script executed then the script will close the last two buy positions made historically according to the time they are opened.
Do you had any success for a script / EA that is calculating and storing this value?
@all
The question is not, if the trade was profitable or not.
The question is the maximum negative amount against us accruing during the trade. That is the drawdown.