Different Instances with Label
Different Instances with Label
11 Oct 2013, 12:29
Hello!
1. If I would like to open positions in different currency pairs with a specific robot, then I can do it so:
protected override void OnBar()
{
var eurjpy = MarketData.GetSymbol("EURJPY");
var usdjpy = MarketData.GetSymbol("USDJPY");
var gbpjpy = MarketData.GetSymbol("GBPJPY");
Trade.CreateBuyMarketOrder(eurjpy , 10000);
Trade.CreateBuyMarketOrder(usdjpy , 10000);
Trade.CreateBuyMarketOrder(gbpjpy , 10000);
}
2. If I would like to open a position with Label with a specific robot, then I can do it so:
protected override void OnBar()
{
var requestBuy = new MarketOrderRequest(TradeType.Buy, 10000)
{Label = "JPY"};
Trade.Send(requestBuy);
}
But how can I open positions in different currency pairs with Label within a specific robot? In other words, how can I combine the two different cases?
Thanks in advance!
Spotware
11 Oct 2013, 12:49
Use a Request as in the second case and add the specific symbol.
/api/requests/marketorderrequest/symbol
@Spotware