lib/cotcube-bardata/eods.rb
# the following method seems to be garbage. It is not used anywhere. It seems it's purpose
# was to retrieve a list of quarters that have not been fetched recently (--> :age)
the following method seems to be garbage. It is not used anywhere. It seems it's purpose
was to retrieve a list of quarters that have not been fetched recently (--> :age)
the following method seems to be garbage . It is not used anywhere . It seems it ' s purpose was to retrieve a list of quarters that have not been fetched recently ( -- > : age )
def provide_most_liquids_by_eod(symbol: nil, id: nil, 
                                    config: init,
                                    date: last_trade_date,
                                    filter: :volume_part,
                                    age: 1.hour)
      sym  = get_id_set(symbol: symbol, id: id) if symbol || id
      eods = provide_eods(id: sym.nil? ? nil : sym[:id], config: config, dates: date, filter: filter)
      result = []
      eods.map do |eod|
        symbol   = eod[0..1]
        contract = eod[2..4]
        sym      = symbols.select { |s| s[:symbol] == symbol.to_s.upcase }.first
        quarter  = "#{config[:data_path]}/quarters/#{sym[:id]}/#{contract}.csv"
        if File.exist?(quarter)
          result << eod if Time.now - File.mtime(quarter) > age
        else
          result << eod
        end
      end
      result
    end
def provide_most_liquids_by_eod ( symbol : nil , id : nil , config : init , date : last_trade_date , filter : :volume_part , age : 1 . hour ) sym = get_id_set ( symbol : symbol , id : id ) if symbol || id eods = provide_eods ( id : sym . nil? ? nil : sym [ :id ] , config : config , dates : date , filter : filter ) result = [ ] eods . map do | eod | symbol = eod [ 0 .. 1 ] contract = eod [ 2 .. 4 ] sym = symbols . select { | s | s [ :symbol ] == symbol . to_s . upcase } . first quarter = "#{config[:data_path]}/quarters/#{sym[:id]}/#{contract}.csv" if File . exist? ( quarter ) result << eod if Time . now - File . mtime ( quarter ) > age else result << eod end end result end
the following method seems to be garbage.
the following method seems to be garbage .
# rubocop:disable Metrics/ParameterLists # noinspection RubyScope # puts "#{quarter}: #{ Time.now } - #{File.mtime(quarter)} > #{age} : #{Time.now - File.mtime(quarter) > age}"
symbol
<not_specific>
id
<not_specific>
config
<not_specific>
init
<not_specific>
date
<not_specific>
last_trade_date
<not_specific>
filter
<not_specific>
age
<not_specific>
hour
<not_specific>