@@ -117,6 +117,10 @@ def sell(self, client=None, timeout=None, **kwargs):
117117 kwargs ['action' ] = 'SELL'
118118 return self .__execute (client , timeout , ** kwargs )
119119
120+ def ipo (self , client = None , timeout = None , ** kwargs ):
121+ kwargs ['action' ] = 'IPO'
122+ return self .__execute (client , timeout , ** kwargs )
123+
120124 def execute (self , client = None , timeout = None , ** kwargs ):
121125 return self .__execute (client , timeout , ** kwargs )
122126
@@ -146,10 +150,12 @@ def purchase_new_stocks(self, client=None, timeout=None):
146150 for index , row in df .iterrows ():
147151 try :
148152 order = {
149- 'symbol' : row ['xcode' ], 'type' : 'LIMIT' , 'price' : row ['price' ], 'amountProportion' : 'ALL'
153+ 'symbol' : row ['xcode' ],
154+ 'price' : row ['price' ],
155+ 'amountProportion' : 'ALL'
150156 }
151157 self ._logger .info ('申购新股:{}' .format (order ))
152- self .buy (client , timeout , ** order )
158+ self .ipo (client , timeout , ** order )
153159 except Exception as e :
154160 self ._logger .error (
155161 '客户端[{}]申购新股[{}({})]失败\n {}' .format ((client or self ._client ), row ['name' ], row ['code' ], e ))
0 commit comments