Try TT Now

Creating Custom Pricing Models in .NET

To create a Custom Price Model using C# (Visual Studio 2005 or higher)...

Step

Action

1.Create a C# Class Library project.
2.Add a reference to the COM object TTPriceModel 1.0 Type Library
3.Set the project’s properties.
  1. Select Application | Assembly Information… | Make assembly-COM Visible
  2. Select Build | Register for COM interop.
4.Create a Price Model class.
  1. Create a new C# class; the file or class name does not matter.
  2. Add using TTPriceModelLib; to the class that will become the Custom Price Model.
  3. Derive the class from IPriceModel.
  4. From the Visual Studio menu, select Edit | Intellisense | Implement Interface | Implicitly.
  5. Replace the bodies of each of the three methods with the logic of the Custom Price Model.
5.Create a Price Model Factory class.
  1. Create a new C# class; the file or class name does not matter.
  2. Add using TTPriceModelLib; to the class that will become the Custom Price Model Factory.
  3. Derive the class from IPriceModelFactory.
  4. From the Visual Studio menu, select Edit | Intellisense | Implement Interface | Implicitly.
  5. Replace the body of NumberOfSupportedPricingModels with code to return the number of Custom Price Models implemented within the Library and created by the derived Price Model Factory.
  6. Replace the body of GetPriceModelName with code that returns the name of the Custom Price Model based on its index, which you define.

    Note:These names MUST NOT conflict with any other Price Model name within X_TRADER, either built in or custom. The entire Library will be ignored if any name collisions are encountered.

  7. Replace the body of GetPriceModel with code that returns a new instance of the Custom Price Model object based upon its index, which you define

    Note: DO NOT throw any exceptions out of the Custom Price Model. X_TRADER is not set up to catch them and they will cause undefined behavior.

To create a Custom Price Model using Visual Basic.NET (Visual Studio 2005 or higher)…

Step

Action

1.Create a Visual Basic Class Library project.
2.Add a reference to the COM object TTPriceModel 1.0 Type Library.
3.Set the project’s properties.
  1. Select Application | Assembly Information… | Make assembly-COM Visible.
  2. Select Compile| Register for COM interop.
4.Create a Price Model class.
  1. Create the new Visual Basic class; the name of the file or class does not matter.
  2. Set the class to implement TTPriceModelLib.IPriceModel.
  3. Replace the bodies of each of the three methods with the logic of the Custom Price Model.
5.Create a Price Model Factory class.
  1. Create the new Visual Basic class; the name of the file or class does not matter.
  2. Set the class to implement TTPriceModelLib.IPriceModelFactory.
  3. Replace the body of NumberOfSupportedPricingModels with code to return the number of Custom Price Models implemented within the Library and created by the derived Price Model Factory.
  4. Replace the body of GetPriceModelName with code to return the name of the Custom Price Model based on its index, which you define.

    Note: These names MUST NOT conflict with any other Price Model name within X_TRADER, either built in or custom. The entire Library will be ignored if any name collisions are encountered.

  5. Replace the body of GetPriceModel with code to return a new instance of the Custom Price Model object based upon its index, which you define.

    Note: DO NOT throw any exceptions out of the Custom Price Model. X_TRADER is not set up to catch them and they will cause undefined behavior.