[ARCHIVE] Toute question de débutant, afin de ne pas encombrer le forum. Professionnels, ne passez pas à côté. Nulle part sans toi - 3. - page 355

 
FelixFX:



Mais alors le tableau doit être à 7 dimensions ?

for (g=0;g<=100000;g++){

for (a=0;a<=100;a++){

for (b=0;b<=100;b++){ 

jaw_val1=iMA(NULL, 0, a, b, MODE_SMMA, PRICE_MEDIAN, g);

if (jaw_val1<=Close[g]) continue;

for (c=0;c<=100;c++){

for (d=0;d<=100;d++){

jaw_val2=iMA(NULL, 0, c, d, MODE_SMMA, PRICE_MEDIAN, g); 

if (jaw_val2<=Close[g]) continue;

for (e=0;e<=100;e++){

for (f=0;f<=100;f++){

jaw_val3=iMA(NULL, 0, f, e, MODE_SMMA, PRICE_MEDIAN, g); 

if (jaw_val3>Close[g]) sum=sum+(High[g]-Low[g]); 

}}}}}}}   
Optimisation Light.
 
Pouvez-vous me dire comment demander le maximum de la dernière fractale ?
 
nadya:
Pouvez-vous me dire comment demander le maximum de la dernière fractale ?

Au milieu de cette page.
 
Roman.:

Au milieu de cette page.
Merci !
 
Comment utiliser PostMessageA pour désactiver un EA ? (Appuyez sur la touche "Advisors")
 
nadya:
Pouvez-vous me dire comment demander le maximum de la dernière fractale ?
La dernière fractale est la seule fractale. Et si c'est la seule fractale, elle est à la fois le maximum et le minimum, car il n'y a rien d'autre à quoi la comparer.
 
serler2:
Comment utiliser PostMessageA pour désactiver un EA ? (Appuyez sur la touche "Advisors")

Bibliothèque.

Suivant :

// 5. Функция включения/отключения эксперта.
void ExpertEnabled(bool bSwitch) // TRUE - включить эксперт, FALSE - отключить эксперт.
 {
  if (bSwitch) {if (!IsExpertEnabled()) ServiceSetExperts();} // Если требуется разрешить работу эксперта. Разрешаем работу экспертов, если она была запрещена.
  else {if (IsExpertEnabled()) ServiceSetExperts();} // Если требуется запретить работу эксперта. Запрещаем работу экспертов, если она была разрешена.
 }
 
splxgf:
Optimisation de la lumière.


Merci ! Mais

