[Arşivle!] Forumu kirletmemek için herhangi bir acemi sorusu. Profesyonel, kaçırmayın. Sensiz hiçbir yerde - 2. - sayfa 405

 
Некоторые ДЦ на реальных счетах именам символов присваивают всякие префиксы типа "." или "FXF" .

Как мне подставлять эти префиксы?

StringConcatenate (..) dizesini deneyin

 
Dimka-novitsek :

Anladım, hemen yapacağım.

Ayrıca, durum çalışmıyor

"çalışmıyor", sadece X ile aynı nedenle ona ulaşmıyor

Bu, Alert'te i'den hiçbir sinyal olmaması gerçeğiyle açıkça görülmektedir.

 
ilunga :

"çalışmıyor", sadece X ile aynı nedenle ona ulaşmıyor

Bu, Alert'te i'den hiçbir sinyal olmaması gerçeğiyle açıkça görülmektedir.


Evet kesinlikle..
 
Yaşasın yazıyorum !!!!!!
 //+------------------------------------------------------------------+
//|                                                    для лавин.mq4 |
//|                      Copyright © 2011, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp."
#property link       "http://www.metaquotes.net"
extern double stoploss= 0 ; extern double takeprofit= 20 ; extern int otstup= 20 ; extern datetime expiration= 0 ;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return ( 0 );
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return ( 0 );
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
 int tiket,tikett; double volume= 0.1 ; int i= 0 ,R1= 0 ,R2= 0 ,A= 1 ; double price= PRICE_OPEN ;
   //  R1=((PRICE_OPEN- stoploss*Point)*stoploss)/stoploss;R2=((PRICE_OPEN+ stoploss*Point)*stoploss)/stoploss;
     
     
int start()
  {       int X,Y; double price=(Ask+Bid)/ 2 ;            
//----
       Alert ( "OrdersTotal()" , OrdersTotal ());


 for ( int i= OrdersTotal ();i> 0 ;i--){ Alert ( "i" , i); if (OrderSymbol()== Symbol ()&&OrderMagicNumber( )== 1000 ){
OrderSelect (i,SELECT_BY_POS ); if (OrderType( )==OP_BUYSTOP){X++;}}} Alert ( "X" , X);
if (X== 0 ){


   tiket= OrderSend ( Symbol (), OP_BUYSTOP,  volume*A, price +otstup* Point , Point * 3 , R1, price+takeprofit* Point +otstup* Point , "OP_BUYSTOP" , 1000 ,  expiration, Red ); 
   Alert ( "OP_BUYSTOP" , GetLastError ( )); }
   

 for ( i= OrdersTotal ();i> 0 ;i--){ Alert ( "i" , i); OrderSelect (i,SELECT_BY_POS ); if ( OrderMagicNumber( )== 2000 &&OrderSymbol()== Symbol ()) { 
if (OrderType( ) ==OP_SELLSTOP) { Y++;}}} Alert ( "Y" , Y);
 if (Y== 0 ){ 
   tikett= OrderSend ( Symbol (), OP_SELLSTOP,  volume*A, price -otstup* Point , Point * 3 ,R2, price-takeprofit* Point -otstup* Point , "OP_SELLSTOP" , 2000 ,  expiration, C'0,128,255' );
     Alert ( "OP_SELLSTOP" , GetLastError ( )); 
    }       
   
//----
   return ( 0 );
  }
//+------------------------------------------------------------------+
 
ilunga :

Eh, "hemen" seçenek çalıştı:

evet, böyle çalışır. Teşekkür ederim!
 
Vay! Yaşasın!! Olmuş!!! Pekala!!
 

Güzel gün. Böyle bir sorun, danışman yazdığım belli bir süre sonra takılıyor? Kaldırıldığında, zaman aşımına göre kapatma yazar. "Çan ve ıslık" olmayan bir danışmanın nedeni nedir?

 //+------------------------------------------------------------------+
