<UserControl x:Class="TradeBlotter.Views.BollingerBandView"
             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" />
          <RowDefinition Height="30" />
          <RowDefinition Height="30" />          
          <RowDefinition Height="30" />
          <RowDefinition Height="30" />
          <RowDefinition Height="89*" />
        </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}" ></ComboBox>
        <Label Content="Symbol" HorizontalAlignment="Left"></Label>					
        <ComboBox Name="cbSymbols" ItemsSource="{Binding Path=Symbols, Mode=OneWay}" SelectedItem="{Binding Path=SelectedSymbol}" UseLayoutRounding="False" >
					<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}" ></ComboBox>
        <Button Margin="0,2" Content="Refresh" HorizontalAlignment="Left" Command="{Binding Path=RefreshCommand}"></Button>
        </StackPanel>
        <CheckBox Content="Sync Trade To Band" IsChecked="{Binding Mode=TwoWay,Path=SyncTradeToBand}" Grid.ColumnSpan="3" Grid.Row="3" Height="16" HorizontalAlignment="Left" Margin="5,6,0,0" VerticalAlignment="Top" />
        <CheckBox Content="Show Trade Labels" IsChecked="{Binding Mode=TwoWay,Path=ShowTradeLabels}" Grid.ColumnSpan="3" Grid.Row="4" Height="16" HorizontalAlignment="Left" Margin="5,6,0,0" VerticalAlignment="Top" />
        <CheckBox Content="Show Insider Transactions" IsChecked="{Binding Mode=TwoWay,Path=CheckBoxShowInsiderTransactions}" Grid.ColumnSpan="3" Grid.Row="5" Height="16" HorizontalAlignment="Left" Margin="5,6,0,0" VerticalAlignment="Top" />
        <CheckBox Content="Legend Visible" IsChecked="{Binding Mode=TwoWay,Path=CheckBoxLegendVisible}" Grid.ColumnSpan="3" Grid.Row="6" Height="16" HorizontalAlignment="Left" Margin="5,6,0,0" VerticalAlignment="Top" />
        <CheckBox Content="Least Squares Fit" IsChecked="{Binding Mode=TwoWay,Path=LeastSquaresFit}" Grid.ColumnSpan="3" Grid.Row="7" Height="16" HorizontalAlignment="Left" Margin="5,6,0,0" VerticalAlignment="Top" />
				<CheckBox Content="Show Risk Free" IsChecked="{Binding Mode=TwoWay,Path=ShowRiskFree}" Grid.ColumnSpan="3" Grid.Row="8" Height="16" HorizontalAlignment="Left" Margin="5,6,0,0" VerticalAlignment="Top" />
				</Grid>
      <Grid> 
        <Grid.RowDefinitions>
          <RowDefinition Height="3*" />
          <RowDefinition Height="*" />
        </Grid.RowDefinitions>
          <d3:ChartPlotter Grid.Row="0" Margin="10,10,20,10" x:Name="bollinger" BorderThickness="0" Background="WhiteSmoke" dc:ChartPlotterLegendBehavior.LegendVisibleProperty="{Binding LegendVisible}" LegendVisibility="Hidden" d3:Viewport2D.UsesApproximateContentBoundsComparison="False">
            <d3:ChartPlotter.MainVerticalAxis>
              <d3:VerticalAxis x:Name="countAxis" MaxWidth="40" MinWidth="40"/>
            </d3:ChartPlotter.MainVerticalAxis>
            <d3:ChartPlotter.MainHorizontalAxis>
              <d3:HorizontalDateTimeAxis x:Name="dateAxis"/>
            </d3:ChartPlotter.MainHorizontalAxis>
						<d3:LineGraph x:Name="K" d3:NewLegend.Description="K" DataSource="{Binding K}" Stroke="Green" StrokeThickness="3"/>
						<d3:LineGraph x:Name="L" d3:NewLegend.Description="L" DataSource="{Binding L}" Stroke="Green" StrokeThickness="3"/>
            <d3:LineGraph x:Name="KL1" d3:NewLegend.Description="KL1" DataSource="{Binding KL1}" Stroke="Green"/>
            <d3:LineGraph x:Name="LP1" d3:NewLegend.Description="LP1" DataSource="{Binding LP1}" Stroke="Green"/>
            <d3:LineGraph x:Name="High" d3:NewLegend.Description="High" DataSource="{Binding High}" Stroke="Blue" StrokeThickness="2"/>
            <d3:LineGraph x:Name="Low" d3:NewLegend.Description="Low" DataSource="{Binding Low}" Stroke="Red" StrokeThickness="2"/>
            <d3:LineGraph x:Name="Close" d3:NewLegend.Description="Close" DataSource="{Binding Close}" Stroke="Black" StrokeThickness="2"/>
            <d3:LineGraph x:Name="LeastSquares" d3:NewLegend.Description="LeastSquares" DataSource="{Binding LeastSquares}" Stroke="Orange" StrokeThickness="2"/>
            <d3:LineGraph x:Name="SMAN" d3:NewLegend.Description="SMAN" DataSource="{Binding SMAN}" Stroke="Purple" StrokeThickness="2"/>
            <d3:CursorCoordinateGraph x:Name="cursorGraph" LineStrokeThickness="1" dc:CoordinateGraphBehavior.XTextMappingProperty="MM/dd/yyyy"/>
            <!--<d3:AxisCursorGraph/>-->
            <d3:MarkerPointsGraph x:Name="MarkerPointsGraph" DataSource="{Binding TradePoints}">
              <d3:MarkerPointsGraph.Marker>
                <d3:TrianglePointMarker Fill="Yellow" Size="9">
                  <d3:TrianglePointMarker.Pen>
                    <Pen Brush="Black" Thickness="1"/>
                  </d3:TrianglePointMarker.Pen>
                </d3:TrianglePointMarker>
              </d3:MarkerPointsGraph.Marker>
            </d3:MarkerPointsGraph>
            <d3:MarkerPointsGraph x:Name="ZeroPointMarkerPoints" DataSource="{Binding ZeroPoint}">
              <d3:MarkerPointsGraph.Marker>
                <d3:TrianglePointMarker Fill="Blue" Size="9">
                  <d3:TrianglePointMarker.Pen>
                    <Pen Brush="Black" Thickness="1"/>
                  </d3:TrianglePointMarker.Pen>
                </d3:TrianglePointMarker>
              </d3:MarkerPointsGraph.Marker>
            </d3:MarkerPointsGraph>
            <d3:MarkerPointsGraph x:Name="StopLimitMarkerPoints" DataSource="{Binding StopLimit}">
              <d3:MarkerPointsGraph.Marker>
                <d3:TrianglePointMarker Fill="Red" Size="9">
                  <d3:TrianglePointMarker.Pen>
                    <Pen Brush="Black" Thickness="1"/>
                  </d3:TrianglePointMarker.Pen>
                </d3:TrianglePointMarker>
              </d3:MarkerPointsGraph.Marker>
            </d3:MarkerPointsGraph>
            <d3:MarkerPointsGraph x:Name="RiskFreeRatePointMarkerPoints" DataSource="{Binding RiskFreeRatePoint}">
              <d3:MarkerPointsGraph.Marker>
                <d3:TrianglePointMarker Fill="Purple" Size="9">
                  <d3:TrianglePointMarker.Pen>
                    <Pen Brush="Black" Thickness="1"/>
                  </d3:TrianglePointMarker.Pen>
                </d3:TrianglePointMarker>
              </d3:MarkerPointsGraph.Marker>
            </d3:MarkerPointsGraph>
            <d3:MarkerPointsGraph x:Name="InsiderTransactionPointMarkerPointsDisposedSmall" DataSource="{Binding InsiderTransactionPointDisposedSmall}">
              <d3:MarkerPointsGraph.Marker>
                <d3:TrianglePointMarker Fill="Red" Orientation="down" Size="9">
                  <d3:TrianglePointMarker.Pen>
                    <Pen Brush="Black" Thickness="1"/>
                  </d3:TrianglePointMarker.Pen>
                </d3:TrianglePointMarker>                                                                                                                          
              </d3:MarkerPointsGraph.Marker>
            </d3:MarkerPointsGraph>   
            <d3:MarkerPointsGraph x:Name="InsiderTransactionPointMarkerPointsDisposedMedium" DataSource="{Binding InsiderTransactionPointDisposedMedium}">
              <d3:MarkerPointsGraph.Marker>
                <d3:TrianglePointMarker Fill="Red" Orientation="down" Size="13">
                  <d3:TrianglePointMarker.Pen>
                    <Pen Brush="Black" Thickness="1"/>
                  </d3:TrianglePointMarker.Pen>
                </d3:TrianglePointMarker>                                                                                                                          
              </d3:MarkerPointsGraph.Marker>
            </d3:MarkerPointsGraph>   
            <d3:MarkerPointsGraph x:Name="InsiderTransactionPointMarkerPointsDisposedLarge" DataSource="{Binding InsiderTransactionPointDisposedLarge}">
              <d3:MarkerPointsGraph.Marker>
                <d3:TrianglePointMarker Fill="Red" Orientation="down" Size="17">
                  <d3:TrianglePointMarker.Pen>
                    <Pen Brush="Black" Thickness="1"/>
                  </d3:TrianglePointMarker.Pen>
                </d3:TrianglePointMarker>                                                                                                                          
              </d3:MarkerPointsGraph.Marker>
            </d3:MarkerPointsGraph>              
            <d3:MarkerPointsGraph x:Name="InsiderTransactionPointMarkerPointsAcquiredSmall" DataSource="{Binding InsiderTransactionPointAcquiredSmall}">
              <d3:MarkerPointsGraph.Marker>
                <d3:TrianglePointMarker Fill="Green" Orientation="up" Size="9">
                  <d3:TrianglePointMarker.Pen>                                                     
                    <Pen Brush="Black" Thickness="1"/>
                  </d3:TrianglePointMarker.Pen>
                </d3:TrianglePointMarker>
              </d3:MarkerPointsGraph.Marker>
            </d3:MarkerPointsGraph>     
            <d3:MarkerPointsGraph x:Name="InsiderTransactionPointMarkerPointsAcquiredMedium" DataSource="{Binding InsiderTransactionPointAcquiredMedium}">
              <d3:MarkerPointsGraph.Marker>
                <d3:TrianglePointMarker Fill="Green" Orientation="up" Size="13">
                  <d3:TrianglePointMarker.Pen>                                                     
                    <Pen Brush="Black" Thickness="1"/>
                  </d3:TrianglePointMarker.Pen>
                </d3:TrianglePointMarker>
              </d3:MarkerPointsGraph.Marker>
            </d3:MarkerPointsGraph>
            <d3:MarkerPointsGraph x:Name="InsiderTransactionPointMarkerPointsAcquiredLarge" DataSource="{Binding InsiderTransactionPointAcquiredLarge}">
              <d3:MarkerPointsGraph.Marker>
                <d3:TrianglePointMarker Fill="Green" Orientation="up" Size="17">
                  <d3:TrianglePointMarker.Pen>                                                     
                    <Pen Brush="Black" Thickness="1"/>
                  </d3:TrianglePointMarker.Pen>
                </d3:TrianglePointMarker>
              </d3:MarkerPointsGraph.Marker>
            </d3:MarkerPointsGraph>              
              
            <d3:Header Content="{Binding Title}" FontFamily="Arial"/>
            <d3:VerticalAxisTitle Content="Price" FontFamily="Arial"/>
            <d3:HorizontalAxisTitle Content="" FontFamily="Arial"/>       
            <d3:MarkersPointsGraph x:Name="TradeMarkersPointsGraph" DataSource="{Binding TradePoints}" Markers="{Binding Markers}"/>
            <d3:MarkersPointsGraph x:Name="ZeroPointMarkersPointsGraph" DataSource="{Binding ZeroPoint}" Markers="{Binding ZeroPointMarkers}"/>
            <d3:MarkersPointsGraph x:Name="StopLimitMarkersPointsGraph" DataSource="{Binding StopLimit}" Markers="{Binding StopLimitMarkers}"/>
            <d3:MarkersPointsGraph x:Name="RiskFreeRatePointMarkersPointsGraph" DataSource="{Binding RiskFreeRatePoint}" Markers="{Binding RiskFreeRatePointMarkers}"/>
              
            <d3:MarkersPointsGraph x:Name="InsiderTransactionsPointMarkersPointsGraphDisposedSmall" DataSource="{Binding InsiderTransactionPointDisposedSmall}" Markers="{Binding InsiderTransactionPointMarkersDisposedSmall}"/>
            <d3:MarkersPointsGraph x:Name="InsiderTransactionsPointMarkersPointsGraphDisposedMedium" DataSource="{Binding InsiderTransactionPointDisposedMedium}" Markers="{Binding InsiderTransactionPointMarkersDisposedMedium}"/>
            <d3:MarkersPointsGraph x:Name="InsiderTransactionsPointMarkersPointsGraphDisposedLarge" DataSource="{Binding InsiderTransactionPointDisposedLarge}" Markers="{Binding InsiderTransactionPointMarkersDisposedLarge}"/>
              
            <d3:MarkersPointsGraph x:Name="InsiderTransactionsPointMarkersPointsGraphAcquiredSmall" DataSource="{Binding InsiderTransactionPointAcquiredSmall}" Markers="{Binding InsiderTransactionPointMarkersAcquiredSmall}"/>
            <d3:MarkersPointsGraph x:Name="InsiderTransactionsPointMarkersPointsGraphAcquiredMedium" DataSource="{Binding InsiderTransactionPointAcquiredMedium}" Markers="{Binding InsiderTransactionPointMarkersAcquiredMedium}"/>
            <d3:MarkersPointsGraph x:Name="InsiderTransactionsPointMarkersPointsGraphAcquiredLarge" DataSource="{Binding InsiderTransactionPointAcquiredLarge}" Markers="{Binding InsiderTransactionPointMarkersAcquiredLarge}"/>
              
          </d3:ChartPlotter>
          <d3:ChartPlotter Background="WhiteSmoke" Grid.Row="1" Margin="10,0,20,10" Name="volume" LegendVisibility="Hidden" NewLegendVisible="False" d3:Viewport2D.UsesApproximateContentBoundsComparison="False" BorderThickness="0">
        <d3:ChartPlotter.MainHorizontalAxis>
          <d3:HorizontalDateTimeAxis Name="volumedateAxis" />
        </d3:ChartPlotter.MainHorizontalAxis>
        <d3:ChartPlotter.MainVerticalAxis>
        <d3:VerticalAxis Name="volumecountAxis" MinWidth="40" MaxWidth="40" />
        </d3:ChartPlotter.MainVerticalAxis>
        <d3:LineGraph d3:Viewport2D.UsesApproximateContentBoundsComparison="False" x:Name="Volume" DataSource="{Binding Path=Volume}" Stroke="Black" StrokeThickness="1" />
        <d3:CursorCoordinateGraph Name="volumeCursorGraphX" dc:CoordinateGraphBehavior.XTextMappingProperty="MM/dd/yyyy" dc:CoordinateGraphBehavior.YTextMappingProperty="#,#" LineStrokeThickness="1"/>  
        <!--<d3:AxisCursorGraph></d3:AxisCursorGraph>-->
        <d3:VerticalAxisTitle FontFamily="Arial" Content=""/>
        <d3:HorizontalAxisTitle FontFamily="Arial" Content="" />
      </d3:ChartPlotter>
      </Grid>
    </DockPanel>
  </Grid>
  </wpfx:BusyIndicator>
</UserControl>
