请教如何从期权合约代码,编程求出相应的期货合约代码
如题,请老师赐教
如题,请老师赐教
系统没有函数吗? 试试这个DEMO String StrSource(\"MO2405-P-5100\"); String TempStr(\"\"); String TempSymbol(\"\"); String TempTime(\"\"); Integer i; If (FindFirstOf(StrSource, \"P\") >= 0) Print(\"PutOption\"); Else Print(\"CallOption\"); i = FindFirstOf(StrSource, \"-\"); StrSource = Left(StrSource, i); Print(StrSource); TempStr = Mid(StrSource, 1, 1); If(TempStr >= \"0\" && TempStr <= \"9\") { TempSymbol = Left(StrSource, 1); Print(\"Symbol: \" + TempSymbol); TempTime = Right(StrSource, Len(StrSource) - 1); Print(\"Time: \" + TempTime); } Else { TempSymbol = Left(StrSource, 2); Print(\"Symbol: \" + TempSymbol); TempTime = Right(StrSource, Len(StrSource) - 2); Print(\"Time: \" + TempTime); }
回复:感谢!!偶然找到这个函数:RelativeSymbol(),只对期权有用