//|                                                      RSITest.mq4 |
//|                      Copyright © 2011, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp."
#property link       "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return ( 0 );
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return ( 0 );
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
   int deal, cnt;
   double TotalProfit;
//----
   // Проверяем, сободен ли торговый поток
if (!IsTradeAllowed())
{
return ( 0 );
}


if ( OrdersTotal () == 0 )
   {
       while (true)
      {
         //*********************************** Открываем Buy ордер  ***********************************
         if ( iRSI ( NULL , 0 , 14 , PRICE_CLOSE , 0 ) > iRSI ( NULL , 0 , 14 , PRICE_CLOSE , 1 ))
         { 
             if ( iRSI ( NULL , 0 , 14 , PRICE_CLOSE , 0 ) > 60 && iRSI ( NULL , 0 , 14 , PRICE_CLOSE , 1 ) < 60 )
            {
               deal = OrderSend ( Symbol (),OP_BUY, 0.1 ,Ask, 0 ,iLow( NULL , 0 , 0 )- 20 * Point , 0 , "Long EUR/USD" , 0 , 0 , CLR_NONE );
               if (deal > 0 ) Print ( "Long" );
               else Print ( GetLastError ());
               return ( 0 );
            }
         }
         //*********************************** Открываем Sell ордер  **********************************
         if ( iRSI ( NULL , 0 , 14 , PRICE_CLOSE , 0 ) < iRSI ( NULL , 0 , 14 , PRICE_CLOSE , 1 ))
         { 
             if ( iRSI ( NULL , 0 , 14 , PRICE_CLOSE , 0 ) < 40 && iRSI ( NULL , 0 , 14 , PRICE_CLOSE , 1 ) > 40 )
            {
               deal = OrderSend ( Symbol (),OP_SELL, 0.1 ,Bid, 0 ,iHigh( NULL , 0 , 0 )+ 20 * Point , 0 , "Short EUR/USD" , 0 , 0 , CLR_NONE );
               if (deal > 0 ) Print ( "Short" );
               else Print ( GetLastError ());
               return ( 0 );
            }
         }
      }
   }      
//else
//if
   //{
   for (cnt= 0 ;cnt< OrdersTotal ();cnt++)
      {
       if ( OrderSelect (cnt, SELECT_BY_POS)==true)
      {
         TotalProfit += OrderProfit();
         if (TotalProfit>= 2 || iRSI ( NULL , 0 , 14 , PRICE_CLOSE , 0 )< iRSI ( NULL , 0 , 14 , PRICE_CLOSE , 1 ))
         {
             if (OrderType()== OP_BUY)
            {         
               // Закрываем и отдыхаем 15 минут
               OrderClose(OrderTicket(),OrderLots(),Bid, 0 , CLR_NONE );
           //    Sleep(900000);
               return ( 0 );
            }
         }
         if (TotalProfit>= 2 || iRSI ( NULL , 0 , 14 , PRICE_CLOSE , 0 )> iRSI ( NULL , 0 , 14 , PRICE_CLOSE , 1 )) 
         {  
             if (OrderType()== OP_SELL)
            {     
               // Закрываем и отдыхаем 15 минут    
               OrderClose(OrderTicket(),OrderLots(),Ask, 0 , CLR_NONE );
           //    Sleep(900000);
               return ( 0 );
            }
         }
      }
      }   
     //}


//----
   return ( 0 );
  }
//+------------------------------------------------------------------+
 
while döngüsünü kaldırın, burada gereksiz.
 
Çok teşekkürler. Başka bir soru, 15 dakikaya mal oluyor. zaman dilimi, diyelim ki sipariş 18-38-55'te kapandı, danışmanın 18-45-00'a kadar çalışmaması, yani. sonraki bara ??
 
https://www.mql5.com/ru/forum/133552 konusuna bakın ve yalnızca sizin durumunuz için (bazı değişikliklerle) Zaman Çubuğu değişkeninin nasıl uygulandığına daha yakından bakın.