[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 297

 
Urain >> :
Or else: Time[0]+(Time[0]-Time[1]) or 2*Time[0]-Time[1].

gut :)

 

My regards to the writing (code) brethren!

I understand that this question should kind of get on everyone's nerves, but I haven't found anything useful on it. So I'm confused about something. Help a newcomer to grasp!

I had not an original idea - in one indicator window to display lines for current and larger timeframes (in my case one hour and one day).

My first thought was... However, I didn't have time - my hands did it all by themselves:

Buf_1[ i]=iCCI(NULL,1440,14,PRICE_TYPICAL, i);

The result was clearly out of sync with the timeframe. Well, it is understandable - it is easier to take a ready bar of the called timeframe than to create it dynamically. Well, we will eat crayfish if we have no fish. I have synchronized the start of drawing by time and replaced i with an id that is updated at each change of day. The ladder with horizontal segments, passing through every hour of one day is no big deal, but at least it's something. Logically the straight sections should have bent real time. It did. But it takes long time to stay connected to the server for weeks in the name of a viable image, and the tester's visualizer kind of simulates this very real. I ran an empty Expert Advisor and threw it through the window of visualization of an interstitial. Damn it! There is no simulation! When I change the day, I get a fully formed bar from the history, which is not yet formed. The output is the same staircase. It turns out that the zero bar in the above design is not suitable for work, because during testing it will be faking. The next step was made out of sheer stubbornness to make sure nothing was left unsaid and the "i "s were dotted. I addressed from the Expert Advisor to this very zero bar through my indicator and filtered its (Expert Advisor's) actions by the state of CCI (more or less than on the previous day). Judging by that rubbish in the tester, some changes in the bar did occur, but Iwas too short to get to the bottom of it. Once again I berated myself for lack of step-by-step debugging of the code with controlling variables. (Of course, I could log it, but for more complicated cases it would be a total fiasco).

A digression.

I was moved to tears by the pictures in version 5. Very powerful tool! Media player will probably appear in version 6. )))))))))) But why not give them such an object as "bar" with all its attributes? That'd be a lot of pain in one fell swoop, wouldn't it?

Back to the selves. At the end of the tester an indicator was opened in which the line in question was absolutely straight for a year and it showed nothing at all.

That's it.

Out.

One and the same construction on the history, in real time, in the visualization window and in the program behaves completely differently.

I sit now and try to understand, is it a bug this, or such a chip or armor is strong and our tanks are fast?

Z.U. No, due to my stubbornness, I finally got what I wanted, simulating a piece of timeseries from the current data (you can also ask for a minute for greater certainty) and the calculation of its own forces, but it's too much out of my ass, sorry, get. And I would like to understand the rules of reference to other timeframes in such constructions...

 
hot писал(а) >>

My regards to the writing (code) brethren!

I understand that this question should kind of get on everyone's nerves, but I haven't found anything useful on it. So I'm confused about something. Help a newcomer to grasp!

I had not an original idea - in one indicator window to display lines for current and larger timeframes (in my case one hour and one day).

My first thought was... However, I didn't have time - my hands did it all by themselves:

The result was clearly out of sync with the timeframe. Well, it is understandable - it is easier to take a ready bar of the called timeframe than to create it dynamically. Well, we will eat crayfish if we have no fish. I have synchronized the start of drawing by time and replaced i with an id that is updated at each change of day. The ladder with horizontal segments, passing through every hour of one day is no big deal, but at least it's something. Logically the straight sections should have bent real time. It did. But it takes long time to stay connected to the server for weeks in the name of a viable image, and the tester's visualizer kind of simulates this very real. I ran an empty Expert Advisor and threw it in the window of visualization of the tester. Damn it! There is no simulation! When I change the day, I get a fully formed bar from the history, which is not yet formed. The output is the same staircase. It turns out that the zero bar in the above design is not suitable for work, because during testing it will be faking. The next step was made out of sheer stubbornness to make sure nothing was left unsaid and the "i "s were dotted. I addressed from the Expert Advisor to this very zero bar through my indicator and filtered its (Expert Advisor's) actions by the state of CCI (more or less than on the previous day). Judging by that rubbish in the tester, some changes in the bar did occur, but Iwas too short to get to the bottom of it. Once again I berated myself for lack of step-by-step debugging of the code with controlling variables. (Of course, I could log it, but for more complicated cases it would be a total fiasco).

A digression.

I was moved to tears by the pictures in version 5. Very powerful tool! Media player will probably appear in version 6. )))))))))) But why not give them such an object as "bar" with all its attributes? That'd be a lot of pain in one fell swoop, wouldn't it?

