NAME

Finance::Alpaca::Struct::Bar - A Single Bar Object

SYNOPSIS

use Finance::Alpaca;
my @bars = Finance::Alpaca->new( ... )->bars(
    symbol    => 'MSFT',
    timeframe => '1Min',
    start     => Time::Moment->now->with_day_of_week(2),
    end       => Time::Moment->now->with_hour(12)->with_day_of_week(3)
);

say $bars[0]->high;

DESCRIPTION

The bars API serves aggregate historical data.

Properties

The following properties are contained in the object.

$bar->close();
timestamp - Timestamp with nanosecond precision as a Time::Moment object
open - Open price
high - High price
low - Low price
close - Close price
volume - Volume
symbol - Symbol; only provided if data is from a Finance::Alpaca::Stream session

LICENSE

Copyright (C) Sanko Robinson.

This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License 2. Other copyrights, terms, and conditions may apply to data transmitted through this module.

AUTHOR

Sanko Robinson <sanko@cpan.org>