[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 282

 
Zhunko:

You have to form from ticks. The period converter does the minimum from minutes.


Kovalev's is correct. I have highlighted in red what you do not have.

Got it. Thank you very much.
 
MauzerVII:

Guys, help me out.

I don't understand why the line

Result: 2013.04.12 17 13 Print_v4 EURUSD,M15: SL == 1.3068

gives out four decimal places?

I am aware ofDoubleToStr.



If you are aware of it, what's the question, I don't understand.

 

Question about tick collector code in kodobase. Some kind of weird check for conditions assigned in the header of boolean variables that don't change further in the code. I don't understand how it works.

//в шапке
           bool tick.time.local        =               false;
           bool tick.chart.update      =                true;
//в init()
   if(tick.chart.update == true)
     {
     if(MT4InternalMsg == 0)  
            {
            MT4InternalMsg = RegisterWindowMessageA("MetaTrader4_Internal_Message"); 
            }   
     }  
//в start()
     if(tick.time.local == true)//где менялось, я вообще не понял
       {
       time = TimeLocal();
       }
       else{
       time = TimeCurrent();
       }
//--------------------------------
       if(tick.chart.update == true)
         {
                   hwnd = WindowHandle(sn, 1);
         if(PostMessageA(hwnd, WM_COMMAND, 0x822c, 0) == false)
           {
           hwnd = 0;
           return;
           }
           PostMessageA(hwnd, MT4InternalMsg, 2, 1);             
           }                 
         } 

The value of the assigned boolean variables does not change anywhere in the conditions (and further in the code). Moreover, start() checks for the reverse value of the assigned variable at all. But it works. How?

 

Or is it just unoptimised code? GetLastError() is declared in the header

#import "ntdll.dll"
 int RtlGetLastWin32Error();
 int RtlSetLastWin32Error (int dwErrCode);

And these NaiveAPI functions are not used anywhere else in the code...

 

Fellow programmers, tell me how to solve one "simple" problem.

For example, I need to delete the second line of a CSV file. I couldn't find any information on how to do it in the documentation.

Example:

12:30;1;1.34818;12:32;3;3;100;1.34939;18:45\r\n

14:00;1;1.32219;14:26;6;6;100;0.0000;00:00\r\n

19:00;0;1.35828;19:12;12;6;600;1.37939;19:59\r\n

 
tuner:


I would, but I don't have time to think about anything else, sorry.

Regarding the question about where they are changed. My guess is that they are debug flags, which the programmer used when writing the indicator and left in the code for debugging, if someone needs them.

 

The bottom line is simple. The fast swing crosses the slow swing. Then the price rolls back to the fast one and then the Expert Advisor should open an order.

At the moment I have written the function to fix the pullback as follows:

//+-------------------------------------------------------------------------------------+
//| Получение значений МА на указанном баре                                             |
//+-------------------------------------------------------------------------------------+
double GetMA(int index, int maPeriod)
{
   return (iMA(NULL, i_TF, maPeriod, 0, MODE_EMA, MODE_CLOSE, index));
}
//+-------------------------------------------------------------------------------------+
//| Имеет ли место отскок?                                                              |
//+-------------------------------------------------------------------------------------+
void IsRebound(int crossDir[], bool& returnSign[])
{
   for (int i = 0; i < 4; i++)
   {
      if (crossDir[i] == CROSS_NO)
         continue;

      returnSign[i] = false;
      double ema = GetMA(1, g_maPeriod[i]);

      if (crossDir[i] == CROSS_UP)
      {
         if (ND(MathAbs(ema - Ask)) <= i_thresholdFromMa * pt) // ..зазор между ценой покупки и машки, <= i_thresholdFromMa..
         {
            returnSign[i] = true;
            Alert("CROSS_UP");
         }
      }
      if (crossDir[i] == CROSS_DN)
      {
         if (ND(MathAbs(ema - Bid)) <= i_thresholdFromMa * pt) // ..зазор между ценой покупки и машки, <= i_thresholdFromMa..
         {
            returnSign[i] = true;
            Alert("CROSS_DN");
         }
      }
   }
}

Is this correct? Or should it be done differently?

ThecrossDir[] array stores values about the existence of a crossover. If there is one, it checks the gap between the current buy or sell price and the value of the mask. For some reason, the condition is not fulfilled at all.

Here's what I need:

backtracking

After any wristband crosses 365, and as soon as the price rolls back to the corresponding wristband that crossed 365, buy. HOW DO I RELEASE THIS?

 

Draw some kind of logical diagram of what you want. For yourself.

A year consists of approximately 250 daily bars.

 
Hasn't anyone implemented this. I don't think it's very complicated. I just don't have much experience yet, I don't quite understand how to formalise this point ...
 
hoz:
Hasn't anyone ever done it. I don't think it's very difficult. I just don't have much experience yet, I don't quite understand how to formalise this point ...

You could do it in a flowchart. You could do something else, but in a very thorough and unambiguous way. So that I won't be able to kick you for the inconsistency of the idea with its description.

I will not do it.

Reason: