• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TagValue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.ib.client.TagValue的典型用法代码示例。如果您正苦于以下问题:Java TagValue类的具体用法?Java TagValue怎么用?Java TagValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TagValue类属于com.ib.client包,在下文中一共展示了TagValue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: subscribeLevel1

import com.ib.client.TagValue; //导入依赖的package包/类
@Override
public synchronized void subscribeLevel1(Ticker ticker, Level1QuoteListener listener) {
    super.subscribeLevel1(ticker, listener);
    Integer quoteId = tickerMap.get(ticker);
    if (quoteId == null) {
        quoteId = ++nextQuoteId;
        tickerMap.put(ticker, quoteId);
        idToTickerMap.put(quoteId, ticker);
        Contract contract = ContractBuilderFactory.getContractBuilder(ticker).buildContract(ticker);
        List<TagValue> list = new ArrayList<>();
        list.add(new TagValue("XYZ","XYZ"));
        ibConnection.reqMktData(nextQuoteId, contract, "", false, list);
    }

    if (closeQuoteMap.get(ticker) != null) {
        listener.quoteRecieved(closeQuoteMap.get(ticker));
    }

    if (openQuoteMap.get(ticker) != null) {
        listener.quoteRecieved(openQuoteMap.get(ticker));
    }

}
 
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:24,代码来源:IBQuoteEngine.java


示例2: onOK

import com.ib.client.TagValue; //导入依赖的package包/类
private void onOK() {
	m_order.account( m_account.getText().toUpperCase() );
	m_order.modelCode( m_modelCode.getText().trim() );
	m_order.action( m_action.getSelectedItem() );
	m_order.totalQuantity( m_quantity.getDouble() );
	m_order.displaySize( m_displaySize.getInt() );
	m_order.orderType( m_orderType.getSelectedItem() );
	m_order.lmtPrice( m_lmtPrice.getDouble() );
	m_order.auxPrice( m_auxPrice.getDouble() );
	m_order.tif( m_tif.getSelectedItem() );
	m_order.lmtPriceOffset(m_lmtPriceOffset.getDouble());
	m_order.triggerPrice(m_triggerPrice.getDouble());
	
	if (m_contract.isCombo() ) {
		TagValue tv = new TagValue( ComboParam.NonGuaranteed.toString(), m_nonGuaranteed.isSelected() ? "1" : "0");
		m_order.smartComboRoutingParams().add( tv);
	}
}
 
开发者ID:qerio,项目名称:goib,代码行数:19,代码来源:TicketDlg.java


示例3: FillAccumulateDistributeParams

import com.ib.client.TagValue; //导入依赖的package包/类
public static void FillAccumulateDistributeParams(Order baseOrder, int componentSize, int timeBetweenOrders, boolean randomizeTime20, boolean randomizeSize55,
           int giveUp, boolean catchUp, boolean waitOrFill, String startTime, String endTime) {
	
	baseOrder.algoStrategy("AD");
	baseOrder.algoParams(new ArrayList<TagValue>());
	baseOrder.algoParams().add(new TagValue("componentSize", String.valueOf(componentSize)));
	baseOrder.algoParams().add(new TagValue("timeBetweenOrders", String.valueOf(timeBetweenOrders)));
	baseOrder.algoParams().add(new TagValue("randomizeTime20", randomizeTime20 ? "1" : "0"));
	baseOrder.algoParams().add(new TagValue("randomizeSize55", randomizeSize55 ? "1" : "0"));
	baseOrder.algoParams().add(new TagValue("giveUp", String.valueOf(giveUp)));
	baseOrder.algoParams().add(new TagValue("catchUp", catchUp ? "1" : "0"));
	baseOrder.algoParams().add(new TagValue("waitOrFill", waitOrFill ? "1" : "0"));
	baseOrder.algoParams().add(new TagValue("startTime", startTime));
	baseOrder.algoParams().add(new TagValue("endTime", endTime));
	
}
 
开发者ID:qerio,项目名称:goib,代码行数:17,代码来源:AvailableAlgoParams.java


