Thank you for the time you take to read this
To start I am complete noob although I have started the learning process and have a rough understanding of most of the concepts.I am able use pre-written function with slight success and have founds a lot of very good functions here so I thank all involved for that.
My current problem is I am trying to get the value of the Profit of an open buy order.
Currently my code looks like this and I get one error and I was wondering if someone could give me push into the right direction.Thank you very much
Rooi
Code: Select all
double Balance_of_open_buy()
{
for(int i=0;i<OrdersTotal();i++)
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break;
if(OrderMagicNumber()==Magic_Number && OrderSymbol()==Symbol())
if(OrderType()== OP_BUY)
return (OrderProfit());
}