double GetLastOrderOpenPrice()
{
datetime time = 0;
double price = 0;
int index = 0;
while (OrderSelect(index, SELECT_BY_POS, MODE_TRADES | MODE_HISTORY ))
{
if (time < OrderOpenTime())
{
time = OrderOpenTime();
price = OrderOpenPrice();
}
index++;
}
return (price);
}
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello everybody,
I am trying to make my EA do a little hedgeing under certain conditions.
I have my buy orders happening at the correct time, I would like the EA to open sell orders when:
//Open Sell
if(Ask = Last Orders Start Price - 0.0025)
code code code...open sell (I have this part done).
Any suggestions ? I have tried to do it with ideas like: if( AccountProfit() <= AccountBalance-0.0025)
but sometimes this makes the sell orders happen above the buy orders.
Thank you all.