示例4: LimitOrderForComboWithLegPrices

import com.ib.client.TagValue; //导入依赖的package包/类
public static Order LimitOrderForComboWithLegPrices(String action, double quantity, boolean nonGuaranteed, double[] legPrices) {
	// ! [limitordercombolegprices]
	Order order = new Order();
	order.action(action);
	order.orderType("LMT");
	order.totalQuantity(quantity);
	order.orderComboLegs(new ArrayList<OrderComboLeg>());
	
	for(double price : legPrices) {
		OrderComboLeg comboLeg = new OrderComboLeg();
		comboLeg.price(5.0);
		order.orderComboLegs().add(comboLeg);
	}
	
	if (nonGuaranteed)
	{
		List<TagValue> smartComboRoutingParams = new ArrayList<TagValue>();
		smartComboRoutingParams.add(new TagValue("NonGuaranteed", "1"));
	}
	// ! [limitordercombolegprices]
	return order;
}
 
开发者ID:qerio,项目名称:goib,代码行数:23,代码来源:OrderSamples.java


示例5: main

import com.ib.client.TagValue; //导入依赖的package包/类
public static void main(String[] args){

        // create connection object for to communicate with TWS
        EClientSocket eClientSocket = new EClientSocket(new TWSClientInterface());

        // try to connect to TWS
        eClientSocket.eConnect("127.0.0.1",7496,0);

        // initialize a contract for symbols to watch
        Contract FB   = ContractFactory.GenericStockContract("FB");
        Contract BABA = ContractFactory.GenericStockContract("BABA");

        // request real-time bars
        eClientSocket.reqRealTimeBars(0,FB  ,0,"TRADES",false,new Vector<TagValue>());
        eClientSocket.reqRealTimeBars(1,BABA,0,"TRADES",false,new Vector<TagValue>());
    }
 
开发者ID:softwarespartan,项目名称:TWS,代码行数:17,代码来源:RealTimeBars.java


示例6: testGetDefaultTagVector

import com.ib.client.TagValue; //导入依赖的package包/类
@Test
public void testGetDefaultTagVector() {
    Vector<TagValue> expected = new Vector<>();
    expected.add(new TagValue("XYZ", "XYZ"));

    assertEquals(expected, IbUtils.getDefaultTagVector());
}
 
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:8,代码来源:IbUtilsTest.java


示例7: testGetDefaultTagList

import com.ib.client.TagValue; //导入依赖的package包/类
@Test
public void testGetDefaultTagList() {
    List<TagValue> expected = new ArrayList<>();
    expected.add(new TagValue("XYZ", "XYZ"));

    assertEquals(expected, IbUtils.getDefaultTagList());
}
 
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:8,代码来源:IbUtilsTest.java


示例8: reqOptionMktData

import com.ib.client.TagValue; //导入依赖的package包/类
public void reqOptionMktData(NewContract contract, String genericTickList, boolean snapshot, IOptHandler handler) {
  	int reqId = m_reqId++;
  	m_topMktDataMap.put( reqId, handler);
  	m_optionCompMap.put( reqId, handler);
  	m_client.reqMktData( reqId, contract.getContract(), genericTickList, snapshot, Collections.<TagValue>emptyList() );
sendEOM();
  }
 
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:8,代码来源:ApiController.java


示例9: reqEfpMktData

import com.ib.client.TagValue; //导入依赖的package包/类
public void reqEfpMktData(NewContract contract, String genericTickList, boolean snapshot, IEfpHandler handler) {
  	int reqId = m_reqId++;
  	m_topMktDataMap.put( reqId, handler);
  	m_efpMap.put( reqId, handler);
  	m_client.reqMktData( reqId, contract.getContract(), genericTickList, snapshot, Collections.<TagValue>emptyList() );
sendEOM();
  }
 
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:8,代码来源:ApiController.java


示例10: reqDeepMktData

