|
|
Ben gerçekten diziyi demiştim, şimdi tekrarı var
İyi akşamlar, iyi çalışmalar Sn Inventor. Garanti'yi bugün iyi aldılar ve Garanti ile bugün piyasayı tuttular. Sizin analizde güzel olmuş emeğinize sağlık. İyi geceler dilerim
Teşekkür ederim Sn Inventor sağolun varolun, çalışmalarınızı zevkle takip ediyorum, yüreğinize sağlık, iyi geceler dilerim
CalculateHLPersantage
PHP Code:
public void CalculateHLPersantage(List<clsBar> BARLAR, int barCountForCalculation)
{
if (barCountForCalculation + 90 > Barlar.Count) return;
this.Barlar = BARLAR;
for (int i = 0; i < barCountForCalculation; i++)
{
Barlar[i].WMAHL.LPersantage = Math.Log(Barlar[i].AgirlikliOrtalama / Barlar[i].WMAHL.WMALow);
double RefOfOpenClose;
if (Barlar[i].KAPANIS >= Barlar[i].WMAHL.WMALow)
RefOfOpenClose = Math.Max(Barlar[i].ACILIS, Barlar[i].KAPANIS);
else
RefOfOpenClose = Math.Min(Barlar[i].ACILIS, Barlar[i].KAPANIS);
Barlar[i].WMAHL.SoFarAWayFromMe = 100.0 * (RefOfOpenClose - Barlar[i].WMAHL.WMALow) / Barlar[i].WMAHL.WMALow;
}
double max;
double min;
max = -1.0;
min = 1.0;
for (int i = 0; i < barCountForCalculation; i++)
{
max = Math.Max(max, Barlar[i].WMAHL.LPersantage);
min = Math.Min(min, Barlar[i].WMAHL.LPersantage);
}
for (int i = 0; i < barCountForCalculation; i++)
{
if (Barlar[i].WMAHL.LPersantage > 0.0)
Barlar[i].WMAHL.LPersantage100 = 50.0 + (50.0 * (Barlar[i].WMAHL.LPersantage) / max);
else
Barlar[i].WMAHL.LPersantage100 = 50.0 - (50.0 * (Barlar[i].WMAHL.LPersantage) / min);
}
clsWMA wma = new clsWMA();
wma.CalculateWMA_OfLPersantage100(Barlar, barCountForCalculation, 5, 3);
}
}
CalculateWMALDeviationAndMean
PHP Code:
public void CalculateWMALDeviationAndMean(clsHisse H, clsEndeks E, int barCountForCalculation)
{
try
{
if (H != null)
this.Barlar = H.GunlukBarlar;
else if (E != null)
this.Barlar = E.GunlukBarlar;
else
return;
if (barCountForCalculation + 90 > this.Barlar.Count) return;
double PositiveSum = 0.0;
double PositiveMax = 0.0;
int PCounter = 0;
double NegativeSum = 0.0;
double NegativeMin = 0.0;
int NCounter = 0;
for (int i = 0; i < barCountForCalculation; i++)
{
double aValue = Barlar[i].WMAHL.SoFarAWayFromMe;
if (aValue >= 0.0)
{
PositiveMax = Math.Max(aValue, PositiveMax);
PositiveSum += aValue;
PCounter++;
}
else
{
NegativeMin = Math.Min(aValue, NegativeMin);
NegativeSum += aValue;
NCounter++;
}
}
if (H != null)
{
H.WMALMaxPositiveDeviation = PositiveMax;
H.WMALMaxNegativeDeviation = NegativeMin;
H.WMALPositiveMean = PositiveSum / PCounter;
H.WMALNegativeMean = NegativeSum / NCounter;
}
else if (E != null)
{
E.WMALMaxPositiveDeviation = PositiveMax;
E.WMALMaxNegativeDeviation = NegativeMin;
E.WMALPositiveMean = PositiveSum / PCounter;
E.WMALNegativeMean = NegativeSum / NCounter;
}
else
return;
}
catch { return; }
}
PHP Code:
protected SolidColorBrush _lpersantageRENK = new SolidColorBrush();
private string _lpersantage;
public SolidColorBrush LPERSANTAGERENK
{
get { return _lpersantageRENK; }
set
{
_lpersantageRENK = value;
OnPropertyChanged("LPERSANTAGERENK");
}
}
public string LPERSANTAGE
{
get
{ return _lpersantage; }
private set
{
_lpersantage = value;
OnPropertyChanged("LPERSANTAGE");
}
}
public clsGostergeListesindekiHisse(clsHisse Hisse)
{
this.HisseSeneti = Hisse;
...
LPERSANTAGE = LPersentageDegerininGunSayisiniBul();
...
}
private string LPersentageDegerininGunSayisiniBul()
{
int gunSayisi;
string retStr = string.Empty;
try
{
double x = HisseSeneti.GunlukBarlar[0].WMAHL.LPersantage100;
if (HisseSeneti.GunlukBarlar[0].WMAHL.LPersantage100 >= HisseSeneti.GunlukBarlar[1].WMAHL.LPersantage100)
{
LPERSANTAGERENK = new SolidColorBrush(Color.FromRgb(0, 255, 0));
gunSayisi = 1;
try
{
while (HisseSeneti.GunlukBarlar[gunSayisi].WMAHL.LPersantage100 >= HisseSeneti.GunlukBarlar[gunSayisi + 1].WMAHL.LPersantage100)
gunSayisi++;
}
catch { }
retStr = "▲ " + gunSayisi.ToString("000") + " Gün ";
}
else
{
LPERSANTAGERENK = new SolidColorBrush(Color.FromRgb(255, 0, 0));
gunSayisi = 1;
try
{
while (HisseSeneti.GunlukBarlar[gunSayisi].WMAHL.LPersantage100 < HisseSeneti.GunlukBarlar[gunSayisi + 1].WMAHL.LPersantage100)
gunSayisi++;
}
catch { }
retStr = "▼ " + gunSayisi.ToString("000") + " Gün ";
}
return retStr;
}
catch
{
return retStr;
}
}
PHP Code:
<DataGrid AutoGenerateColumns="False"
FrozenColumnCount="3"
CanUserReorderColumns="False"
Name="dataGridGOSTERGELER"
ItemsSource="{Binding}"
AreRowDetailsFrozen="True"
Width="Auto"
Height="630"
FontSize="11"
FontWeight="Normal"
GridLinesVisibility="None"
IsReadOnly="True"
SelectionUnit="FullRow"
SelectionMode="Single"
RowHeaderWidth="0"
HeadersVisibility="Column"
MinColumnWidth="0"
MouseDoubleClick="dataGridGOSTERGELER_MouseDoubleClick"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Recycling"
>
<DataGrid.GroupStyle>
<GroupStyle ContainerStyle="{StaticResource GroupHeaderStyle}">
<GroupStyle.Panel>
<ItemsPanelTemplate>
<DataGridRowsPresenter Margin="0">
</DataGridRowsPresenter>
</ItemsPanelTemplate>
</GroupStyle.Panel>
</GroupStyle>
</DataGrid.GroupStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding HisseKOD}" Header="Hisse" FontWeight="Bold" >
<!--<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Background" Value="Tomato" />
<Setter Property="Foreground" Value="Black" />
</Style>
</DataGridTextColumn.ElementStyle>-->
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding HisseSON_DEGER}" Header="Kapanış" FontWeight="Bold" >
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextAlignment" Value="Right" />
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding HisseGUNLUK_DEGISIM_DATAGRID}" Header="Günlük" >
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Foreground" Value="{Binding HisseRENK}"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding HisseHACIM000}" Header="Hacim" >
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="Background" Value="{Binding HisseHACIM100RENK}"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding HisseHACIM100}" Header="100gün Hacim Ort." >
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding LNUPDOWN}" Header="LnWMAHL">
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="Background" Value="{Binding LNUPDOWNRENK}" />
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding LNLEVEL}" Header="LnLeveL">
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="Background" Value="{Binding LNUPDOWNRENK}" />
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding SOFARAWAYFROMME}" Header="SoFar">
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextAlignment" Value="Center" />
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding LPERSANTAGE}" Header="LPer">
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="Background" Value="{Binding LPERSANTAGERENK}" />
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Binding="{Binding WMEAN}" Header="WMean">
<DataGridTextColumn.ElementStyle>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="Background" Value="{Binding WMEANRENK}" />
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>