internal IDictionary<string, string> ToDictionary()
{
var d = new Dictionary<string, string>();
d.Add("account", this.AccountUrl.ToString());
d.Add("symbol", this.Symbol);
d.Add("instrument", this.InstrumentUrl.ToString());
if (this.TimeInForce == TimeInForce.GoodForDay)
{
d.Add("time_in_force", "gfd");
}
else if (this.TimeInForce == TimeInForce.GoodTillCancel)
{
d.Add("time_in_force", "gtc");
}
d.Add("trigger", this.Trigger.ToString().ToLowerInvariant());
d.Add("type", this.OrderType.ToString().ToLowerInvariant());
d.Add("side", this.Side.ToString().ToLowerInvariant());
d.Add("quantity", this.Quantity.ToString());
if (this.Price.HasValue)
{
d.Add("price", this.Price.Value.ToString());
}
if(this.StopPrice.HasValue)
{
d.Add("stop_price", this.StopPrice.Value.ToString());
}
return d;
}