本文整理汇总了C#中MadViper.POrder.SetReqPrice方法的典型用法代码示例。如果您正苦于以下问题:C# POrder.SetReqPrice方法的具体用法?C# POrder.SetReqPrice怎么用?C# POrder.SetReqPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MadViper.POrder
的用法示例。
在下文中一共展示了POrder.SetReqPrice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LimOrderLimitIsOKTest
public void LimOrderLimitIsOKTest()
{
{
// IsOK, FilterOrderLimitCount에서 값을 root에 잘 전달하는지를 테스트한다.
Account accountFO = AccountManager.Ins().CreateSimFOAccount();
String code = KospiFutureUtil.Ins().KFI.Code;
double reqPrice = KospiFutureUtil.Ins().KFI.UpLimit;
long reqCount = 1;
TradingDirection ls = TradingDirection.Long;
// 여기서는 rmd값이 존재하는 경우의 테스트이다.
RawMarketData rmd = RmdManager.Ins().GetData(code);
rmd.BidPrice1 = KospiFutureUtil.Ins().KFI.DownLimit;
rmd.AskPrice1 = KospiFutureUtil.Ins().KFI.UpLimit;
rmd.BidCount1 = 500;
rmd.AskCount1 = 500;
POrder o = new POrder(ls, code, reqCount, reqPrice, accountFO, rmd);
Assert.AreEqual(o.IsInputValidated, true);
// pass test
{
Boolean bActual = g_lim_ol_with_default.IsOK(o);
Assert.AreEqual(true, bActual);
}
{
Util.LogOutCriticalError("\t\t# DummyOrderLimit 1 permitted.");
Boolean bActual = g_lim_ol_with_dummy.IsOK(o);
Assert.AreEqual(false, bActual);
}
{
long actual = g_lim_ol_with_default.GetPossibleReqCount(o.RMDClone.Code, o.RMDClone.AskPrice1, 100);
Assert.AreEqual(100, actual);
}
{
Util.LogOutCriticalError("\t\t# DummyOrderLimit 1 permitted.");
long actual = g_lim_ol_with_dummy.GetPossibleReqCount(o.RMDClone.Code, o.RMDClone.AskPrice1, 100);
Assert.AreEqual(long.MinValue, actual);
}
// lim order limit에서 pivot이 0이 되는 상황을 테스트한다. long의 경우이다.
// pivot 0 case
o.RMDClone.AskPrice1 = 0;
{
Boolean defaultSuccess = g_default_orderlimit.IsOK(o);
Assert.AreEqual(true, defaultSuccess);
Util.LogOutCriticalError("\t\t# LimOrderLimit 1 permitted.");
Boolean limSuccess = g_lim_ol_with_default.IsOK(o);
Assert.AreEqual(false, limSuccess);
}
// RMD 가격이 존재하는 경우 자동적으로 범위 안으로 SetReqPrice가 된다.
o.RMDClone.AskPrice1 = KospiFutureUtil.Ins().KFI.UpLimit;
o.SetReqPrice(o.ReqPrice + 0.20);
{
Boolean defaultSuccess = g_default_orderlimit.IsOK(o);
Boolean limSuccess = g_lim_ol_with_default.IsOK(o);
Assert.AreEqual(true, defaultSuccess);
Assert.AreEqual(true, limSuccess);
}
o.SetReqPrice(o.ReqPrice + 0.05);
{
Boolean defaultSuccess = g_default_orderlimit.IsOK(o);
Boolean limSuccess = g_lim_ol_with_default.IsOK(o);
Assert.AreEqual(true, defaultSuccess);
Assert.AreEqual(true, limSuccess);
}
o.SetReqPrice(o.ReqPrice + 0.05);
{
Boolean defaultSuccess = g_default_orderlimit.IsOK(o);
Assert.AreEqual(true, defaultSuccess);
Util.LogOutCriticalError("\t\t# LimOrderLimit 1 permitted.");
Boolean limSuccess = g_lim_ol_with_default.IsOK(o);
Assert.AreEqual(false, limSuccess);
}
o.Update(o.ReqCount, 0, true);
}
//long
{
Account accountFO = AccountManager.Ins().CreateSimFOAccount();
String code = KospiFutureUtil.Ins().KFI.Code;
double reqPrice = KospiFutureUtil.Ins().KFI.UpLimit;
long reqCount = 1;
TradingDirection ls = TradingDirection.Long;
RawMarketData rmd = RmdManager.Ins().GetData(code);
rmd.BidPrice1 = 0;
rmd.AskPrice1 = 0;
rmd.BidCount1 = 0;
rmd.AskCount1 = 0;
//.........这里部分代码省略.........