import com.ib.client.TagValue; //导入依赖的package包/类
public void reqDeepMktData( NewContract contract, int numRows, IDeepMktDataHandler handler) {
  	int reqId = m_reqId++;
  	m_deepMktDataMap.put( reqId, handler);
  	Vector<TagValue> mktDepthOptions = new Vector<TagValue>();
  	m_client.reqMktDepth( reqId, contract.getContract(), numRows, mktDepthOptions);
sendEOM();
  }
 
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:8,代码来源:ApiController.java


示例11: reqScannerSubscription

import com.ib.client.TagValue; //导入依赖的package包/类
public void reqScannerSubscription( ScannerSubscription sub, IScannerHandler handler) {
	int reqId = m_reqId++;
	m_scannerMap.put( reqId, handler);
	Vector<TagValue> scannerSubscriptionOptions = new Vector<TagValue>();
	m_client.reqScannerSubscription( reqId, sub, scannerSubscriptionOptions);
	sendEOM();
}
 
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:8,代码来源:ApiController.java


示例12: reqHistoricalData

import com.ib.client.TagValue; //导入依赖的package包/类
/** @param endDateTime format is YYYYMMDD HH:MM:SS [TMZ]
*  @param duration is number of durationUnits */
  public void reqHistoricalData( NewContract contract, String endDateTime, int duration, DurationUnit durationUnit, BarSize barSize, WhatToShow whatToShow, boolean rthOnly, IHistoricalDataHandler handler) {
  	int reqId = m_reqId++;
  	m_historicalDataMap.put( reqId, handler);
  	String durationStr = duration + " " + durationUnit.toString().charAt( 0);
  	m_client.reqHistoricalData(reqId, contract.getContract(), endDateTime, durationStr, barSize.toString(), whatToShow.toString(), rthOnly ? 1 : 0, 2, Collections.<TagValue>emptyList() );
sendEOM();
  }
 
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:10,代码来源:ApiController.java


示例13: reqRealTimeBars

import com.ib.client.TagValue; //导入依赖的package包/类
public void reqRealTimeBars(NewContract contract, WhatToShow whatToShow, boolean rthOnly, IRealTimeBarHandler handler) {
  	int reqId = m_reqId++;
  	m_realTimeBarMap.put( reqId, handler);
  	Vector<TagValue> realTimeBarsOptions = new Vector<TagValue>();
  	m_client.reqRealTimeBars(reqId, contract.getContract(), 0, whatToShow.toString(), rthOnly, realTimeBarsOptions);
sendEOM();
  }
 
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:8,代码来源:ApiController.java


示例14: subscribeMarketDepth

import com.ib.client.TagValue; //导入依赖的package包/类
@Override
public void subscribeMarketDepth(Ticker ticker, Level2QuoteListener listener) {
    super.subscribeMarketDepth(ticker, listener);
    Integer quoteId = level2TickerMap.get(ticker);
    if (quoteId == null) {
        quoteId = ++nextQuoteId;
        level2TickerMap.put(ticker, quoteId);
        level2IdToTickerMap.put(quoteId, ticker);
        Contract contract = ContractBuilderFactory.getContractBuilder(ticker).buildContract(ticker);
        Vector<TagValue> v = new Vector<>();
        v.add(new TagValue("XYZ", "XYZ"));
        ibConnection.reqMktDepth(quoteId, contract, 100, v);

    }
}
 
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:16,代码来源:IBQuoteEngine.java


示例15: testSubscribeLevel1

import com.ib.client.TagValue; //导入依赖的package包/类
@Test
    @Ignore
    public void testSubscribeLevel1() {
        final EClientSocket mockSocketInterface = mockery.mock(EClientSocket.class);
        final IBConnectionInterface mockConnectionInterface = mockery.mock(IBConnectionInterface.class);
        final Level1QuoteListener mockQuoteListener = mockery.mock(Level1QuoteListener.class);
        final Ticker ticker = new StockTicker("LUT");
        final int requestId = 1;
        final Contract contract = ContractBuilderFactory.getContractBuilder(ticker).buildContract(ticker);
        final List<TagValue> list = new ArrayList<>();
        list.add(new TagValue("XYZ", "XYZ"));

//        mockery.checking(new Expectations() {
//            {
//                
//                one(mockSocketInterface).reqMktData(requestId + 1, contract, "", false, list);
//            }
//        });

//        IBQuoteEngine quoteEngine = new IBQuoteEngine(mockSocketInterface, mockConnectionInterface);
//        quoteEngine.subscribeLevel1(ticker, mockQuoteListener);
//        assertEquals( (requestId+1), quoteEngine.nextQuoteId );
//        assertEquals( (Integer)(requestId+1), quoteEngine.tickerMap.get(ticker) );
//        assertEquals(  ticker, quoteEngine.idToTickerMap.get(requestId+1) );
//        mockery.assertIsSatisfied();
        fail();
    }
 
