Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1152

 
Konstantin Nikitin:
Alexey Viktorov:

Thanks, but I don't understand it either. I'm not a programmer(

If it's not too much trouble, can you give me an example?

 
Did I understand you correctly?
index1=iBarShift(Symbol(), period01, time[i], false);
handle_ma1=iMA(Symbol(), period01, 5, 0, MethodMa, PriceMa)
CopyBuffer(handle_ma1,0,0,count,BufferMA1);
ma_buffer_slow[i]=BufferMA1[index1-1];
ma_buffer_fast[i]=BufferMA1[index1-5];
 
MakarFX:

Thank you, but I don't understand it either. I'm not a programmer(

If it's not too much trouble, could you give me an example?

#property strict

input ENUM_TIMEFRAMES    MAInpTimeFrame      = PERIOD_CURRENT;   // MA: TimeFram
input int                MAInpPeriodFast     = 13;               // MA: Period Fast
input int                MAInpPeriodSlow     = 25;               // MA: Period Slow
input ENUM_MA_METHOD     MAInpMethod         = MODE_SMMA;        // MA: Method
input ENUM_APPLIED_PRICE MAInpAppliedPrice   = PRICE_CLOSE;      // MA: Applied price

int       ExtHandleFast, ExtHandleSlow;
double    BufferFast[],  BufferSlow[];
//+------------------------------------------------------------------+
int OnInit(void)
{
     ArraySetAsSeries(BufferFast, true);
     ArraySetAsSeries(BufferSlow, true);
     ExtHandleFast = iMA(_Symbol, MAInpTimeFrame, MAInpPeriodFast, 0, MAInpMethod, MAInpAppliedPrice);
     ExtHandleSlow = iMA(_Symbol, MAInpTimeFrame, MAInpPeriodSlow, 0, MAInpMethod, MAInpAppliedPrice);
     if( ExtHandleFast == INVALID_HANDLE ||
         ExtHandleSlow == INVALID_HANDLE )
     {
          printf("Error creating \"MA\" indicator");
          ExpertRemove();
     }
     return(INIT_SUCCEEDED);
}

void OnTick(void)
{
     ZeroMemory(BufferFast);
     ZeroMemory(BufferSlow);
     
     if( CopyBuffer( ExtHandleFast, 0, 0, 2, BufferFast ) != 2 ||
         CopyBuffer( ExtHandleSlow, 0, 0, 2, BufferSlow ) != 2 )
          return;
     Comment( "BufferFast[0]: ", NormalizeDouble(BufferFast[0], _Digits), "\nBufferSlow[0]: ", NormalizeDouble(BufferSlow[0], _Digits),
              "\n=================\n",
              "BufferFast[1]: ", NormalizeDouble(BufferFast[1], _Digits), "\nBufferSlow[1]: ", NormalizeDouble(BufferSlow[1], _Digits) );
}
 
Konstantin Nikitin:
Thank you very much...that makes more sense)))
 

Greetings. Can you give me a hint?

When-do I come across that the broker has closed open positions and reopened them. I cannot find a description of this procedure.

What is it called? How often it is done?

 
Andrey Sokolov:

Greetings. Can you give me a hint?

When-do I come across a broker closing open positions and reopening them. I cannot find a description of this procedure.

What is it called? How often it is done?

Usually banks do it at 00:00.


For example, there is a transaction to buy 100,000 EUR/USD with a value date of 14.08.2019 when the actual settlement is due, and the trader did not close the transaction during the day. In order to postpone the value date (settlement in full), at the end of the day the Bank closes this transaction at the current rate with value date 14.08.2019, and concludes a similar purchase with new value date 15.08.2019, taking into account swap points that are present at the international exchange on that day.
 
Andrey Sokolov:

Greetings. Can you give me a hint?

When-do I come across that the broker has closed open positions and reopened them. I cannot find a description of this procedure.

What is it called? How often it is done?

Roll Over

 
Greetings. Let's say there is a situation: the program has been decompiled. In the code, at the very end, a __LINE__ macro was placed that returns the number of a line it is called from. Can we expect that the number of lines in the decompiled code will change and that the same macro will return a different line in the newly compiled hacked code? I am interested in this as a possible method of protection against decompilation. This line number will be checked by server via web request. At first I thought to read md5 sum of .ex4/.ex5 file, but I don't know how to do it without dll.
 
Dmitri Custurov:
Greetings. Let's say there is a situation: the program has been decompiled. In the code, at the very end, a __LINE__ macro was placed that returns the number of a line it is called from. Can we expect that the number of lines in the decompiled code will change and that the same macro will return a different line in the newly compiled hacked code? I am interested in this as a possible method of protection against decompilation. This line number will be checked by server via web request. At first I thought to read md5 sum of .ex4/.ex5 file, but I don't know how to do it without dll.

If your code has been decompiled, nothing prevents you from removing the macro and there will be no problem. But read more about decompiling capabilities. Even if we assume that it is possible, it costs as much as a dozen EAs. But it seems to me that this is a scam. Order and pay for decompilation and you will never see the site with this offer again.

 

Greetings. Can you advise me please?

Is it possible to set the colour of lines (not arrows) of orders in mt4?

Reason: