public void DoContract() { int ContractCount = 0; ptCountContracts(ref ContractCount); int ret = 0; ExtendedContractStruct contract = new ExtendedContractStruct(); //ExtendedContractStruct contract; for (int i = 0; i < ContractCount; i++) { if (0 == ptGetExtendedContract(i, ref contract)) { if (DoGetPatsContract != null) { DoGetPatsContract(contract); } } } }
public void SubscribeAll() { int ContractCount = 0; ptCountContracts(ref ContractCount); int ret = 0; for (int i = 0; i < ContractCount; i++) { ExtendedContractStruct contract = new ExtendedContractStruct(); //ExtendedContractStruct contract; if (0 == ptGetExtendedContract(i, ref contract)) { /*printf( " price Exchange=%s Commodity=%s Contract=%s\n" * ,contract.ExchangeName,contract.ContractName,contract.ContractDate); */ //ret = ptSubscribePrice("SIM", "MINI GOLD" // , "DEC17"); if (contract.NumberOfLegs == 1) { ret = ptSubscribePrice(contract.ExchangeName, contract.ContractName, contract.ContractDate); } } } }
public static extern int ptGetExtendedContract(int Index, ref ExtendedContractStruct Contract);