开发者ID:rterp,项目名称:SumZeroTrading,代码行数:28,代码来源:IBQuoteEngineTest.java


示例16: reqTopMktData

import com.ib.client.TagValue; //导入依赖的package包/类
public void reqTopMktData(Contract contract, String genericTickList, boolean snapshot, ITopMktDataHandler handler) {
if (!checkConnection())
	return;

  	int reqId = m_reqId++;
  	m_topMktDataMap.put( reqId, handler);
  	m_client.reqMktData( reqId, contract, genericTickList, snapshot, Collections.<TagValue>emptyList() );
sendEOM();
  }
 
开发者ID:qerio,项目名称:goib,代码行数:10,代码来源:ApiController.java


示例17: reqOptionMktData

import com.ib.client.TagValue; //导入依赖的package包/类
public void reqOptionMktData(Contract contract, String genericTickList, boolean snapshot, IOptHandler handler) {
if (!checkConnection())
	return;

  	int reqId = m_reqId++;
  	m_topMktDataMap.put( reqId, handler);
  	m_optionCompMap.put( reqId, handler);
  	m_client.reqMktData( reqId, contract, genericTickList, snapshot, Collections.<TagValue>emptyList() );
sendEOM();
  }
 
开发者ID:qerio,项目名称:goib,代码行数:11,代码来源:ApiController.java


示例18: reqEfpMktData

import com.ib.client.TagValue; //导入依赖的package包/类
public void reqEfpMktData(Contract contract, String genericTickList, boolean snapshot, IEfpHandler handler) {
if (!checkConnection())
	return;

  	int reqId = m_reqId++;
  	m_topMktDataMap.put( reqId, handler);
  	m_efpMap.put( reqId, handler);
  	m_client.reqMktData( reqId, contract, genericTickList, snapshot, Collections.<TagValue>emptyList() );
sendEOM();
  }
 
开发者ID:qerio,项目名称:goib,代码行数:11,代码来源:ApiController.java


示例19: reqDeepMktData

import com.ib.client.TagValue; //导入依赖的package包/类
public void reqDeepMktData( Contract contract, int numRows, IDeepMktDataHandler handler) {
if (!checkConnection())
	return;

  	int reqId = m_reqId++;
  	m_deepMktDataMap.put( reqId, handler);
  	ArrayList<TagValue> mktDepthOptions = new ArrayList<TagValue>();
  	m_client.reqMktDepth( reqId, contract, numRows, mktDepthOptions);
sendEOM();
  }
 
开发者ID:qerio,项目名称:goib,代码行数:11,代码来源:ApiController.java


示例20: reqScannerSubscription

import com.ib.client.TagValue; //导入依赖的package包/类
public void reqScannerSubscription( ScannerSubscription sub, IScannerHandler handler) {
	if (!checkConnection())
		return;

	int reqId = m_reqId++;
	m_scannerMap.put( reqId, handler);
	ArrayList<TagValue> scannerSubscriptionOptions = new ArrayList<TagValue>();
	m_client.reqScannerSubscription( reqId, sub, scannerSubscriptionOptions);
	sendEOM();
}
 
开发者ID:qerio,项目名称:goib,代码行数:11,代码来源:ApiController.java



注:本文中的com.ib.client.TagValue类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TabixReader类代码示例发布时间:2022-05-23
下一篇:
Java GlobusGSSCredentialImpl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap