Files
TradeBlotter/Views/MovingAverageView.xaml
2024-02-23 06:58:53 -05:00

87 lines
6.0 KiB
XML

<UserControl x:Class="TradeBlotter.Views.MovingAverageView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"
xmlns:dc="clr-namespace:TradeBlotter.UIUtils"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:wpfx="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<wpfx:BusyIndicator Name="BusyBar" IsBusy="{Binding Path=BusyIndicator}" BusyContent="{Binding Path=BusyContent}">
<Grid Background="LightGray">
<DockPanel>
<Grid Margin="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="6" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="3" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Vertical">
<Label Content="Watch List" HorizontalAlignment="Left" ></Label>
<ComboBox ItemsSource="{Binding Path=WatchListNames, Mode=OneTime}" SelectedItem="{Binding Path=SelectedWatchList, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}" ></ComboBox>
<!--<Label Content="Symbol:" HorizontalAlignment="Left" Target="{Binding ElementName=tradeDateLbl}" ></Label>-->
<Label Content="Symbol:" HorizontalAlignment="Left"></Label>
<ComboBox x:Name="symbolCmb" ItemsSource="{Binding Path=Symbols, Mode=OneWay}" SelectedItem="{Binding Path=SelectedSymbol, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}" >
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel/>
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>
<Label Content="Day Count" HorizontalAlignment="Left" ></Label>
<ComboBox ItemsSource="{Binding Path=DayCounts, Mode=OneWay}" SelectedItem="{Binding Path=SelectedDayCount, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}" ></ComboBox>
<Button Margin="0,2" Content="Refresh" HorizontalAlignment="Left" Command="{Binding Path=RefreshCommand}"></Button>
<CheckBox Margin="0,2" Content="Legend Visible" HorizontalAlignment="Left" IsChecked="{Binding Path=CheckBoxLegendVisible, Mode=TwoWay}"></CheckBox>
</StackPanel>
</Grid>
<d3:ChartPlotter Name="movingaverage" Margin="10,10,20,10" dc:ChartPlotterLegendBehavior.LegendVisibleProperty="{Binding Path=LegendVisible}" LegendVisibility="Hidden" d3:Viewport2D.UsesApproximateContentBoundsComparison="False" >
<d3:ChartPlotter.MainHorizontalAxis>
<d3:HorizontalDateTimeAxis Name="dateAxis"/>
</d3:ChartPlotter.MainHorizontalAxis>
<d3:ChartPlotter.MainVerticalAxis>
<d3:VerticalAxis Name="countAxis"/>
</d3:ChartPlotter.MainVerticalAxis>
<d3:LineGraph d3:NewLegend.Description="Close" x:Name="Close" DataSource="{Binding Path=Close}" Stroke="Black" StrokeThickness="1" />
<d3:LineGraph d3:NewLegend.Description="High" x:Name="High" DataSource="{Binding Path=High}" Stroke="Blue" StrokeThickness="1" />
<d3:LineGraph d3:NewLegend.Description="Low" x:Name="Low" DataSource="{Binding Path=Low}" Stroke="Red" StrokeThickness="1" />
<d3:LineGraph d3:NewLegend.Description="MA200" x:Name="MA200" DataSource="{Binding Path=MA200}" Stroke="#C4E5A8" StrokeThickness="3" />
<d3:LineGraph d3:NewLegend.Description="MA100" x:Name="MA100" DataSource="{Binding Path=MA100}" Stroke="#8AD982" StrokeThickness="3" />
<d3:LineGraph d3:NewLegend.Description="MA55" x:Name="MA55" DataSource="{Binding Path=MA55}" Stroke="#13C14E" StrokeThickness="3" />
<d3:LineGraph d3:NewLegend.Description="MA21" x:Name="MA21" DataSource="{Binding Path=MA21}" Stroke="#00A522" StrokeThickness="3" />
<d3:LineGraph d3:NewLegend.Description="MA5" x:Name="MA5" DataSource="{Binding Path=MA5}" Stroke="#005B00" StrokeThickness="3" />
<d3:CursorCoordinateGraph Name="cursorGraph" dc:CoordinateGraphBehavior.XTextMappingProperty="MM/dd/yyyy" LineStrokeThickness="1"/>
<!--<d3:AxisCursorGraph></d3:AxisCursorGraph>-->
<d3:MarkerPointsGraph x:Name="MarkerPointsGraph" DataSource="{Binding Path=TradePoints}" >
<d3:MarkerPointsGraph.Marker>
<d3:TrianglePointMarker Size="9">
<d3:TrianglePointMarker.Pen>
<Pen Thickness="1">
<Pen.Brush >
<SolidColorBrush Color="Black">
</SolidColorBrush>
</Pen.Brush>
</Pen>
</d3:TrianglePointMarker.Pen>
<d3:TrianglePointMarker.Fill>
<SolidColorBrush Color="Yellow">
</SolidColorBrush>
</d3:TrianglePointMarker.Fill>
</d3:TrianglePointMarker>
</d3:MarkerPointsGraph.Marker>
</d3:MarkerPointsGraph>
<d3:Header FontFamily="Arial" Content="{Binding Path=Title}"/>
<d3:VerticalAxisTitle FontFamily="Arial" Content="Price"/>
<d3:HorizontalAxisTitle FontFamily="Arial" Content="Date" />
</d3:ChartPlotter>
</DockPanel>
</Grid>
</wpfx:BusyIndicator>
</UserControl>