Back to the selves. At the end of the tester an indicator was opened in which the line in question was absolutely straight for a year and it showed nothing at all.

That's it.

Out.

One and the same construction on the history, in real time, in the visualization window and in the program behaves completely differently.

I sit now and try to understand, is it a bug this, or such a chip or armor is strong and our tanks are fast?

Z.U. No, due to my stubbornness, I finally got what I wanted, simulating a piece of timeseries from the current data (you can also ask for a minute for greater certainty) and the calculation of its own forces, but it's too much out of my ass, sorry, get. And I want to understand the rules of reference to other timeframes in similar structures...

Write to me in my personal ...

 
Vinin >> :

>> write to me in person

Thanks for the heads up, but I need the theory and I prefer to deal with the practice myself. )))))))))))))

 

Hello, I have this question:

How can I force the EA to make only one trade at a specified time? I.e., for example, every trading day to make only one buy order at exactly 15 hours? I tried to do it this way:

int ct = Hour();
int cm = Minute();
int sd = Seconds();

if(ct == 15 && cm == 0 && sd == 0)
{
int tick = OrderSend(Symbol(),OP_BUY,A_lot,Ask,5,Ask-A_sl*Point,Ask+A_tp*Point,"Покупка.",3,0,CLR_NONE);
}

Works in principle, but only the EA makes many purchases at once, as the first second of the 16th hour comes with several ticks (also depends on the deposit and lot).

Tried to check by mag and day of transaction, but still end up with a mess:

int ct = Hour();
int cm = Minute();
int sd = Seconds();

if(ct == 15 && cm == 0 && sd == 0)
{
for (int i=1; i<=OrdersTotal(); i++)
{
if(OrderSelect(i-1, SELECT_BY_POS, MODE_TRADES)==true)
{
if(OrderMagicNumber() == 3 && OrderOpenTime() == Day())
{
bool A_order = true; break;
}
A_order = false;

}
}

if(A_order == false)
int tick = OrderSend(Symbol(),OP_BUY,A_lot,Ask,5,Ask-A_sl*Point,Ask+A_tp*Point,"Покупка.",3,0,CLR_NONE);
}

If anyone knows, please advise! I will try to check the magic number in the same way but it still leaves a mess.

 
JackaLrus >> :

Hello, I have this question:

How can I force the EA to make only one trade at a specified time? I.e., for example, every trading day to make only one buy order at exactly 15 hours? I tried to do it that way:


If anyone knows, please advise! Thank you!

Try looking in I. Kim's thread -

Function isTradeToDay(). Page 21

This function returns the trade flag for today. Flag is up - True - positions were opened today. Flag down - False - no positions opened today

https://www.mql5.com/ru/forum/107476/page21

//-

With this function you can easily create an opening condition:

