getting a specific position by label
getting a specific position by label
19 May 2013, 21:16
I noticed some code in the Sample Trailing Stop loss that seemed to get a position by ID can you do the same with the label? If so how do you modify this code to get it to work?
I don't see any documentation on the method FirstOrDefault
private Position Position
{
get { return Account.Positions.FirstOrDefault(position => position.Id == PositionId); }
}
Replies
diogene823
20 May 2013, 14:14
Sorry, it's possible change the label of an order?
For example if i have a trailing stop robot that follow all trade with a specify label
and i will that today one trade it's not follow from the robot but follow manually i change the label of this trade and
the robot don't follow it anymore.
When i will that the robot follow this trade again i change the label whit the old label...
it's possible?
Thanks all for the answer.
@diogene823
diogene823
22 May 2013, 22:56
Thanks Atrader,
but if the robot trailing more than one trade and you will follow only one trade manualy?
Thanks
Regards
@diogene823
cAlgo_Fanatic
20 May 2013, 10:34
You can replace ID by Label. Since for the time being you cannot set the label for manual trades this will work with existing positions created by a robot where you can specify the label.
Documentation for C# syntax and examples may be found on the msdn website.
FirstOrDefault
@cAlgo_Fanatic