More changes to support BollingerBands.

This commit is contained in:
2025-06-15 13:56:48 -04:00
parent 9bbfc9831f
commit 9b1135b5ec
18 changed files with 631 additions and 221 deletions

View File

@@ -7,6 +7,7 @@ using System.Reactive.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Avalonia.Controls;
using CommunityToolkit.Mvvm.Input;
using DynamicData;
using MarketData;
@@ -67,8 +68,9 @@ namespace PortfolioManager.ViewModels
protected override void OnDispose()
{
MDTrace.WriteLine(LogLevel.DEBUG,$"Dispose GainLossViewModel");
base.OnDispose();
}
}
public override String DisplayName
{
@@ -737,6 +739,33 @@ namespace PortfolioManager.ViewModels
await Task.FromResult(true);
}
// *********************************************************** M E N U I T E M S ****************************************************
public ObservableCollection<MenuItem> GainLossMenuItems
{
get
{
ObservableCollection<MenuItem> collection = new ObservableCollection<MenuItem>();
collection.Add(new MenuItem() { Header = "Display Bollinger Band...", Command = BollingerBandsCommand, StaysOpenOnClick = false });
return collection;
}
}
[RelayCommand]
public async Task BollingerBands()
{
SaveParameters saveParams = SaveParameters.Parse("Type,PortfolioManager.ViewModels.BollingerBandViewModel,SelectedSymbol," + selectedGainLossSummaryItem.Symbol + ",SelectedWatchList,{All},SelectedDayCount,180,SyncTradeToBand,FALSE");
saveParams.Referer = this;
WorkspaceInstantiator.Invoke(saveParams);
await Task.FromResult(true);
// await Task.FromResult(() =>
// {
// SaveParameters saveParams = SaveParameters.Parse("Type,TradeBlotter.ViewModels.BollingerBandViewModel,SelectedSymbol," + selectedGainLossSummaryItem.Symbol + ",SelectedWatchList,{All},SelectedDayCount,180,SyncTradeToBand,FALSE");
// saveParams.Referer = this;
// WorkspaceInstantiator.Invoke(saveParams);
// });
}
// ****************************************************** T O O L T I P S *********************************************************
public String DollarChangePercent
{