Class: IB::ExecutionCondition

Inherits:
OrderCondition show all
Defined in:
lib/models/ib/condition.rb

Constant Summary

Constants inherited from OrderCondition

OrderCondition::Subclasses

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from OrderCondition

#default_attributes, make_from, #serialize_contract_by_con_id, verify_contract_if_necessary

Methods included from BaseProperties

#==, #as_table, #content_attributes, #default_attributes, #invariant_attributes, #set_attribute_defaults, #table_header, #table_row, #to_human, #update_missing

Class Method Details

.fabricate(contract) ⇒ Object



129
130
131
# File 'lib/models/ib/condition.rb', line 129

def self.fabricate contract
	self.new contract: verify_contract_if_necessary( contract )
end

.make(buffer) ⇒ Object



114
115
116
117
118
119
120
121
122
123
# File 'lib/models/ib/condition.rb', line 114

def self.make  buffer
	m =self.new  conjunction_connection:  buffer.read_string,
							 operator: buffer.read_int

	the_contract = IB::Contract.new sec_type: buffer.read_string,
																	exchange: buffer.read_string,
																	symbol: buffer.read_string
	m.contract = the_contract
	m
end

Instance Method Details

#condition_typeObject



110
111
112
# File 'lib/models/ib/condition.rb', line 110

def condition_type 
	5
end

#serializeObject



125
126
127
# File 'lib/models/ib/condition.rb', line 125

def serialize
	super << contract[:sec_type] <<(contract.primary_exchange.presence || contract.exchange) << contract.symbol
end