Ejemplo n.º 1
0
 public MarketIfTouchedOrder(OrderID id, DateTime createTime, OrderState state, ClientExtensions clientExtensions, OrderType type, InstrumentName instrument, double units, PriceValue price, PriceValue priceBound, TimeInForce timeInForce, DateTime gtdTime, OrderPositionFill positionFill, OrderTriggerCondition triggerCondition, PriceValue initialMarketPrice, TakeProfitDetails takeProfitOnFill, StopLossDetails stopLossOnFill, TrailingStopLossDetails trailingStopLossOnFill, ClientExtensions tradeClientExtensions, TransactionID fillingTransactionID, DateTime filledTime, TradeID tradeOpenedID, TradeID tradeReducedID, List <TradeID> tradeClosedIDs, TransactionID cancellingTransactionID, DateTime cancelledTime, OrderID replacesOrderID, OrderID replacedByOrderID)
 {
     this.Id                      = id;
     this.CreateTime              = createTime;
     this.State                   = state;
     this.ClientExtensions        = clientExtensions;
     this.Type                    = type;
     this.Instrument              = instrument;
     this.Units                   = units;
     this.Price                   = price;
     this.PriceBound              = priceBound;
     this.TimeInForce             = timeInForce;
     this.GtdTime                 = gtdTime;
     this.PositionFill            = positionFill;
     this.TriggerCondition        = triggerCondition;
     this.InitialMarketPrice      = initialMarketPrice;
     this.TakeProfitOnFill        = takeProfitOnFill;
     this.StopLossOnFill          = stopLossOnFill;
     this.TrailingStopLossOnFill  = trailingStopLossOnFill;
     this.TradeClientExtensions   = tradeClientExtensions;
     this.FillingTransactionID    = fillingTransactionID;
     this.FilledTime              = filledTime;
     this.TradeOpenedID           = tradeOpenedID;
     this.TradeReducedID          = tradeReducedID;
     this.TradeClosedIDs          = tradeClosedIDs;
     this.CancellingTransactionID = cancellingTransactionID;
     this.CancelledTime           = cancelledTime;
     this.ReplacesOrderID         = replacesOrderID;
     this.ReplacedByOrderID       = replacedByOrderID;
 }
Ejemplo n.º 2
0
 public MarketIfTouchedOrder()
 {
     this.Id                      = new OrderID();
     this.CreateTime              = new DateTime();
     this.State                   = new OrderState();
     this.ClientExtensions        = new ClientExtensions();
     this.Type                    = new OrderType(EOrderType.MARKET_IF_TOUCHED);
     this.Instrument              = new InstrumentName();
     this.Price                   = new PriceValue();
     this.PriceBound              = new PriceValue();
     this.TimeInForce             = new TimeInForce(ETimeInForce.GTC);
     this.GtdTime                 = new DateTime();
     this.PositionFill            = new OrderPositionFill(EOrderPositionFill.DEFAULT);
     this.TriggerCondition        = new OrderTriggerCondition(EOrderTriggerCondition.DEFAULT);
     this.InitialMarketPrice      = new PriceValue();
     this.TakeProfitOnFill        = new TakeProfitDetails();
     this.StopLossOnFill          = new StopLossDetails();
     this.TrailingStopLossOnFill  = new TrailingStopLossDetails();
     this.TradeClientExtensions   = new ClientExtensions();
     this.FillingTransactionID    = new TransactionID();
     this.FilledTime              = new DateTime();
     this.TradeOpenedID           = new TradeID();
     this.TradeReducedID          = new TradeID();
     this.TradeClosedIDs          = new List <TradeID>();
     this.CancellingTransactionID = new TransactionID();
     this.CancelledTime           = new DateTime();
     this.ReplacesOrderID         = new OrderID();
     this.ReplacedByOrderID       = new OrderID();
 }
