Class: ClickClient::FX::Order

Inherits:
Base
  • Object
show all
Defined in:
lib/clickclient/fx.rb

Overview

注文

定義済みの属性の他に、レスポンスXMLの要素名、属性名でも値にアクセスできます。 レスポンスXMLについては、クリック証券提供のドキュメントを参照ください。

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#eql?, #hash, #method_missing, #to_s

Constructor Details

#initialize(item) ⇒ Order

コンストラクタ

item

結果要素



698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
# File 'lib/clickclient/fx.rb', line 698

def initialize( item )
  super(item)
  @order_no = item.attributes["chumonBango"].to_i
  @enable_change_or_cancel = item.text( "./henkoTorikeshiKano" ).to_i == 1
  @trade_type = item.text( "./torihiki" ).to_i
  @sell_or_buy = item.text( "./baibai" ).to_i
  @trade_quantity = item.text( "./hatchuSuryo" ).to_i
  @rate = item.text( "./chumonRate" ).to_f
  @execution_expression = item.text( "./shikko" ).to_i
  @date = DateTime.strptime( item.text( "./hatchuNichiji" ), "%Y-%m-%d %H:%M:%S")
  @expiration_type = item.text( "./yukoKigen" ).to_i

  str = item.text( "./yukoNichiji" )
  @expiration_date = str != nil ? DateTime.strptime( str , "%Y-%m-%d %H:%M:%S") : nil

  @order_state = item.text( "./chumonJotai" ).to_i
  @failure_reason = item.text( "./fuseiritsuRiyu" ).to_i

  str = item.text( "./yakujoRate" )
  @settlement_rate = str != nil  ? str.to_f : nil

  str = item.text( "./yakujoNichiji" )
  @settlement_date = str != nil ? DateTime.strptime( str , "%Y-%m-%d %H:%M:%S") : nil

end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ClickClient::Base

Instance Attribute Details

#dateObject

注文を受け付けた日時



738
739
740
# File 'lib/clickclient/fx.rb', line 738

def date
  @date
end

#enable_change_or_cancelObject

注文の変更および取消が可能かどうか



726
727
728
# File 'lib/clickclient/fx.rb', line 726

def enable_change_or_cancel
  @enable_change_or_cancel
end

#execution_expressionObject

執行条件



736
737
738
# File 'lib/clickclient/fx.rb', line 736

def execution_expression
  @execution_expression
end

#expiration_dateObject

注文時に有効期限を日時指定した場合の、日時



742
743
744
# File 'lib/clickclient/fx.rb', line 742

def expiration_date
  @expiration_date
end

#expiration_typeObject

注文時に指定した有効期限種別



740
741
742
# File 'lib/clickclient/fx.rb', line 740

def expiration_type
  @expiration_type
end

#failure_reasonObject

不成立理由



746
747
748
# File 'lib/clickclient/fx.rb', line 746

def failure_reason
  @failure_reason
end

#order_noObject

注文番号



724
725
726
# File 'lib/clickclient/fx.rb', line 724

def order_no
  @order_no
end

#order_stateObject

注文状態



744
745
746
# File 'lib/clickclient/fx.rb', line 744

def order_state
  @order_state
end

#rateObject

レート。執行条件が「成行」の場合は約定レートと同値。



734
735
736
# File 'lib/clickclient/fx.rb', line 734

def rate
  @rate
end

#sell_or_buyObject

売買区分



730
731
732
# File 'lib/clickclient/fx.rb', line 730

def sell_or_buy
  @sell_or_buy
end

#settlement_dateObject

約定日時。注文が不成立の場合はnil



750
751
752
# File 'lib/clickclient/fx.rb', line 750

def settlement_date
  @settlement_date
end

#settlement_rateObject

約定レート。注文が不成立の場合はnil



748
749
750
# File 'lib/clickclient/fx.rb', line 748

def settlement_rate
  @settlement_rate
end

#trade_quantityObject

取引数量



732
733
734
# File 'lib/clickclient/fx.rb', line 732

def trade_quantity
  @trade_quantity
end

#trade_typeObject

注文時の取引種類



728
729
730
# File 'lib/clickclient/fx.rb', line 728

def trade_type
  @trade_type
end