如何设置IB外汇合约
If you want to set up two FOREX instruments in OpenQuant, for example EUR/USD and EUR/GBP currency pairs, IB TWS would require to set both instrument names to EUR and set instrument currency to USD for the first instrument and to GBP for the second one.
如果你想在OpenQuant中设置两个外汇合约,如EUR/USD和EUR/GBP货币对,IB TWS要求设置两个合约名都为EUR,并且设置第一个合约货币为USD,第二个合约货币为GBP
Since Instrument.Symbol serves as unique instrument identifier in OpenQuant, it’s not possible to have two instruments with Symbol = EUR. Thus we should use AltSymbol technique.
但OpenQuant中Instrument.Symbol必需唯一,所以不可能都设置成EUR,所以我们要用到AltSymbol技术
For the EUR/USD pair we create an instrument with Symbol = EUR USD and set AltSource = IB and AltSymbol = EUR. We set Currency = USD and Exchange = IDEALPRO.
对于EUR/USD货币对,我们创建合约符号为EUR USD,并设置AltSource=IB,AltSymbol=EUR,再设置Currency = USD和Exchange = IDEALPRO
For the EUR/GBP pair Symbol = EUR GBP, AltSource = IB, AltSymbol = EUR, Currency = USD and Exchange = IDEALPRO.
对于EUR/GBP货币对Symbol = EUR GBP, AltSource = IB, AltSymbol = EUR, Currency = USD,Exchange = IDEALPRO