Ejemplo n.º 3
0
 public LimitOrderTransaction(TransactionID id, DateTime time, int userID, AccountID accountID, TransactionID batchID, RequestID requestID, TransactionType type, InstrumentName instrument, double units, PriceValue price, TimeInForce timeInForce, DateTime gTDTime, OrderPositionFill positionFill, OrderTriggerCondition triggerCondition, LimitOrderReason reason, ClientExtensions clientExtensions, TakeProfitDetails takeProfitOnFill, StopLossDetails stopLossOnFill, TrailingStopLossDetails trailingStopLossOnFill, ClientExtensions tradeClientExtensions, OrderID replacesOrderID, TransactionID cancellingTransactionID)
 {
     this.Id                      = id;
     this.Time                    = time;
     this.UserID                  = userID;
     this.AccountID               = accountID;
     this.BatchID                 = batchID;
     this.RequestID               = requestID;
     this.Type                    = type;
     this.Instrument              = instrument;
     this.Units                   = units;
     this.Price                   = price;
     this.TimeInForce             = timeInForce;
     this.GTDTime                 = gTDTime;
     this.PositionFill            = positionFill;
     this.TriggerCondition        = triggerCondition;
     this.Reason                  = reason;
     this.ClientExtensions        = clientExtensions;
     this.TakeProfitOnFill        = takeProfitOnFill;
     this.StopLossOnFill          = stopLossOnFill;
     this.TrailingStopLossOnFill  = trailingStopLossOnFill;
     this.TradeClientExtensions   = tradeClientExtensions;
     this.ReplacesOrderID         = replacesOrderID;
     this.CancellingTransactionID = cancellingTransactionID;
 }
Ejemplo n.º 4
0
 public MarketOrderRejectTransaction(
     TransactionID id,
     DateTime time,
     int userId,
     AccountID accountID,
     TransactionID batchID,
     RequestID requestID,
     TransactionType type,
     InstrumentName instrument,
     double units,
     TimeInForce timeInForce,
     PriceValue priceBound,
     OrderPositionFill positionFill,
     MarketOrderTradeClose tradeClose,
     MarketOrderPositionCloseout longPositionCloseout,
     MarketOrderPositionCloseout shortPositionCloseout,
     MarketOrderMarginCloseout marginCloseout,
     MarketOrderDelayedTradeClose delayedTradeClose,
     MarketOrderReason reason,
     ClientExtensions clientExtensions,
     TakeProfitDetails takeProfitOnFill,
     StopLossDetails stopLossOnFill,
     TrailingStopLossDetails trailingStopLossOnFill,
     ClientExtensions tradeClientExtensions,
     TransactionRejectReason rejectReason
     )
 {
     this.Id                     = id;
     this.Time                   = time;
     this.UserId                 = userId;
     this.AccountID              = accountID;
     this.BatchID                = batchID;
     this.RequestID              = requestID;
     this.Type                   = type;
     this.Instrument             = instrument;
     this.Units                  = units;
     this.TimeInForce            = timeInForce;
     this.PriceBound             = priceBound;
     this.PositionFill           = positionFill;
     this.TradeClose             = tradeClose;
     this.LongPositionCloseout   = longPositionCloseout;
     this.ShortPositionCloseout  = shortPositionCloseout;
     this.MarginCloseout         = marginCloseout;
     this.DelayedTradeClose      = delayedTradeClose;
     this.Reason                 = reason;
     this.ClientExtensions       = clientExtensions;
     this.TakeProfitOnFill       = takeProfitOnFill;
     this.StopLossOnFill         = stopLossOnFill;
     this.TrailingStopLossOnFill = trailingStopLossOnFill;
     this.TradeClientExtensions  = tradeClientExtensions;
     this.RejectReason           = rejectReason;
 }
 public FixedPriceOrderTransaction()
 {
     this.Id                     = new TransactionID();
     this.Time                   = new DateTime();
     this.AccountID              = new AccountID();
     this.BatchID                = new TransactionID();
     this.RequestID              = new RequestID();
     this.Type                   = new TransactionType(ETransactionType.FIXED_PRICE_ORDER);
     this.Instrument             = new InstrumentName();
     this.Price                  = new PriceValue();
     this.PositionFill           = new OrderPositionFill(EOrderPositionFill.DEFAULT);
     this.Reason                 = new FixedPriceOrderReason();
     this.ClientExtensions       = new ClientExtensions();
     this.TakeProfitOnFill       = new TakeProfitDetails();
     this.StopLossOnFill         = new StopLossDetails();
     this.TrailingStopLossOnFill = new TrailingStopLossDetails();
     this.TradeClientExtensions  = new ClientExtensions();
 }
