bu sisteme sadece bmk lisansıyla kullana bilirsin
Printable View
bu sisteme sadece bmk lisansıyla kullana bilirsin
Merhabalar,
Hazırladığım sistemi hafta sonu denemek istiyorum. Bunun için yazdığım emir gönderme kodları çalışmıyor. Sistemi robota/idelgoya bağladığımda yada emir penceresi ile manuel emir gönderdiğimde gidiyor. Ancak kod içinde yazdığımda gönderemiyorum. Acaba nedendir?
Kodun if--else gibi bir bölümü yok. Dolayısı ile emir gönderim bölümüne hatasız geliyor. Hesaba da login çünkü hesaptan kod ile istediğim bilgileri çekiyorum. Aktif viop kontratı için veya herhangi bir sembol için olsa da olur, kod ile emri gönderip portföy de görmek istiyorum.
Aşağıdaki kodlarda bir hata varmı?
Ayrıca Emirİslem, EmirSüresi,EmirTipi,EmirFiyatTipi değişkenleri hangi değerleri alabilirler? Aşağıdaki değerlerden başka değişken alabilirler mi?
Örneğin Emirİslem e "SATIS" veya "Satış" yazmak arasında doğru olanı hangisi?
EmirHesapAdi,EmirAltHesap bilgilerinide girmek gerekiyor mu?
PHP Code:
var Miktar = 1;
Sistem.PozisyonKontrolGuncelle(Sembol, Pozisyon+Miktar);
Sistem.EmirSembol = Sembol;
Sistem.EmirIslem = "Alış";
Sistem.EmirMiktari = Miktar;
Sistem.EmirSuresi = "GUN"; // GUN, SNS, IKG
Sistem.EmirTipi = "KPY"; // KPY, KIE, GIE, SAR
Sistem.EmirFiyatTipi = "PYS"; // PYS, LMT, EIF, KAP
Sistem.EmirGonder();
test olarak gitmesine gerek yok. Haftasonu canlı veri olmasa da sistem çalışıp örneğin gerçek pozisyonu eşitlemek için emir gönderemez mi? Sistemin şuanda veri ihtiyacı yok, sadece bir kez çalışıp emir gönderecek.
viop ve hisse için aşağıdaki emir gönderme kalıplarını kullanabilirsiniz
vadeli için alış
hisse için satış kısımlarını örneği kullanıp yazabilirsiniz.
PHP Code:
///vadeli piyasa satış yap
Rezerv = "SATIŞ işlem";
Sistem.EmirIslem = "SATIS";
Sistem.EmirSembol = sembolV;
Sistem.EmirFiyati = VAFiyat ;
Sistem.EmirMiktari = Lot ;
Sistem.EmirSuresi = "GUN"; // GUN, SNS, IKG
Sistem.EmirTipi = "KPY"; // KPY, KIE, GIE, SAR
Sistem.EmirFiyatTipi = "LMT"; // PYS, LMT, EIF, KAP
Sistem.EmirGonder();
///spot piyasa alım yap
Rezerv = "ALIŞ işlem";
Sistem.EmirSembol = sembolS;
Sistem.EmirIslem = "ALIS";
Sistem.EmirMiktari = Lot;
Sistem.EmirFiyati = SSFiyat; // aktif fiyat
Sistem.EmirSuresi = "GUN"; // GUN
Sistem.EmirTipi = "Limit"; //(“Limitâ€, “Piyasadan Limiteâ€, “Piyasaâ€)
Sistem.EmirGonder();
Wilders MA fonksiyonu belki birine lazım olur:
Sistem İçerisinden Close verisi için aşağıdaki şekilde çağırabilirsiniz.PHP Code:
public float[] Wilders(float[] gelenliste, int periyot)
{
int veriSayisi = gelenliste.Length;
float[] sonuc = new float[veriSayisi];
float[] ma = new float[veriSayisi];
decimal[] toplamlar = new decimal[veriSayisi];
for (int i = 1; i < veriSayisi; i++)
{
toplamlar[i] = toplamlar[i - 1] + (decimal)gelenliste[i];
if (i - periyot >= 0)
ma[i] = (float)Math.Round((toplamlar[i] - toplamlar[i - periyot]) / periyot, 4);
if (i < periyot)
sonuc[i] = 0;
else if (i == periyot)
sonuc[i] = ma[i];
else if (i > periyot)
sonuc[i] = (float)Math.Round(((sonuc[i - 1] * (periyot - 1)) + gelenliste[i]) / periyot, 3);
}
return sonuc;
}
sadece periyot değişkenine istediğiniz rakamı giriniz.
Hesaplatılacak veri Close değilse onu da float array e çevirip atamanız lazım.
PHP Code:
int periyot=10;
var Veriler = Sistem.GrafikVerileriniOku(Sistem.Sembol, Sistem.Periyot);
var C = Sistem.GrafikFiyatOku(Veriler, "Kapanis");
float[] userWilderMA=Wilders(C.ToArray(), Convert.ToInt32(periyot));
var WilderMA=userWilderMA.ToList();
Sistem.Cizgiler[0].Deger=WilderMA;
sanal da çalıştırırsan emir göndermez ama pozisyon günceller , kodun başka tarafında engel yoksa
emir göndersin ben bekleyen emirlerde görüyüm dersen "canlı" çalıştıracaksın (sonra manuel iptal edeceksin sanırım)
ama son yazdığından tüm sorunun "haftasonu çalışsın" checkbox ına tık atmaktan ibaret olduğu izlenimi uyandı bende :)