CloseAllBuyMarketOrders method
Created at 28 Oct 2013, 22:43
CloseAllBuyMarketOrders method
28 Oct 2013, 22:43
public void CloseBuyOrders(string argSymbolCode, string argLabel) { foreach (var position in Account.Positions) { if (position.Label == argLabel && position.TradeType == TradeType.Buy && position.SymbolCode == argSymbolCode) { Close(position); } } }
When I try to compile this, I get the error "The name 'Close' does not exist in the current context".
I'm trying to create a library of common functions that I will use in future cBots.
Some help would be great! Thanks
Hyperloop
28 Oct 2013, 22:58
RE:
Hyperloop said:
Fixed it, was just a silly mistake.
Correction:
Trade.Close(position);
@Hyperloop