Ejemplo n.º 6
0
        public static IHasPrices Create(string type)
        {
            IHasPrices priceObject;

            switch (type)
            {
            case "OkonkwoOandaV20.TradeLibrary.Transaction.TakeProfitDetails":
                priceObject = new TakeProfitDetails(); break;

            case "OkonkwoOandaV20.TradeLibrary.Transaction.StopLossDetails":
                priceObject = new StopLossDetails(); break;

            case "OkonkwoOandaV20.TradeLibrary.Transaction.TrailingStopLossDetails":
                priceObject = new TrailingStopLossDetails(); break;

            default: priceObject = null; break;
            }

            return(priceObject);
        }
 public FixedPriceOrderTransaction(
     TransactionID id,
     DateTime time,
     int userId,
     AccountID accountID,
     TransactionID batchID,
     RequestID requestID,
     TransactionType type,
     InstrumentName instrument,
     double units,
     PriceValue price,
     OrderPositionFill positionFill,
     string tradeState,
     FixedPriceOrderReason reason,
     ClientExtensions clientExtensions,
     TakeProfitDetails takeProfitOnFill,
     StopLossDetails stopLossOnFill,
     TrailingStopLossDetails trailingStopLossOnFill,
     ClientExtensions tradeClientExtensions
     )
 {
     this.Id                     = id;
     this.Time                   = time;
     this.UserId                 = userId;
     this.AccountID              = accountID;
     this.BatchID                = batchID;
     this.RequestID              = requestID;
     this.Type                   = type;
     this.Instrument             = instrument;
     this.Units                  = units;
     this.Price                  = price;
     this.PositionFill           = positionFill;
     this.TradeState             = tradeState;
     this.Reason                 = reason;
     this.ClientExtensions       = clientExtensions;
     this.TakeProfitOnFill       = takeProfitOnFill;
     this.StopLossOnFill         = stopLossOnFill;
     this.TrailingStopLossOnFill = trailingStopLossOnFill;
     this.TradeClientExtensions  = tradeClientExtensions;
 }
Ejemplo n.º 8
0
 public FixedPriceOrder()
 {
     this.Id                      = new OrderID();
     this.CreateTime              = new DateTime();
     this.State                   = new OrderState();
     this.ClientExtensions        = new ClientExtensions();
     this.Type                    = new OrderType(EOrderType.FIXED_PRICE);
     this.Instrument              = new InstrumentName();
     this.Price                   = new PriceValue();
     this.PositionFill            = new OrderPositionFill(EOrderPositionFill.DEFAULT);
     this.TakeProfitOnFill        = new TakeProfitDetails();
     this.StopLossOnFill          = new StopLossDetails();
     this.TrailingStopLossOnFill  = new TrailingStopLossDetails();
     this.TradeClientExtensions   = new ClientExtensions();
     this.FillingTransactionID    = new TransactionID();
     this.FilledTime              = new DateTime();
     this.TradeOpenedID           = new TradeID();
     this.TradeReducedID          = new TradeID();
     this.TradeClosedIDs          = new List <TradeID>();
     this.CancellingTransactionID = new TransactionID();
     this.CancelledTime           = new DateTime();
 }
Ejemplo n.º 9
0
 public LimitOrderRejectTransaction()
 {
     this.Id                      = new TransactionID();
     this.Time                    = new DateTime();
     this.AccountID               = new AccountID();
     this.BatchID                 = new TransactionID();
     this.RequestID               = new RequestID();
     this.Type                    = new TransactionType(ETransactionType.LIMIT_ORDER_REJECT);
     this.Instrument              = new InstrumentName();
     this.Price                   = new PriceValue();
     this.TimeInForce             = new TimeInForce();
     this.GTDTime                 = new DateTime();
     this.PositionFill            = new OrderPositionFill();
     this.TriggerCondition        = new OrderTriggerCondition(EOrderTriggerCondition.DEFAULT);
     this.Reason                  = new LimitOrderReason();
     this.ClientExtensions        = new ClientExtensions();
     this.TakeProfitOnFill        = new TakeProfitDetails();
     this.StopLossOnFill          = new StopLossDetails();
     this.TrailingStopLossOnFill  = new TrailingStopLossDetails();
     this.TradeClientExtensions   = new ClientExtensions();
     this.IntendedReplacesOrderID = new OrderID();
     this.RejectReason            = new TransactionRejectReason();
 }
Ejemplo n.º 10
0
 public StopOrderTransaction()
 {
     this.Id                      = new TransactionID();
     this.Time                    = new DateTime();
     this.AccountID               = new AccountID();
     this.BatchID                 = new TransactionID();
     this.RequestID               = new RequestID();
     this.Type                    = new TransactionType(ETransactionType.STOP_ORDER);
     this.Instrument              = new InstrumentName();
     this.Price                   = new PriceValue();
     this.PriceBound              = new PriceValue();
     this.TimeInForce             = new TimeInForce(ETimeInForce.GTC);
     this.GTDTime                 = new DateTime();
     this.PositionFill            = new OrderPositionFill(EOrderPositionFill.DEFAULT);
     this.TriggerCondition        = new OrderTriggerCondition(EOrderTriggerCondition.DEFAULT);
     this.Reason                  = new StopOrderReason();
     this.ClientExtensions        = new ClientExtensions();
     this.TakeProfitOnFill        = new TakeProfitDetails();
     this.StopLossOnFill          = new StopLossDetails();
     this.TrailingStopLossOnFill  = new TrailingStopLossDetails();
     this.TradeClientExtensions   = new ClientExtensions();
     this.ReplacesOrderID         = new OrderID();
     this.CancellingTransactionID = new TransactionID();
 }
