I am developing a C# program. I want to compare a stock price from 5 minutes to the current price. How can I get the price from 5 minutes ago? This is what I have so far.
var dataClient = Alpaca.Markets.Environments.Paper
.GetAlpacaDataClient(new SecretKey(API_KEY, API_SECRET));
var dataRequest = new LatestMarketDataRequest(symbol);
//// Submit a limit order to attempt to grow our short position
//// First, get an up-to-date price for our security
var snapshot = await dataClient.GetSnapshotAsync(dataRequest);
var price = snapshot.MinuteBar.Close;