ID EN
#Dynamic array

STOCKHISTORY

Excel Functions 🇮🇩 Bahasa Indonesia

Ambil informasi harga saham

Syntax

EXCEL
=STOCKHISTORY(stock, start_date, [end_date], [interval], [headers], [properties], ...)

Arguments

Parameter Deskripsi
stock A ticker symbol in double quotes ("MSFT", "AAPL", "GOOG", etc.).
start_date The start date for data to be retrieved.
end_date [optional] The end date for data to be retrieved. Default is start_date.
interval [optional] Time interval. Daily = 0, weekly = 1, monthly = 2. Default is 0.
headers [optional] No header = 0, basic header = 1, instrument + header = 2. Default is 1.
properties [optional] Additional data to retrieve. Default is Date and Close. See below.

Return Value

Berbagai informasi harga saham

Details

Fungsi STOCKHISTORY mengambil informasi historis harga saham berdasarkan simbol dan rentang tanggal tertentu. Tujuan utama STOCKHISTORY adalah untuk mendapatkan sejarah suatu instrumen keuangan dari waktu ke waktu. Meskipun namanya STOCKHISTORY dimaksudkan untuk bekerja hanya dengan saham, STOCKHISTORY juga dapat bekerja dengan obligasi, dana indeks, reksa dana, dan nilai tukar mata uang. Perhatikan bahwa STOCKHISTORY mengambil beberapa hasil. Hasilnya adalah serangkaian nilai yang tersebar di lembar kerja menjadi beberapa sel. Fungsi STOCKHISTORY menerima lima argumen utama, dan enam argumen properti tambahan untuk mengambil informasi tambahan. Stock dan start_date adalah satu-satunya argumen yang diperlukan. Setiap argumen dijelaskan secara rinci di bawah ini. Properti tambahan dijelaskan dalam tabel di sini. TIDAK

Contoh

Example - Get daily close prices for a stock

To retrieve the daily close price for Apple ("AAPL") for the month of January 2021, the formula in cell B4 is:

EXCEL
=STOCKHISTORY("AAPL",DATE(2021,1,1),DATE(2021,1,31))
Example - Monthly close prices

The STOCKHISTORY function can retrieve daily (0), weekly (1), and monthly (2) price data by setting a value for the interval argument. For example, to

EXCEL
=STOCKHISTORY("AAPL",DATE(2023,1,1),DATE(2023,12,31),2)
Example - Make inputs variable

In the example below, the inputs for stock, start_date, and end_date are made variable by exposing them on the worksheet in cells F6, F7, and F8. The

EXCEL
=STOCKHISTORY(F6,F7,F8,2)
Example - Additional properties

The properties returned by STOCKHISTORY can be controlled by customizing and/or reordering numbers starting with the sixth argument (property1). In th

EXCEL
=STOCKHISTORY(I6,I7,I8,2,1,0,5,3,4,1)
Example - Additional properties

Note that the reason STOCKHISTORY uses numeric codes for properties is so they can be easily reordered. In the worksheet below, we are returning the s

EXCEL
=STOCKHISTORY(I6,I7,I8,2,1,0,1,3,4,5)
Example - A horizontal layout for multiple stocks

By default, STOCKHISTORY returns information in a vertical layout. To display results in a horizontal layout, you can use the TRANSPOSE function. In t

EXCEL
=TRANSPOSE(STOCKHISTORY(B5,DATE(2024,1,1),DATE(2024,6,1),2,0,1))