[Qualsiasi domanda da principiante, per non ingombrare il forum. Professionisti, non passate oltre. Da nessuna parte senza di te - 4. - pagina 64

 
alsu:
Se ti prendi la briga di guardare nel terminale, la RSI "in codice" è lì di serie.
Se non ce l'avete, eccovi serviti.
File:
rsi.mq4  3 kb
 

Come posso bloccare il menu in MetaTrader4? A volte si sparge così tanto sullo schermo che è inquietante. Beh, il modo in cui la Taskbar è fissa in Windows, forse le finestre sono fisse anche qui?

 

Ciao, potresti per favore dirmi

Ora ho questo codice:

         if(M_1<NizUroven && M_0 >=NizUroven)
                {
 for(int i=OrdersTotal()-1;i>=0;i--)
   if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
     {     CloseOrder();
     }
   Lot2=GetLot(MaxRisk);
NewOrder(OP_SELL,Lot2);
}


             if(M_1>VerhUroven && M_0<=VerhUroven)
               {
 for(int j=OrdersTotal()-1;j>=0;j--)
   if(OrderSelect(j,SELECT_BY_POS,MODE_TRADES))
     {    CloseOrder();
     }
Lot2=GetLot(MaxRisk);
 NewOrder(OP_BUY,Lot2);
}



come posso semplificare in questo modo?

 for(int i=OrdersTotal()-1;i>=0;i--)
   if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
     {     CloseOrder(); 
     }
   Lot2=GetLot(MaxRisk);

         if(M_1<NizUroven && M_0 >=NizUroven) 
                { NewOrder(OP_SELL,Lot2);
}
             if(M_1>VerhUroven && M_0<=VerhUroven)
               {  NewOrder(OP_BUY,Lot2);
}

 

E un'altra domanda, ho ottimizzato per sei mesi e ho ottenuto questi risultati. Non è chiaro perché molti pass hanno degli zeri (nessun accordo)?

 
monopolie:

Come posso bloccare il menu in MetaTrader4? A volte si sparge così tanto sullo schermo che è inquietante. Beh, il modo in cui la Taskbar è fissa in Windows, forse le finestre sono fisse anche qui?

Dicono che non è un bug, ma una caratteristica))
 
monopolie:

Come posso bloccare il menu in MetaTrader4? A volte si sparge così tanto sullo schermo che è inquietante. Beh, il modo in cui la Taskbar è fissa in Windows, forse le finestre sono fisse anche qui?


Cliccate con il tasto destro del mouse sul menu - "Auto-size columns" e spostate come volete.
 
griha:

Ciao, potresti per favore

il mio codice è così:



come semplificare con questo principio?


questa parte:

for(int j=OrdersTotal()-1;j>=0;j--)
   if(OrderSelect(j,SELECT_BY_POS,MODE_TRADES))
     {    CloseOrder();
     }
Lot2=GetLot(MaxRisk);
 NewOrder(OP_BUY,Lot2);

mettere in una funzione:

ff(int cmd)
{
   for(int j=OrdersTotal()-1;j>=0;j--)
      if(OrderSelect(j,SELECT_BY_POS,MODE_TRADES))
      {
         CloseOrder();
      }
   double Lot2=GetLot(MaxRisk);
   NewOrder(cmd,Lot2);
}

e poi:

if(M_1<NizUroven && M_0 >=NizUroven)
{
   ff(OP_SELL);
}

if(M_1>VerhUroven && M_0<=VerhUroven)
{
   ff(OP_BUY);
}

è come un esempio, con visibilità o trasferimento alla funzione della variabile MaxRisk - capite voi stessi

 
Buon pomeriggio!
Ho riscontrato un problema con l'apertura di un certo numero di ordini(definito dall'utente).
Ho scritto un piccolo codice per risolvere questo problema.
Ma ci sono momenti in cui viene aperto un numero arbitrario di ordini, di solito verso la fine del test.

Qui sotto c'è il codice stesso.

extern string Kolichestvo_orderov = "Количество единовременно открытых ордеров";
extern int OrederBuy = 1;
extern int OrederSell = 1;


int OrdS=1,OrdB=1,ticketBuy,ticketSell,lastticketSell=0,lastticketBuy=0;

//========================================================================================================//     
                                  //---- Открытие ордеров SELL ----//
//========================================================================================================//

if(OrdS<=OrederSell)
  { //----- start
 
if(trendDn==true && SthFast>88.2 && SthSlow<38.2)
     {
ticketSell=OrderSend(Symbol(),OP_SELL,0.1,Bid,3,0,0,0,magick,0,Blue);OrdS++; //--- Если ордер открыт параметр OrdS увеличиваю 
     }
   } //-----end
          
//========================================================================================================//  
                                   //----Открытие ордеров BUY ----//
//========================================================================================================//  

if(OrdB<=OrederBuy)
  { //-----start

if(trendUp==true && SthFast<11.8 && SthSlow>61.8)
      {
ticketBuy=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,0,0,0,magick,0,Red);OrdB++; //--- Если ордер открыт параметр OrdB увеличиваю
      }

  } //------end
  

//------------------------------- Подсчет количества ордеров BUY & SELL ----------------------------------//
   
  if(ticketBuy<=OrdersHistoryTotal()) //------ проверка тикетов тех  ордеров которые уже закрыты
   {
  for(int ordBuy=lastticketBuy;ordBuy<=OrdersHistoryTotal();ordBuy++) //--- перебор новых закрытых ордеров
    {
     if(OrderSelect(ordBuy,SELECT_BY_POS,MODE_HISTORY)==true){if(OrderType()==OP_BUY)OrdB--;lastticketBuy=ticketBuy;} //--- если добавился новый закрытый ордер бай, то параметр OrdB уменьшаю
    }
   }
  
  //-----
    
 if(ticketSell<=OrdersHistoryTotal()) //------ проверка тикетов тех  ордеров которые уже закрыты
  {
 for(int ordSell=lastticketSell;ordSell<=OrdersHistoryTotal();ordSell++) //--- перебор новых закрытых ордеров
     {
     if(OrderSelect(ordSell,SELECT_BY_POS,MODE_HISTORY)==true){if(OrderType()==OP_SELL)OrdS--;lastticketSell=ticketSell;} //--- если добавился новый закрытый ордер селл, то параметр OrdS уменьшаю

Se avete una soluzione più semplice, sarei felice di ricevere commenti.

 

Ciao a tutti!

Potete dirmi se è possibile visualizzare del testo su un grafico, come

   string mytext = "Hello from programmer!";
   ObjectSetText("mycomment", mytext, 10, "Arial", Gray);
     if (ObjectFind("mycomment") == -1) {
         ObjectCreate("mycomment", OBJ_LABEL, 0, 0, 0);
         ObjectSet("mycomment", OBJPROP_CORNER, 2);
         ObjectSet("mycomment", OBJPROP_XDISTANCE, 5);
         ObjectSet("mycomment", OBJPROP_YDISTANCE, 7);}

come una funzione separata in modo che possa essere chiamata in qualche modo:

mycomment("Hello from programmer!")
Motivazione: