Sviluppo TradingBot
This commit is contained in:
@@ -0,0 +1,245 @@
|
||||
<UserControl x:Class="DesktopBot.Views.BotConfigView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:models="clr-namespace:DesktopBot.Models"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="/DesktopBot;component/Themes/DarkTheme.xaml"/>
|
||||
</UserControl.Resources>
|
||||
|
||||
<ScrollViewer Background="{StaticResource BackgroundDarkBrush}"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<Grid Margin="32">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Titolo -->
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="Configurazione Bot"
|
||||
Style="{StaticResource SectionTitle}"/>
|
||||
|
||||
<!-- Banner di avviso: Bot bloccato -->
|
||||
<Border Grid.Row="0"
|
||||
Margin="0,60,0,16"
|
||||
Background="#FFD700"
|
||||
BorderBrush="#FFA500"
|
||||
BorderThickness="2"
|
||||
CornerRadius="6"
|
||||
Padding="16,12"
|
||||
Visibility="{Binding IsAssetLocked, Converter={StaticResource BoolVisibilityConverter}}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="🔒"
|
||||
FontSize="24"
|
||||
Margin="0,0,12,0"
|
||||
VerticalAlignment="Center"/>
|
||||
|
||||
<StackPanel Grid.Column="1">
|
||||
<TextBlock Text="BOT BLOCCATO"
|
||||
FontSize="14"
|
||||
FontWeight="Bold"
|
||||
Foreground="#000000"/>
|
||||
<TextBlock TextWrapping="Wrap"
|
||||
Foreground="#333333"
|
||||
FontSize="12"
|
||||
Margin="0,4,0,0">
|
||||
Questo bot è associato in modo permanente a
|
||||
<Bold><Run Text="{Binding Symbol, Mode=OneWay}"/></Bold>
|
||||
con strategia
|
||||
<Bold><Run Text="{Binding Config.Strategy, Mode=OneWay}"/></Bold>.
|
||||
Asset e strategia non possono essere modificati.
|
||||
<LineBreak/>
|
||||
<Run FontStyle="Italic">Bloccato il: </Run>
|
||||
<Run Text="{Binding LockedAtLabel, Mode=OneWay}" FontStyle="Italic"/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- Sezione Simbolo e Quantità -->
|
||||
<Border Grid.Row="1" Style="{StaticResource Card}" Margin="0,0,0,16">
|
||||
<StackPanel>
|
||||
<TextBlock Text="ASSET E POSIZIONE"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,0,0,16"/>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="16"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Simbolo -->
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Text="Simbolo Ticker"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,0,0,6"/>
|
||||
<TextBox Style="{StaticResource DarkTextBox}"
|
||||
Text="{Binding Config.Symbol, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsAssetLocked, Converter={StaticResource InverseBoolConverter}}"/>
|
||||
<TextBlock Text="⚠ Campo bloccato: il bot è associato a questo asset"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Foreground="#FFC107"
|
||||
FontSize="11"
|
||||
Margin="0,4,0,0"
|
||||
Visibility="{Binding IsAssetLocked, Converter={StaticResource BoolVisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Quantità -->
|
||||
<StackPanel Grid.Column="2">
|
||||
<TextBlock Text="Quantità (Azioni)"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,0,0,6"/>
|
||||
<TextBox Style="{StaticResource DarkTextBox}"
|
||||
Text="{Binding Config.Quantity, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Sezione Strategia -->
|
||||
<Border Grid.Row="2" Style="{StaticResource Card}" Margin="0,0,0,16">
|
||||
<StackPanel>
|
||||
<TextBlock Text="STRATEGIA DI TRADING"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,0,0,16"/>
|
||||
|
||||
<!-- Selezione Strategia -->
|
||||
<StackPanel Margin="0,0,0,16">
|
||||
<TextBlock Text="Tipo di Strategia"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,0,0,6"/>
|
||||
<ComboBox Style="{StaticResource DarkComboBox}"
|
||||
SelectedItem="{Binding Config.Strategy}"
|
||||
IsEnabled="{Binding IsConfigLocked, Converter={StaticResource InverseBoolConverter}}">
|
||||
<ComboBoxItem Content="EMA_CROSSOVER"/>
|
||||
<ComboBoxItem Content="RSI"/>
|
||||
<ComboBoxItem Content="MACD"/>
|
||||
</ComboBox>
|
||||
<TextBlock Text="⚠ Strategia bloccata: ottimizzata per questo asset"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Foreground="#FFC107"
|
||||
FontSize="11"
|
||||
Margin="0,4,0,0"
|
||||
Visibility="{Binding IsConfigLocked, Converter={StaticResource BoolVisibilityConverter}}"/>
|
||||
</StackPanel>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="16"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- EMA Veloce -->
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Text="EMA Veloce (periodo)"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,0,0,6"/>
|
||||
<TextBox Style="{StaticResource DarkTextBox}"
|
||||
Text="{Binding Config.FastEmaPeriod}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- EMA Lenta -->
|
||||
<StackPanel Grid.Column="2">
|
||||
<TextBlock Text="EMA Lenta (periodo)"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,0,0,6"/>
|
||||
<TextBox Style="{StaticResource DarkTextBox}"
|
||||
Text="{Binding Config.SlowEmaPeriod}"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Sezione Gestione Rischio -->
|
||||
<Border Grid.Row="3" Style="{StaticResource Card}" Margin="0,0,0,16">
|
||||
<StackPanel>
|
||||
<TextBlock Text="GESTIONE DEL RISCHIO"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,0,0,16"/>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="16"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="16"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Stop Loss -->
|
||||
<StackPanel Grid.Column="0">
|
||||
<TextBlock Text="Stop Loss %"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,0,0,6"/>
|
||||
<TextBox Style="{StaticResource DarkTextBox}"
|
||||
Text="{Binding Config.StopLossPercentage, StringFormat={}{0:P0}}"/>
|
||||
<TextBlock Text="Es: 0.02 = 2%"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,4,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Take Profit -->
|
||||
<StackPanel Grid.Column="2">
|
||||
<TextBlock Text="Take Profit %"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,0,0,6"/>
|
||||
<TextBox Style="{StaticResource DarkTextBox}"
|
||||
Text="{Binding Config.TakeProfitPercentage, StringFormat={}{0:P0}}"/>
|
||||
<TextBlock Text="Es: 0.05 = 5%"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,4,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Intervallo Check -->
|
||||
<StackPanel Grid.Column="4">
|
||||
<TextBlock Text="Intervallo (sec)"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,0,0,6"/>
|
||||
<TextBox Style="{StaticResource DarkTextBox}"
|
||||
Text="{Binding Config.CheckIntervalSeconds}"/>
|
||||
<TextBlock Text="Ogni quanti secondi analizzare"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
Margin="0,4,0,0"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Pulsanti Start / Stop -->
|
||||
<StackPanel Orientation="Horizontal" Margin="0,24,0,0" HorizontalAlignment="Right">
|
||||
<Button Content="▶ AVVIA BOT"
|
||||
Style="{StaticResource PrimaryButton}"
|
||||
Command="{Binding StartBotCommand}"
|
||||
Margin="0,0,12,0"
|
||||
Padding="24,12"/>
|
||||
|
||||
<Button Content="■ FERMA BOT"
|
||||
Style="{StaticResource DangerButton}"
|
||||
Command="{Binding StopBotCommand}"
|
||||
Padding="24,12"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Messaggio di Stato -->
|
||||
<TextBlock Text="{Binding StatusMessage}"
|
||||
Style="{StaticResource LabelSecondary}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,12,0,0"
|
||||
FontStyle="Italic"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
Reference in New Issue
Block a user