Nasıl kodlanır? - sayfa 144 1...137138139140141142143144145146147148149150151...347 Yeni yorum Michel 2008.11.12 16:40 #1431 bu yanlış : if(totalOrders==0 && Magic==OrderMagicNumber() && OrderSelect(i-1 , SELECT_BY_POS,MODE_HISTORY)==true) çünkü OrderMagicNumber()'ı OrderSelect()'ten önce çağırıyorsunuz, bu yüzden muhtemelen önceki çağrıya atıfta bulunuyor. Roger09 2008.11.12 17:54 #1432 EBK: Ah, üzgünüm, fikrimi yanlış ifade ettim. Öz sermaye bir değerin altındaysa EA ticaretini (veya ea ticaretinin bir kısmını) durduracak bir şey kodlamak istiyorum (ama yapamıyorum). Yardımın için teşekkürler Roger09, ama hisse senedini grafikte göstermeme gerek yok. Bu EA'yı deneyin CloseAllBuySell - MQL4 Kod Tabanı Fikrini kullanın ve bir şeyle bir kod yapın if (AccountEquity()<YourValue) closeallorders(); Beno 2008.11.15 15:25 #1433 Birisi lütfen EMA son durağını Hareketli Ortalama EA örneğine ekleyebilir mi? EMA sonu 1 olarak ayarlandı Ardından girişi şu şekilde değiştirin: Buy=Aç[1]>ma && Kapat[1]>ma; Sat=Aç[1]<ma && Kapat[1]<ma; Bu, çok iyi bir basit saç kazıyıcı yapmalıdır. Şerefe Beno Dosyalar: ematrailingstop_v1.mq4 5 kb Sormak! Kodlama yardımı SimpleDailyRangeBreakExpert [Deleted] 2008.11.16 00:58 #1434 Roger09 2008.11.16 18:29 #1435 Programın başına ekle extern int pip=2;//(veya pip sayınız) sonra değiştir if ((OrderType() == OP_BUY) && (OrderStopLoss() < OrderOpenPrice())) sl = OrderOpenPrice() ; if ((OrderType() == OP_SELL) && (OrderStopLoss() > OrderOpenPrice())) sl = OrderOpenPrice() ;[/CODE] to [CODE]if ((OrderType() == OP_BUY) && (OrderStopLoss() < OrderOpenPrice())) sl = OrderOpenPrice() +pips*Point; if ((OrderType() == OP_SELL) && (OrderStopLoss() > OrderOpenPrice())) sl = OrderOpenPrice() -pips*Point; How to code? Kodlama yardımı Coding help [Silindi] 2008.11.17 18:28 #1436 Birisi bu göstergeye yeni bir ok çizdiğinde bir uyarı koymama yardım edebilir mi? Teşekkürler! Dosyalar: hilow3.mq4 2 kb Roger09 2008.11.18 00:44 #1437 Hayır, düzelt harici int pip=2; //+------------------------------------------- -------------------+ //| komut dosyası programı başlatma işlevi | //+------------------------------------------- -------------------+ int başlangıç() { //---- string curr = Sembol(); int ot = OrdersTotal(); int ords[200], ordType[200], ordTicket[200]; çift ordLots[200]; string ordComments[200]; int ix=0; için (int i=0; i<ot; i++) { int o = OrderSelect(i, SELECT_BY_POS); if (OrderSymbol() == Symbol()) if ((OrderType() == OP_BUY) || (OrderType() == OP_SEL)) { çift sl = 0; if ((OrderType() == OP_BUY) && (OrderStopLoss() < OrderOpenPrice())) sl = OrderOpenPrice() +pip*Nokta; if ((OrderType() == OP_SELL) && (OrderStopLoss() > OrderOpenPrice())) sl = OrderOpenPrice() -pip*Nokta; eğer (sl != 0+10) OrderModify(OrderTicket(), OrderOpenPrice(), sl, OrderTakeProfit(), 0); } } //---- dönüş(0); How to code? Kodlama yardımı Coding help [Deleted] 2008.11.18 02:36 #1438 Tamam, kod şimdi şöyle görünüyor: harici int pip=10;// //+------------------------------------------- -------------------+ //| komut dosyası programı başlatma işlevi | //+------------------------------------------- -------------------+ int başlangıç() { //---- string curr = Sembol(); int ot = OrdersTotal(); int ords[200], ordType[200], ordTicket[200]; çift ordLots[200]; string ordComments[200]; int ix=0; için (int i=0; i<ot; i++) { int o = OrderSelect(i, SELECT_BY_POS); if (OrderSymbol() == Symbol()) if ((OrderType() == OP_BUY) || (OrderType() == OP_SEL)) { çift sl = 0; if ((OrderType() == OP_BUY) && (OrderStopLoss() < OrderOpenPrice())) sl = OrderOpenPrice() +pip*Nokta; if ((OrderType() == OP_SELL) && (OrderStopLoss() > OrderOpenPrice())) sl = OrderOpenPrice() -pip*Nokta; eğer (sl != 0) OrderModify(OrderTicket(), OrderOpenPrice(), sl, OrderTakeProfit(), 0); } } //---- dönüş(0); } //+------------------------------------------- -------------------+ How to code? Kodlama yardımı Coding help [Deleted] 2008.11.18 02:37 #1439 Merhaba Roger09, Bu kodla ilgili yardımlarınız için çok teşekkürler. Komut dosyası kodum şimdi şöyle görünüyor (sadece bu yanıt için kırmızıdaki değişiklikleri ekledim, MQ4'teki kod, oradaki diğerlerine benziyor): //+------------------------------------------- -------------------+ //| komut dosyası programı başlatma işlevi | //+------------------------------------------- -------------------+ int başlangıç() { //---- harici int pip=2;// string curr = Sembol(); int ot = OrdersTotal(); int ords[200], ordType[200], ordTicket[200]; çift ordLots[200]; string ordComments[200]; int ix=0; için (int i=0; i<ot; i++) { int o = OrderSelect(i, SELECT_BY_POS); if (OrderSymbol() == Symbol()) if ((OrderType() == OP_BUY) || (OrderType() == OP_SEL)) { çift sl = 0; if ((OrderType() == OP_BUY) && (OrderStopLoss() < OrderOpenPrice())) sl = OrderOpenPrice() +pip*Nokta; if ((OrderType() == OP_SELL) && (OrderStopLoss() > OrderOpenPrice())) sl = OrderOpenPrice() -pip*Nokta; eğer (sl != 0) OrderModify(OrderTicket(), OrderOpenPrice(), sl, OrderTakeProfit(), 0); } } //---- dönüş(0); Doğru anladıysam haber verir misin? Burada kör uçuyorum, o yüzden sabret. How to code? Kodlama yardımı [UYARI, KONU KAPALI!] Forumu Roger09 2008.11.18 05:31 #1440 Aslında çalışacak, ancak bu kod iyi değil. Ne yazık ki ana hedeflerinizi bilmiyorum ve başka bir şey öneremem. 1...137138139140141142143144145146147148149150151...347 Yeni yorum
bu yanlış : if(totalOrders==0 && Magic==OrderMagicNumber() &&
OrderSelect(i-1 , SELECT_BY_POS,MODE_HISTORY)==true)
çünkü OrderMagicNumber()'ı OrderSelect()'ten önce çağırıyorsunuz, bu yüzden muhtemelen önceki çağrıya atıfta bulunuyor.
Ah, üzgünüm, fikrimi yanlış ifade ettim.
Öz sermaye bir değerin altındaysa EA ticaretini (veya ea ticaretinin bir kısmını) durduracak bir şey kodlamak istiyorum (ama yapamıyorum).
Yardımın için teşekkürler Roger09, ama hisse senedini grafikte göstermeme gerek yok.Bu EA'yı deneyin
CloseAllBuySell - MQL4 Kod Tabanı
Fikrini kullanın ve bir şeyle bir kod yapın
if (AccountEquity()<YourValue) closeallorders();
Birisi lütfen EMA son durağını Hareketli Ortalama EA örneğine ekleyebilir mi?
EMA sonu 1 olarak ayarlandı
Ardından girişi şu şekilde değiştirin:
Buy=Aç[1]>ma && Kapat[1]>ma;
Sat=Aç[1]<ma && Kapat[1]<ma;
Bu, çok iyi bir basit saç kazıyıcı yapmalıdır.
Şerefe
Beno
Programın başına ekle
extern int pip=2;//(veya pip sayınız)
sonra değiştir
sl = OrderOpenPrice() ;
if ((OrderType() == OP_SELL) && (OrderStopLoss() > OrderOpenPrice()))
sl = OrderOpenPrice() ;[/CODE]
to
[CODE]if ((OrderType() == OP_BUY) && (OrderStopLoss() < OrderOpenPrice()))
sl = OrderOpenPrice() +pips*Point;
if ((OrderType() == OP_SELL) && (OrderStopLoss() > OrderOpenPrice()))
sl = OrderOpenPrice() -pips*Point;Birisi bu göstergeye yeni bir ok çizdiğinde bir uyarı koymama yardım edebilir mi?
Teşekkürler!
Hayır, düzelt
harici int pip=2;
//+------------------------------------------- -------------------+
//| komut dosyası programı başlatma işlevi |
//+------------------------------------------- -------------------+
int başlangıç()
{
//----
string curr = Sembol();
int ot = OrdersTotal();
int ords[200], ordType[200], ordTicket[200]; çift ordLots[200];
string ordComments[200];
int ix=0;
için (int i=0; i<ot; i++)
{
int o = OrderSelect(i, SELECT_BY_POS);
if (OrderSymbol() == Symbol())
if ((OrderType() == OP_BUY) || (OrderType() == OP_SEL))
{
çift sl = 0;
if ((OrderType() == OP_BUY) && (OrderStopLoss() < OrderOpenPrice()))
sl = OrderOpenPrice() +pip*Nokta;
if ((OrderType() == OP_SELL) && (OrderStopLoss() > OrderOpenPrice()))
sl = OrderOpenPrice() -pip*Nokta;
eğer (sl != 0+10)
OrderModify(OrderTicket(), OrderOpenPrice(), sl, OrderTakeProfit(), 0);
}
}
//----
dönüş(0);
Tamam, kod şimdi şöyle görünüyor:
harici int pip=10;//
//+------------------------------------------- -------------------+
//| komut dosyası programı başlatma işlevi |
//+------------------------------------------- -------------------+
int başlangıç()
{
//----
string curr = Sembol();
int ot = OrdersTotal();
int ords[200], ordType[200], ordTicket[200]; çift ordLots[200];
string ordComments[200];
int ix=0;
için (int i=0; i<ot; i++)
{
int o = OrderSelect(i, SELECT_BY_POS);
if (OrderSymbol() == Symbol())
if ((OrderType() == OP_BUY) || (OrderType() == OP_SEL))
{
çift sl = 0;
if ((OrderType() == OP_BUY) && (OrderStopLoss() < OrderOpenPrice()))
sl = OrderOpenPrice() +pip*Nokta;
if ((OrderType() == OP_SELL) && (OrderStopLoss() > OrderOpenPrice()))
sl = OrderOpenPrice() -pip*Nokta;
eğer (sl != 0)
OrderModify(OrderTicket(), OrderOpenPrice(), sl, OrderTakeProfit(), 0);
}
}
//----
dönüş(0);
}
//+------------------------------------------- -------------------+
Merhaba Roger09,
Bu kodla ilgili yardımlarınız için çok teşekkürler. Komut dosyası kodum şimdi şöyle görünüyor (sadece bu yanıt için kırmızıdaki değişiklikleri ekledim, MQ4'teki kod, oradaki diğerlerine benziyor):
//+------------------------------------------- -------------------+
//| komut dosyası programı başlatma işlevi |
//+------------------------------------------- -------------------+
int başlangıç()
{
//----
harici int pip=2;//
string curr = Sembol();
int ot = OrdersTotal();
int ords[200], ordType[200], ordTicket[200]; çift ordLots[200];
string ordComments[200];
int ix=0;
için (int i=0; i<ot; i++)
{
int o = OrderSelect(i, SELECT_BY_POS);
if (OrderSymbol() == Symbol())
if ((OrderType() == OP_BUY) || (OrderType() == OP_SEL))
{
çift sl = 0;
if ((OrderType() == OP_BUY) && (OrderStopLoss() < OrderOpenPrice()))
sl = OrderOpenPrice() +pip*Nokta;
if ((OrderType() == OP_SELL) && (OrderStopLoss() > OrderOpenPrice()))
sl = OrderOpenPrice() -pip*Nokta;
eğer (sl != 0)
OrderModify(OrderTicket(), OrderOpenPrice(), sl, OrderTakeProfit(), 0);
}
}
//----
dönüş(0);
Doğru anladıysam haber verir misin? Burada kör uçuyorum, o yüzden sabret.
Aslında çalışacak, ancak bu kod iyi değil. Ne yazık ki ana hedeflerinizi bilmiyorum ve başka bir şey öneremem.