Commit 9f6c613 1 parent 0f019f7 commit 9f6c613 Copy full SHA for 9f6c613
File tree 1 file changed +7
-3
lines changed
hikyuu_cpp/hikyuu/trade_manage
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1547,9 +1547,13 @@ void TradeManager::_saveAction(const TradeRecord& record) {
1547
1547
switch (record.business ) {
1548
1548
case BUSINESS_INIT:
1549
1549
buf << " my_tm = crtTM(datetime=Datetime('" << record.datetime .str () << " '), "
1550
- << " initCash=" << record.cash << sep << " costFunc=" << m_costfunc->name () << " ("
1551
- << m_costfunc->getParameter ().getNameValueList () << " ), " << " name='" << m_name
1552
- << " '" << " )" ;
1550
+ << " initCash=" << record.cash << sep << " costFunc=" ;
1551
+ if (m_costfunc) {
1552
+ buf << m_costfunc->name () << " (" << m_costfunc->getParameter ().getNameValueList ()
1553
+ << " ), " << " name='" << m_name << " '" << " )" ;
1554
+ } else {
1555
+ buf << " TC_Zero()" ;
1556
+ }
1553
1557
break ;
1554
1558
1555
1559
case BUSINESS_CHECKIN:
You can’t perform that action at this time.
0 commit comments