lib/ig_markets/dealing_platform/streaming_methods.rb
def build_accounts_subscription(accounts = nil)
        accounts ||= @dealing_platform.client_account_summary.accounts

        items = Array(accounts).map { |account| "ACCOUNT:#{account.account_id}" }
        fields = %i[available_cash available_to_deal deposit equity equity_used funds margin margin_lr
                    margin_nlr pnl pnl_lr pnl_nlr]

        build_subscription items: items, fields: fields, mode: :merge
      end
# Creates a new subscription for balance updates on the specified account(s). The returned
# {Streaming::Subscription} must be passed to {#start_subscriptions} in order to actually start streaming its
# data.
#
# @param [Array<#account_id>, nil] accounts The accounts to create a subscription for. If this is `nil` then the
#        new subscription will apply to all the accounts for the active client.
#
# @return [Streaming::Subscription]
Creates a new subscription for balance updates on the specified account(s). The returned
{Streaming::Subscription} must be passed to {#start_subscriptions} in order to actually start streaming its
data.
Creates a new subscription for balance updates on the specified account ( s ) . The returned { Streaming :: Subscription } must be passed to { #start_subscriptions } in order to actually start streaming its data .
def build_accounts_subscription(accounts = nil)
        accounts ||= @dealing_platform.client_account_summary.accounts
        items = Array(accounts).map { |account| "ACCOUNT:#{account.account_id}" }
        fields = %i[available_cash available_to_deal deposit equity equity_used funds margin margin_lr
                    margin_nlr pnl pnl_lr pnl_nlr]
        build_subscription items: items, fields: fields, mode: :merge
      end
def build_accounts_subscription ( accounts = nil ) accounts ||= @dealing_platform . client_account_summary . accounts items = Array ( accounts ) . map { | account | "ACCOUNT:#{account.account_id}" } fields = %i[ available_cash available_to_deal deposit equity equity_used funds margin margin_lr margin_nlr pnl pnl_lr pnl_nlr ] build_subscription items : items , fields : fields , mode : :merge end
Creates a new subscription for balance updates on the specified account(s).
Creates a new subscription for balance updates on the specified account ( s ) .
None
Streaming::Subscription
accounts
accounts The accounts to create a subscription for. If this is `nil` then the new subscription will apply to all the accounts for the active client.
accounts The accounts to create a subscription for . If this is ` nil ` then the new subscription will apply to all the accounts for the active client .