if (isTradeToDay(NULL,-1,Magic)<1 ) {//  если сегодня не было сделок
//- то торговля разрешена

And the time of opening is very easy to set.

In addition, Igor has similar time functions there.

 

Thanks for the link! I figured it out!

You need to use TimeDay (OrderOpenTime())==Day() in the comparison, then everything works as it should!

 

Need help. I am changing the trading criteria in Criterion's MACD_Simple in the documentation (4 week rule, search for 20 and 10 day lows and highs - see commented code for details) but when I run it on the history in the tester, the Expert Advisor does not open orders.

I understand that I am lost in three trees, nevertheless, if you have time and opportunity, please advise...

//--------------------------------------------------------------------
// Criterion.mqh
// Правило 4-х недель
//--------------------------------------------------------------- 1 --
// Функция вычисления торговых критериев.
// Возвращаемые значения:
// 10 - открытие Buy  цена закрытия выше максим-ой за последние 20 дней
// 20 - открытие Sell цена закрытия ниже минимальной за последние 20 дней 
// 11 - закрытие Buy  цена закр ниже минимальной за последние 10 дней
// 21 - закрытие Sell цена закрытия выше максимальной за последние 10 дней
// 0  - значимых критериев нет
// -1 - используется другой финансовый инструмент
//--------------------------------------------------------------- 2 --
// Внешние переменные:
extern int                                 
       Counted_bars1=20,                         // Количество просчитанных баров 
       Counted_bars2=10;                         // Количество просчитанных баров 
       




//--------------------------------------------------------------- 3 --
int Criterion()                                                   // Пользовательская функция
  {
   double
        Max_20 = High [1], Min_20 = Low [1],                      // Присваиваем значения максимуму и  
        Max_10 = High [1], Min_10 = Low [1];                      // минимуму на 1-ом баре
   int i=0;                                                       // Индекс бара  
          
   
   //--------------------------------------------------------------- 4 --
   // Параметры торговых критериев:
   
  for( i = 2; i <= Counted_bars1+1; i++)                             // цикл для 20 дней 
         {                                        
         if (Low[ i] <  Min_20)                               // Если текущее значение < известного   
               Min_20 = Low[ i];                              // то оно и будет минимум   
         
         if (High[ i] > Max_20)                               // Если > известного    
               Max_20 = High[ i];                             // то оно и будет максимум  
           }   
  
  for( i = 2;  i <= Counted_bars2+1; i++)                     // цикл для 10 дней 
         {                                        
         if (Low[ i]< Min_10)                                 // Если текущее значение < известного   
               Min_10=Low[ i];                                // то оно и будет мин   
               
         if (High[ i] > Max_10)                                   // Если > известного    
               Max_10=High[ i];                                   // то оно и будет макс  
           }   

   
    //--------------------------------------------------------------- 5 --
   
    // Вычисление торговых критериев
    
   if(Close[0]> Max_20)
   return(10);                                           // Открытие Buy    
   
     
   if (Close[0]< Min_20)  
   return(20);                                           // Открытие Sell
     
   if(Close[0]< Min_10)
   return(11);                                           // Закрытие Buy    
  
   
   if(Close[0]> Max_10)
   return(21);                                           // Закрытие Sell    
   
     
   
  
      
       
//--------------------------------------------------------------- 6 --
   return(0);                          // Выход из пользов. функции
  }
//--------------------------------------------------------------- 7 --
 

Hello forum members, I've started to study TS quite recently and I have a question for you. I saw an Expert Advisor called EURONIS on a well-known website. By searching on Google I found several positive reviews and none negative. In the same Google had a link to this forum with topic under discussion for this advisor, which expressed skeptical opinions, but the topic was apparently deleted (now search on the site did not yield anything).

That is why I want to know what this EA is? Does it bring stable profits? Are there any of you who traded it on real account? I am waiting for your comments.

I am waiting for your comments. Thanks in advance.

 
Roman. >> :

Need help. I am changing inclusion of the Criterion MACD_Simple from the documentation the trading criteria (using 4 week rule, search for 20 and 10 day lows and highs - details in the commented code) but when I run it on the history in the tester, the Expert Advisor does not open orders.

I understand that I am lost in three pines, nevertheless, if you have time and opportunity - tell me...

Add the complete code, if you don't want to show your idea, change the criterion, for example:

if(Close[0]>Open[1])
   return(10);                                           // Открытие Buy    
   
     
   if (Close[0]<Open[1])  
   return(20);                                           // Открытие Sell
     
   if(Close[0]<Open[1])
   return(11);                                           // Закрытие Buy    
  
   
   if(Close[0]> Open[1])
   return(21);                                           // Закрытие Sell    

But without seeing the whole picture it's impossible to say where the artist went wrong.