53 lines
1.8 KiB
C#
53 lines
1.8 KiB
C#
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using System;
|
|
using YLErp.DBModels;
|
|
using YLErp.Model.Enum;
|
|
using YLErp.Modules.TradeModule.OrderModule;
|
|
|
|
namespace YLErp.Modules.TradeModule
|
|
{
|
|
[TestClass]
|
|
public class OtcTradeSaveServiceTest : YLUnitTestBase
|
|
{
|
|
[TestMethod]
|
|
public void TestMethod1()
|
|
{
|
|
var model = new OtcOptionTradeFullEx
|
|
{
|
|
AssetBookName = "111",
|
|
TraderName = "超级助理",
|
|
ClientNumber = "F0028",
|
|
TradeType = "合成价差期权",
|
|
TradeNumber = "200610003",
|
|
UnderlyingCode = "TA101-TA105",
|
|
BuySell = "买入",
|
|
ExerciseMode = "未知",
|
|
OptionType = "看跌",
|
|
SpotPrice = -102.0,
|
|
Strike = -120.0,
|
|
TradeDate = new DateTime(2020, 07, 17),
|
|
ExerciseDate = new DateTime(2020, 07, 17),
|
|
Notional = 3000.0,
|
|
TradeSinglePrice = 18.23,
|
|
TradeOpenVolatility = 6.7518667393419873,
|
|
TradeCloseVolatility = 7.7646,
|
|
NumOfSmoothingDays = 20,
|
|
Comments = "F0028",
|
|
SyntheticPrices = new UnderlyingPriceModel[]{
|
|
new UnderlyingPriceModel
|
|
{
|
|
UnderlyingCode= "TA101",
|
|
Price= 3857.0
|
|
},
|
|
new UnderlyingPriceModel{
|
|
UnderlyingCode= "TA105",
|
|
Price= 3959.0
|
|
}
|
|
}
|
|
};
|
|
|
|
var trade = new OtcTradeSaveService(this).SaveOptionTradeFromApiOrImport(model, TradeSourceEnum.WebApiV2);
|
|
}
|
|
}
|
|
}
|