for (g=0;g<=100000;g++){

par la condition des tâches en cours d'exécution, doit nécessairement être la dernière boucle.

 
FelixFX:


Merci ! Mais

for (g=0;g<=100000;g++){

par la condition des tâches à accomplir doit nécessairement être la dernière boucle.

Il n'y a pas de telle dépendance dans votre exemple de code. Un autre exemple vous donnera une autre solution. C'est ça, l'optimisation.

 

Bonjour !

Je suis autodidacte et il s'agit de mes premiers pas dans la programmation.

Je crée un indicateur à des fins pédagogiques et pratiques.

Lors de l'élaboration de critères de négociation dans les conseillers experts, il est plus pratique d'utiliser des indicateurs prêts à l'emploi.

Dans cet indicateur, j'essaie également de combiner plusieurs indicateurs (composés).

Mais cela ne fonctionne pas : le terminal se bloque et ne le rend pas correctement.

Qu'est-ce que je fais de mal ? Aidez-moi, s'il vous plaît.

Je veux recevoir des commentaires, des critiques, des corrections, des recommandations, mais pas des moqueries (personne ne naît as ... et tout le monde est passé par là).

Les indicateurs que vous abordez sont des indicateurs personnalisés. Tout va bien avec eux - ils fonctionnent correctement.

Si vous avez besoin de précisions, je suis prêt à vous aider.

/**********************************************************/
// Иникатор ME_Proboy_F5_Complex_v3.mq4
// Комплексный индикатор включающий в себя анализ
// - Нахождение сигнала пробоя линии построенной по Frac5-5;
// - Выставление ордеров;
// - Времени жизни ордеров;
// - Cрабатывание ордера;
// - Срабатывание стопа;   
// - Срабатывание профита; 
//
// Данный индикатор отображает значение ордеров (Buy, Sell) как графически,  
// 
//-----         
// 2.period_Teni  - определяет за какой период будет расчитываться средняя тень. 
//-----         
// 4.min_order - минимально допустимое расстояние от экстремума свечи до ордера  
//               в пунктах.  
// 5.koef_R     =    1.5;  
//-----         
#property indicator_separate_window 

#property indicator_buffers       8         
#property indicator_color1        Blue  
#property indicator_color2        DeepPink
#property indicator_color3        Blue
#property indicator_color4        DeepPink 
#property indicator_color5        LightPink    
#property indicator_color6        LightPink  
#property indicator_color7        LightGreen  
#property indicator_color8        LightGreen  

#property indicator_maximum  4         //верхнее ограничение шкалы отдельного окна индикатора 
#property indicator_minimum -4        //нижнее ограничение шкалы отдельного окна индикатора 
#property indicator_level1 0.0         //горизонтальный уровень N в отдельном окне индикатора, где N от 1 до 8 
#property indicator_levelcolor Silver // цвет горизонтальных уровней индикатора 
#property indicator_levelwidth 1      //толщина горизонтальных уровней индикатора 


// -------------------- Для обращения к индикатору пробоя фрактала 5 ----------------
extern   int       T_Life_CDL        =  0;                         // Ограничительная область в 5 ть свечек                                                               
extern   bool      Img_UP_DW         =  true;                      // Рисовать или нет линии по понижающимся верхним фракталам
extern   color     Color_UP_D        =  Lime;                      // Цвет линий по верхним фракталам                                                                
extern   bool      Img_DW_UP         =  true;                      // Рисовать или нет линии по повышающимся нижним фракталам
extern   color     Color_DW_UP       =  DeepPink;                      // Цвет линий по нижним фракталам
// -------------------- Для обращения к индикатору конвертов ----------------
extern   int       mode_MA           =  1;        //усреднение                
extern   int       price_MA          =  0;        //цена для расчёта МА
extern  double     period_MA         =  120;
extern  double     period_ATR        =  12; 
extern  double     k_step_ATR        =  1.0;      
// -------------------- Для обращения к индикатору уровня ордера ---------------- 
extern  int        period_Teni       =  12;
//extern  int        period_ATR        =  12;  
extern  double     min_order         =  0;   
extern  double     koef_R            =  1.5;  
extern  bool       text              =  false; 
extern  int        T_Life_ORD        =  2;
//--------------------------------------------
        double     spred;
        int        O_Buy,
                   O_Sel,
                   D_Buy,
                   D_Sel,
                   S_Buy,
                   S_Sel,
                   P_Buy,
                   P_Sel;
//-------------------------------------------------------------------

double Order_Buy[]; 
double Order_Sel[];
double Deal_Buy[]; 
double Deal_Sel[];
double Stop_Buy[];
double Stop_Sel[];
double Profit_Buy[];
double Profit_Sel[]; 

//+===========================================================================+ 
int init()  
   { 
     SetIndexBuffer (0, Order_Buy); 
     SetIndexStyle  (0, DRAW_HISTOGRAM, STYLE_SOLID, 2); 
     SetIndexLabel  (0,"Ордер Buy");
    //-----         
     SetIndexBuffer (1, Order_Sel);  
     SetIndexStyle  (1, DRAW_HISTOGRAM, STYLE_SOLID, 2); 
     SetIndexLabel  (1,"Ордер Sell");
     
     SetIndexBuffer (2, Deal_Buy); 
     SetIndexStyle  (2, DRAW_HISTOGRAM, STYLE_SOLID, 4); 
     SetIndexLabel  (2,"Покупка");
    //-----         
     SetIndexBuffer (3, Deal_Sel);  
     SetIndexStyle  (3, DRAW_HISTOGRAM, STYLE_SOLID, 4); 
     SetIndexLabel  (3,"Продажа");
     
     SetIndexBuffer (4, Stop_Buy); 
     SetIndexStyle  (4, DRAW_HISTOGRAM, STYLE_SOLID, 6); 
     SetIndexLabel  (4,"Стоп Buy");
    //-----         
     SetIndexBuffer (5, Stop_Sel);  
     SetIndexStyle  (5, DRAW_HISTOGRAM, STYLE_SOLID, 6); 
     SetIndexLabel  (5,"Стоп Sell");
     
     SetIndexBuffer (6, Profit_Buy);  
     SetIndexStyle  (6, DRAW_HISTOGRAM, STYLE_SOLID, 6); 
     SetIndexLabel  (6,"Профит Buy");
     
     SetIndexBuffer (7, Profit_Sel);  
     SetIndexStyle  (7, DRAW_HISTOGRAM, STYLE_SOLID, 6); 
     SetIndexLabel  (7,"Профит Sell");
     IndicatorShortName ("Сделка ПРОБОЙ 5");
     
     spred=MarketInfo(NULL,MODE_SPREAD);
     
     IndicatorDigits(Digits);
     if (Digits <= 3) double K = 0.01; else K = 0.0001; 
     
    // double Pink_Level=Pink_Level * K;
    
    return(0); 
   } 
//+===========================================================================+ 
int start(){

    int i,Counted_bars;     
    Counted_bars =Bars- IndicatorCounted();
             
    for (i = Counted_bars-1; i>=0;i++){
    
            Order_Buy[i] = 0; 
            Order_Sel[i] = 0;
            Deal_Buy[i]  = 0; 
            Deal_Sel[i]  = 0;
            Stop_Buy[i]  = 0;
            Stop_Sel[i]  = 0;
            Profit_Buy[i]= 0;
            Profit_Sel[i]= 0;   
//----------------получаем пробой 5 фракталов              
       double proboy_5_UP = iCustom (NULL,0,"ME_Proboy_F5_For_EX",T_Life_CDL ,Img_UP_DW, Lime, Img_DW_UP, DeepPink,0,i);  
       double proboy_5_DW = iCustom (NULL,0,"ME_Proboy_F5_For_EX",T_Life_CDL ,Img_UP_DW, Lime, Img_DW_UP, DeepPink,1,i);
//----------------если пробой есть,то выставляем ордер       
       int n;
       
        if (proboy_5_UP==1){
         
          double Buy= iCustom(NULL,0,"ME_Order_ATR_For_EX",period_Teni,period_ATR,min_order,koef_R,text,0,i);
          int    num_Buy=i;
          double Buy_Stop=iCustom(NULL,0,"ME_Order_ATR_For_EX",period_Teni,period_ATR,min_order,koef_R,text,2,i);
          double Buy_Profit=iCustom(NULL,0,"ME_Order_ATR_For_EX",period_Teni,period_ATR,min_order,koef_R,text,4,i);
          
          O_Buy=1; 
       
//---------------проверяем время жизни        
         if (O_Buy==1 && Buy<=High[i]+spred && num_Buy >=i-T_Life_ORD+1 ){
            Buy=0;
            Buy_Stop=0;  
            Buy_Profit=0; 
         }
         if (O_Buy==1 && Buy<=High[i]+spred) D_Buy=3;
         if (D_Buy==3 && Buy_Stop>=Low[i]) S_Buy=2;
         if (D_Buy==3 && S_Buy!=2 && Buy_Profit<=High[i]) P_Buy=2;
       }
      
//----------------если пробой есть,то выставляем ордер           
       if (proboy_5_DW==-1){
          double Sel= iCustom(NULL,0,"ME_Order_ATR_For_EX",period_Teni,period_ATR,min_order,koef_R,text,1,i);
          int    num_Sel=i;
          double Sel_Stop=iCustom(NULL,0,"ME_Order_ATR_For_EX",period_Teni,period_ATR,min_order,koef_R,text,3,i);
          double Sel_Profit=iCustom(NULL,0,"ME_Order_ATR_For_EX",period_Teni,period_ATR,min_order,koef_R,text,5,i);
          O_Sel=-1; 
        
       
//---------------проверяем время жизни           
          if (Sel==-1 && Sel<=High[i]+spred && num_Sel >=i-T_Life_ORD+1 ){
            Sel=0;
            Sel_Stop=0;  
            Sel_Profit=0; 
          }
          if (Sel==-1 && Sel<=High[i]+spred) D_Sel=-3;
          if (D_Sel==-3 && Sel_Stop<=High[i]) S_Sel=-2;
          if (Sel==-1 && S_Sel!=-2 &&Sel_Profit>=Low[i]) P_Sel=-2;
      
      
   
   
   
  
//=========================================== Вывод результатов ============================================
            Order_Buy[i] = O_Buy; 
            Order_Sel[i] = O_Sel;
            Deal_Buy[i]  = D_Buy; 
            Deal_Sel[i]  = D_Sel;
            Stop_Buy[i]  = S_Buy;
            Stop_Sel[i]  = S_Sel;
            Profit_Buy[i]= P_Buy;
            Profit_Sel[i]= P_Sel; 
            
         }
         
       }
       return(0);       
}
           
          

Je vous remercie de votre participation et de votre aide, respectueusement, Olga.

Raison: