Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 271

 
tiiga:
Nope, this is the second time I've come across it, last time I just forgot about it.
There's no such thing as miracles. Show me the whole cycle.
 
If you set it from 0 to e.g. 3 or more, it works, but up to 1 it doesn't for some reason
 
tiiga:
If you do 0 to e.g. 3 or more, it works, but up to 1 it doesn't for some reason.
Take two: show the whole cycle.
 

this is the corrected version that worked

 if (true)
               { //Alert("добавляем стаки покупки",totalstack );
               for(int g=0; g<=genofond; g++)
                //  for(j=0; j<=1; j++)
                    {  
                     if (check[g]==1){
                     if (stacked[g][1]!=1)//
                      {  
                    //    if (j==1)
                   //     {
                           totalstack+=1;
                           if (totalstack<=maxstack)
                              {
                                 for(i=1; i<=maxstack; i++)
                                    {
                                       if (istackstart[i][1]==0)
                                          {
                                             break;
                                          }
                                    }
                              }
                            else
                              {
                                maxstack+=1;
                                i=maxstack;
                              }  
                           ArrayResize(istackstart, maxstack+1);
                           ArrayResize(pstackstart, maxstack+1);
                           
                           istackstart[i][1]=del[g];
                           istackstart[i][2]=g;
                           istackstart[i][3]=j;
                          
                           pstackstart[i][1]=Bid;
                           pstackstart[i][2]=1;   //buy
                           stacked[g][j]=1;
                           Print("добавляем стаки покупки ",totalstack,"  ",maxstack );
                           }
                     //   }
                  //      else
                    //       {
                    if (stacked[g][0]!=1)//
                      {  
                           totalstack+=1;
                            if (totalstack<=maxstack)
                              {
                                 for(i=1; i<=maxstack; i++)
                                    {
                                       if (istackstart[i][1]==0)
                                          {
                                             break;
                                          }
                                    }
                              }
                            else
                              {
                                maxstack+=1;
                                i=maxstack;
                              } 
                        ArrayResize(istackstart, maxstack+1);
                        ArrayResize(pstackstart, maxstack+1);
                       istackstart[i][1]=del[g];
                        istackstart[i][2]=g;
                       istackstart[i][3]=j;
                      
                        pstackstart[i][1]=Bid;
                        pstackstart[i][2]=-1; //sell
                        stacked[g][j]=1;
                        Print("добавляем стаки покупки ",totalstack,"  ",maxstack );
                          
                     }//скобка отпроверки стка
                    }//скобка от чека
                   }//скобка от двойного цикла 
                   //  Alert("добавили стаки покупки",totalstack );
               }
а вот это не рабочий вариант
   
    if (true)
               { //Alert("добавляем стаки покупки",totalstack );
               for(int g=0; g<=genofond; g++)
                  for(j=0; j<=1; j++)
                    {  
                     if (check[g]==1){
                     if (stacked[g][j]!=1)//
                      {  
                        if (j==1)
                        {
                           totalstack+=1;
                           if (totalstack<=maxstack)
                              {
                                 for(i=1; i<=maxstack; i++)
                                    {
                                       if (istackstart[i][1]==0)
                                          {
                                             break;
                                          }
                                    }
                              }
                            else
                              {
                                maxstack+=1;
                                i=maxstack;
                              }  
                           ArrayResize(istackstart, maxstack+1);
                           ArrayResize(pstackstart, maxstack+1);
                           
                           istackstart[i][1]=del[g];
                           istackstart[i][2]=g;
                           istackstart[i][3]=j;
                          
                           pstackstart[i][1]=Bid;
                           pstackstart[i][2]=1;   //buy
                           stacked[g][j]=1;
                           Print("добавляем стаки покупки ",totalstack,"  ",maxstack );
                        }
                        else
                           {
                           totalstack+=1;
                            if (totalstack<=maxstack)
                              {
                                 for(i=1; i<=maxstack; i++)
                                    {
                                       if (istackstart[i][1]==0)
                                          {
                                             break;
                                          }
                                    }
                              }
                            else
                              {
                                maxstack+=1;
                                i=maxstack;
                              } 
                        ArrayResize(istackstart, maxstack+1);
                        ArrayResize(pstackstart, maxstack+1);
                       istackstart[i][1]=del[g];
                        istackstart[i][2]=g;
                       istackstart[i][3]=j;
                      
                        pstackstart[i][1]=Bid;
                        pstackstart[i][2]=-1; //sell
                        stacked[g][j]=1;
                        Print("добавляем стаки покупки ",totalstack,"  ",maxstack );
                           }
                     }//скобка отпроверки стка
                    }//скобка от чека
                   }//скобка от двойного цикла 
                   //  Alert("добавили стаки покупки",totalstack );
               }
 

Good afternoon, here's the problem. Made the EA to trade at a certain time interval, but it doesn't work - it ignores it. Here's the code. The time function returns тру, and the trade should not go, but it does. What could be the error? The values in the Expert Advisor are:

extern string dark_TimeBegin = "23:30";

extern string dark_TimeEnd = "01:00";
bool isTradeTimeString(string tb = "00:00", string te = "00:00") 
{
  datetime dtBegin, dtEnd;        // Время начала и окончания работы
  int      hc, he;                // Часы текущего времени и окончания работы

  dtBegin=StrToTime(TimeToStr(TimeCurrent(), TIME_DATE)+" "+tb);
  dtEnd  =StrToTime(TimeToStr(TimeCurrent(), TIME_DATE)+" "+te);
  hc     =TimeHour(TimeCurrent());
  he     =TimeHour(dtEnd);
  if (dtBegin>=dtEnd) 
  {
    if (hc>=he) dtEnd+=24*60*60; else dtBegin-=24*60*60;
  }

  if (TimeCurrent()>=dtBegin && TimeCurrent()<=dtEnd) return(True);
  else return(False);
}
   if(isTradeTimeString(dark_TimeBegin, dark_TimeEnd) == true)
   {  if(((CountBuy() > 0) || (CountSell() > 0)) && (NormalizeDouble(MarketInfo(Symbol(), 13) ,0) <= trade_spread))
      {
      dark_Close_Sell();
      dark_Close_Buy();
      //Order_limit();
      }
   }
      if(isTradeTimeString(dark_TimeBegin, dark_TimeEnd) == false)
         {
            if((isTrade(time_start_last_new, time_end_last_new) == false) && ((CountBuy() > 0) || (CountSell() > 0)) && (NormalizeDouble(MarketInfo(Symbol(), 13) ,0) <= trade_spread))
            {
               Close_Sell();
               Close_Buy(); 
               //Order_limit();
            }
            if((isTrade(time_start_last_new, time_end_last_new) == true) && (NormalizeDouble(MarketInfo(Symbol(), 13) ,0) <= trade_spread))
            {
               Order_send();
               Close_Sell();
               Close_Buy();               
            }
         }

      Order_limit();
 
tiiga:

it's a revised version that works.

What's stopping you from writing like this?

for(int g=0; g<=genofond; g++)
   Print("Перед циклом j = "+j);
   for(j=0; j<=1; j++) {  
      Print("В цикле j = "+j);
      if (check[g]==1) {
 
Elleremo:

I chose free and that's why I asked the question. Would you be so kind as to tell a newcomer what your dislike of synthetics is,
or refer me to the thread that explains your dislike of them. Thank you.)
There is a subtlety to working with synthetics. The same "mechanism" on the history and directly in real time will build different candlesticks: and the higher TF, the greater the divergence (on the history we don't know how the price moved inside the candlestick). It follows that testing on "historical synthetics" is not applicable to trading on "real synthetics".
 
VladislavVG:


"On" is regional, and Ukraine is not part of the Russian Federation.

"In 1993, at the request of the Government of Ukraine, variants to Ukraine (and respectively from Ukraine) should have been recognized as normative . Thus, in the opinion of the Government of Ukraine, the etymological connection of the constructions to Ukraine and to the outskirts, which did not suit it, was broken . Ukraine as if received the linguistic confirmation of its status of the sovereign state, because the names of states and not regions are formed in the Russian tradition with the prepositions in (in) and from..." (Graudina L. K., Itskovich V. A., Katlinskaya L. P. Grammatical correctness of Russian speech. Moscow: Nauka, 2001. С. 69).

While by inertia some continue the old tradition. ;)

This is what I mean, that in Russian it is "on", in Ukrainian it can be whatever you like. Vladislav, it is a formality - it is included / not included. Ukraine is a native Russian territory. It is populated by Russians. There is no need to make a distinction, at least on the forum. Whatever Ukrainians with a national bias do not call themselves, they will remain Russians. There is no need to quarrel about it at all. There is a nationality - we are Russians! There are ethnic groups (Great Russians, Little Russians, White Russians).

VOLDEMAR:


It has not changed, but it is not correct, we do not say go to CANADA, FINLAND, INDIA, we say go to CANADA, IN CHINA, so it applies to Ukraine ...

The preposition NA is more common in our messages like go NA... ))))

I don't know where it came from. Everywhere in the Russian language is "to Ukraine". Most likely it's because of the etymology of the word "Ukraine" == at the edge.

 
Zhunko:

That's what I'm saying, that in Russian it's "on", in Ukrainian it can be whatever you like. Vladislav, it is a formality to enter/not enter. Ukraine is a native Russian territory. It is populated by Russians. There is no need to make a distinction, at least on the forum. Whatever Ukrainians with a national bias do not call themselves, they will remain Russians. There is no need to quarrel about it at all. There is a nationality - we are Russians! There are ethnoses (the Big Russians, the Little Russians, the White Russians).

I don't know where it came from. Everywhere in the Russian language it's "to Ukraine". Most likely it's because of the etymology of the word "Ukraine" == at the edge.

What is all the fuss about? We are all Slavs. Only Ukraine as a state does not want to admit it. They are fucking Ukrainians.

And in general - such topics belong in the hedgehog itself.

 
 if (true)
               { //Alert("добавляем стаки покупки",totalstack );
               for(int g=0; g<=genofond; g++)
               {
                  for(j=0; j<=1; j++)
                    {  
                  
                     if (check[g]==1){
                     if (stacked[g][j]!=1)//
                      {  
                      //  if (j==1)
                       // {
                           totalstack+=1;
                           if (totalstack<=maxstack)
                              {
                                 for(i=1; i<=maxstack; i++)
                                    {
                                       if (istackstart[i][1]==0)
                                          {
                                             break;
                                          }
                                    }
                              }
                            else
                              {
                                maxstack+=1;
                                i=maxstack;
                              }  
                           ArrayResize(istackstart, maxstack+1);
                           ArrayResize(pstackstart, maxstack+1);
                           
                           istackstart[i][1]=del[g];
                           istackstart[i][2]=g;
                           istackstart[i][3]=j;
                          
                           pstackstart[i][1]=Bid;
                           pstackstart[i][2]=j;   //buy
                           stacked[g][j]=1;
                           Print("добавляем стаки покупки ",totalstack,"  ",maxstack,"  ",j );
                    //    }
                    
                     }//скобка отпроверки стка
                    }//скобка от чека
                   }//скобка от двойного цикла 
                   }
                   //  Alert("добавили стаки покупки",totalstack );
               }

2013.11.22 16:44:40 2013.01.30 19:55 ma mfi wpr adx stohast real-time test2 USDCHF,H1: add stohast buy 111 164 1

2013.11.22 16:44:40 2013.01.30 19:55 adhast adhast real-time test2 USDCHF,H1: add buy stakes 110 164 1

2013.11.22 16:44:40 2013.01.30 19:55 adhast adhast real-time test2 USDCHF,H1: add buy stakes 109 164 1

2013.11.22 16:44:40 2013.01.30 19:55 adhast adhast real-time test2 USDCHF,H1: add buy prices 108 164 1

2013.11.22 16:44:40 2013.01.30 19:55 adhast adhast real-time test2 USDCHF,H1: add buy stakes 107 164 1

2013.11.22 16:44:40 2013.01.30 19:55 adhast adhast real-time test2 USDCHF,H1: add buy stakes 106 164 1

2013.11.22 16:44:40 2013.01.30 19:55 adhast adhast real-time test2 USDCHF,H1: add buy prices 105 164 1

2013.11.22 16:44:40 2013.01.30 19:55 adhast adhast real-time test2 USDCHF,H1: add buy stakes 104 164 1

2013.11.22 16:44:40 2013.01.30 19:55 adhast adhast real-time test2 USDCHF,H1: add buy prices 103 164 1

2013.11.22 16:44:40 2013.01.30 19:55 PM Ad hoc selections ma mfi wpr adx stohast real-time test2 USDCHF,H1: Add buy stakes 102 164 1


Reason: