/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
namespace QuantConnect.Interfaces
{
///
/// Defines live brokerage cash synchronization operations.
///
public interface IBrokerageCashSynchronizer
{
///
/// Gets the datetime of the last sync (UTC)
///
DateTime LastSyncDateTimeUtc { get; }
///
/// Returns whether the brokerage should perform the cash synchronization
///
/// The current time (UTC)
/// True if the cash sync should be performed
bool ShouldPerformCashSync(DateTime currentTimeUtc);
///
/// Synchronizes the cashbook with the brokerage account
///
/// The algorithm instance
/// The current time (UTC)
/// A function which returns the time elapsed since the last fill
/// True if the cash sync was performed successfully
bool PerformCashSync(IAlgorithm algorithm, DateTime currentTimeUtc, Func getTimeSinceLastFill);
}
}