Esempio n. 1
0
 public frmVWMACDV2(Listeler listeler, int capacity = 610)
 {
     signalList = new RollingPointPairList(capacity);
     histList   = new RollingPointPairList(capacity);
     vwmacdList = new RollingPointPairList(capacity);
     InitializeComponent();
 }
Esempio n. 2
0
 private void kayilardaYoksaEkleVarsaGuncelle(string sembol, Listeler listeler)
 {
     lock (lockerKayitlar)
     {
         if (!kayitlar.ContainsKey(sembol))
         {
             kayitlar.Add(sembol, listeler);
         }
         kayitlar[sembol] = listeler;
     }
 }
Esempio n. 3
0
        private static void VWMACDV2Hesapla(Listeler listeler)
        {
            var closes         = listeler.Closes4Saatlik;
            var volumes        = listeler.Volumes4Saatlik;
            var volumesXcloses = closes.Zip(volumes, (x, y) => x * y).ToList();
            var fastEma        = volumesXcloses.Ema(fastperiod).Zip(volumes.Ema(fastperiod), (x, y) => x / y).ToList();
            var slowEma        = volumesXcloses.Ema(slowperiod).Zip(volumes.Ema(slowperiod), (x, y) => x / y).ToList();

            listeler.Vwmacd4Saatlik = fastEma.Zip(slowEma, (x, y) => x - y).ToList();
            listeler.Signal4Saatlik = listeler.Vwmacd4Saatlik.Ema(signalperiod).ToList();
            listeler.Hist4Saatlik   = listeler.Vwmacd4Saatlik.Zip(listeler.Signal4Saatlik, (x, y) => x - y).ToList();
            closes                  = listeler.Closes1Saatlik.Where(x => x > 0).ToList();
            volumes                 = listeler.Volumes1Saatlik.Where(x => x > 0).ToList();
            volumesXcloses          = closes.Zip(volumes, (x, y) => x * y).ToList();
            fastEma                 = volumesXcloses.Ema(fastperiod).Zip(volumes.Ema(fastperiod), (x, y) => x / y).ToList();
            slowEma                 = volumesXcloses.Ema(slowperiod).Zip(volumes.Ema(slowperiod), (x, y) => x / y).ToList();
            listeler.Vwmacd1Saatlik = fastEma.Zip(slowEma, (x, y) => x - y).ToList();
            listeler.Signal1Saatlik = listeler.Vwmacd1Saatlik.Ema(signalperiod).ToList();
            listeler.Hist1Saatlik   = listeler.Vwmacd1Saatlik.Zip(listeler.Signal4Saatlik, (x, y) => x - y).ToList();
        }
Esempio n. 4
0
        /*
         *     //@version=3
         *     //created by Buff DORMEIER
         *     //author: KIVANC @fr3762 on twitter
         *     study("VOLUME WEIGHTED MACD V2", shorttitle="VWMACDV2")
         *     fastperiod = input(12,title="fastperiod",type=integer,minval=1,maxval=500)
         *     slowperiod = input(26,title="slowperiod",type=integer,minval=1,maxval=500)
         *     signalperiod = input(9,title="signalperiod",type=integer,minval=1,maxval=500)
         *     fastMA = ema(volume*close, fastperiod)/ema(volume, fastperiod)
         *     slowMA = ema(volume*close, slowperiod)/ema(volume, slowperiod)
         *     vwmacd = fastMA - slowMA
         *     signal = ema(vwmacd, signalperiod)
         *     //hist= vwmacd - signal
         *     plot(vwmacd, color=blue, linewidth=2)
         *     plot(signal, color=red, linewidth=2)
         *     //plot(hist, color=green, linewidth=4, style=histogram)
         *     plot(0, color=black)
         */
        private void _analizEt(string sembol)
        {
            try
            {
                var             client = new CryptoCompareClient();
                HistoryResponse historyHour;
                try
                {
                    var task = client.History.HourAsync(sembol, "BTC", _limit - 1, "Binance");
                    task.Wait();
                    historyHour = task.Result;
                }
                catch (Exception ex)
                {
                    listBox_Hatalar.Yazdir(sembol + "Coini Binance da Mevcut Değil: " + _ictenDisaHatalariAl(ex));
                    return;
                }
                var data    = historyHour.Data;
                var candles = data.Where(x => x.Close > 0).ToList();
                if (!candles.Any())
                {
                    listBox_Hatalar.Yazdir("Hiç Mum Yok, Coin: " + sembol);
                    return;
                }
                var listeler            = new Listeler();
                var liste4SaatlikCloses = new List <decimal>();
                var liste4SaatlikHacim  = new List <decimal>();
                var liste1SaatlikHacim  = new List <decimal>();
                var liste1SaatlikCloses = new List <decimal>();
                liste1SaatlikHacim.AddRange(candles.Select(x => x.VolumeTo));
                liste1SaatlikCloses.AddRange(candles.Select(x => x.Close));
                listeler.Closes1Saatlik  = liste1SaatlikCloses;
                listeler.Volumes1Saatlik = liste1SaatlikHacim;

                var kalan = candles.Count % 4;
                candles = candles.Skip(kalan).ToList();
                var son4Indeks = candles.Count / 4;
                for (var i = 0; i < son4Indeks; i++)
                {
                    var mumlar     = candles.Skip(i * 4).Take(4);
                    var candleData = new CandleData();
                    foreach (var mum in mumlar)
                    {
                        candleData.VolumeTo += mum.VolumeTo;
                    }
                    candleData.Close = mumlar.Last().Close;
                    liste4SaatlikCloses.Add(candleData.Close);
                    liste4SaatlikHacim.Add(candleData.VolumeTo);
                }
                listeler.Volumes4Saatlik = liste4SaatlikHacim;
                listeler.Closes4Saatlik  = liste4SaatlikCloses;
                int closesCount = listeler.Closes4Saatlik.Count;
                VWMACDV2Hesapla(listeler);
                listeler.Wma = new List <decimal>(listeler.Closes4Saatlik)
                               .WeighteedMovingAverage(3)
                               .WeighteedMovingAverage(5)
                               .WeighteedMovingAverage(8)
                               .WeighteedMovingAverage(13)
                               .WeighteedMovingAverage(21)
                               .WeighteedMovingAverage(34);

                kayilardaYoksaEkleVarsaGuncelle(sembol, listeler);
                listBoxlariDoldur(sembol);
            }
            catch (Exception ex)
            {
                string hata = _ictenDisaHatalariAl(ex);
                listBox_Hatalar.Yazdir(hata);
            }
        }