close order by Id? or select?
close order by Id? or select?
30 Nov 2015, 22:38
Hi there..
after i try to find the loosest order i wanna close:
private double badtrade()
{
double loose = 0;
if (Positions.Count > 0)
{
for (int i = Positions.Count - 1; i >= 0; i--)
{
position = Positions[i];
if (position.NetProfit < loose && position.SymbolCode == Symbol.Code)
{
loose = position.NetProfit;
//orderid = position.Id; //try to close order by Id?
//modifyposition("... try to put a label after that? and close by label?
}
}
}
return (loose);
}
any help?
Replies
iulik2k1
01 Dec 2015, 15:36
thanks for the rtfm :D i'm a beginner:
i wanna mark an order after is open. i can't change order info after is created, with modifyposition i can't alter label or comment.
solution is to create unique serial label, and select that order with Positions.Find(order_unique_label)
thanks.
@iulik2k1
mindbreaker
01 Dec 2015, 10:05
RE:
iulik2k1 said:
/api/guides/trading_api#el5
@mindbreaker