Ejemplo n.º 11
0
 public FixedPriceOrder(OrderID id, DateTime createTime, OrderState state, ClientExtensions clientExtensions, OrderType type, InstrumentName instrument, double units, PriceValue price, OrderPositionFill positionFill, string tradeState, TakeProfitDetails takeProfitOnFill, StopLossDetails stopLossOnFill, TrailingStopLossDetails trailingStopLossOnFill, ClientExtensions tradeClientExtensions, TransactionID fillingTransactionID, DateTime filledTime, TradeID tradeOpenedID, TradeID tradeReducedID, List <TradeID> tradeClosedIDs, TransactionID cancellingTransactionID, DateTime cancelledTime)
 {
     this.Id                      = id;
     this.CreateTime              = createTime;
     this.State                   = state;
     this.ClientExtensions        = clientExtensions;
     this.Type                    = type;
     this.Instrument              = instrument;
     this.Units                   = units;
     this.Price                   = price;
     this.PositionFill            = positionFill;
     this.TradeState              = tradeState;
     this.TakeProfitOnFill        = takeProfitOnFill;
     this.StopLossOnFill          = stopLossOnFill;
     this.TrailingStopLossOnFill  = trailingStopLossOnFill;
     this.TradeClientExtensions   = tradeClientExtensions;
     this.FillingTransactionID    = fillingTransactionID;
     this.FilledTime              = filledTime;
     this.TradeOpenedID           = tradeOpenedID;
     this.TradeReducedID          = tradeReducedID;
     this.TradeClosedIDs          = tradeClosedIDs;
     this.CancellingTransactionID = cancellingTransactionID;
     this.CancelledTime           = cancelledTime;
 }
Ejemplo n.º 12
0
 public MarketOrder(OrderID id, DateTime createTime, OrderState state, ClientExtensions clientExtensions, OrderType type, InstrumentName instrument, double units, TimeInForce timeInForce, PriceValue priceBound, OrderPositionFill positionFill, MarketOrderTradeClose tradeClose, MarketOrderPositionCloseout longPositionCloseout, MarketOrderPositionCloseout shortPositionCloseout, MarketOrderMarginCloseout marginCloseout, MarketOrderDelayedTradeClose delayedTradeClose, TakeProfitDetails takeProfitOnFill, StopLossDetails stopLossOnFill, TrailingStopLossDetails trailingStopLossOnFill, ClientExtensions tradeClientExtensions, TransactionID fillingTransactionID, DateTime filledTime, TradeID tradeOpenedID, TradeID tradeReducedID, List <TradeID> tradeClosedIDs, TransactionID cancellingTransactionID, DateTime cancelledTime)
 {
     this.Id                      = id;
     this.CreateTime              = createTime;
     this.State                   = state;
     this.ClientExtensions        = clientExtensions;
     this.Type                    = type;
     this.Instrument              = instrument;
     this.Units                   = units;
     this.TimeInForce             = timeInForce;
     this.PriceBound              = priceBound;
     this.PositionFill            = positionFill;
     this.TradeClose              = tradeClose;
     this.LongPositionCloseout    = longPositionCloseout;
     this.ShortPositionCloseout   = shortPositionCloseout;
     this.MarginCloseout          = marginCloseout;
     this.DelayedTradeClose       = delayedTradeClose;
     this.TakeProfitOnFill        = takeProfitOnFill;
     this.StopLossOnFill          = stopLossOnFill;
     this.TrailingStopLossOnFill  = trailingStopLossOnFill;
     this.TradeClientExtensions   = tradeClientExtensions;
     this.FillingTransactionID    = fillingTransactionID;
     this.FilledTime              = filledTime;
     this.TradeOpenedID           = tradeOpenedID;
     this.TradeReducedID          = tradeReducedID;
     this.TradeClosedIDs          = tradeClosedIDs;
     this.CancellingTransactionID = cancellingTransactionID;
     this.CancelledTime           = cancelledTime;
 }
Ejemplo n.º 13
0
 public virtual void SetStopLoss(string action, StopLossDetails details)
 {
     stopLossAction = action;
     stopLoss       = action == TradeOrdersAction.Cancel ? null : details;
 }
Ejemplo n.º 14
0
 public PutTradeOrderRequest(StopLossDetails value)
 {
     this.StopLoss = value;
 }