Show / Hide Table of Contents

Introduction to Strategy Creation

TT .NET SDK provides the ability to construct exchange-tradable, user-defined strategies and then submit them to the exchange to be listed. The legs of these strategies can be options, futures, or spreads depending on the exchange.

For an overview of creating strategies in TT, refer to the Strategy Creation Overview in the Trade help.

Note: Currently, TT .NET SDK supports creating strategies on the same exhanges as the Strategy Creation widget except for LME and FEX.

The following code snippet shows the creation of a simple two leg strategy. In this sample, we set the following parameters for the strategy:

  • Instrument Each leg sets the value of the instrument to trade.

  • OrderSide Sets the Buy/Sell direction of the leg.

  • RatioQuantity Sets the ratio of the leg to the.

List<StrategyLegDefinition> strategyLegDefinitions = new List<StrategyLegDefinition>();
Instrument instr = //Instrument1
StrategyLegDefinition leg1 = new StrategyLegDefinition(instr.InstrumentDetails.Id);
leg1.Side = OrderSide.Buy;
leg1.RatioQuantity = 1;
strategyLegDefinitions.Add(leg1);

Instrument instr2 = //Instrument2
StrategyLegDefinition leg2 = new StrategyLegDefinition(instr2.InstrumentDetails.Id);
leg2.Side = OrderSide.Sell;
leg2.RatioQuantity = 1;
strategyLegDefinitions.Add(leg2);

InstrumentLookup lookup = new InstrumentLookup(this.dispatcher);
lookup.OnData += new EventHandler<InstrumentLookupEventArgs>(StrategyCreationSubscription_StrategyCreationUpdate);
lookup.CreateStrategy(strategyLegDefinitions, apiInstance.DefaultAccount, MarketId.CME);
In this article
Back to top