Questions from Beginners MQL5 MT5 MetaTrader 5 - page 651

 
long1:
Well, let's say the robot opens positions when everything happens on my computer... If I decide to move all my trades to a rented server ... just to turn off the PC and go to sleep)))) will my open positions and signals be transferred or the robot will start trading there from scratch?

It is easier to put the robot on the UPU and let it work there, and watch it from the computer. You have to pay by the month anyway, not by the hour.

If so, the robot will continue to trade there in the same style as it did not trade on UPU, but provided that the robot code does not work with global variables and it is not afraid of resetting the terminal in the process, otherwise there may be problems.

 
Vitaly Muzichenko:

It is easier to put the robot on the UPU and let it work there, and watch it from the computer. You have to pay by the month anyway, not by the hour.

If that's how you want it, then the robot will continue to trade there in the same style as it did not trade on UPU, but provided that the robot code does not work with global variables and it is not afraid of restarting the terminal in the process, otherwise there may be problems.

cp got it)
 
Hello 2016.10.25_18:11 am MSC. A request to the moderators. I can't delete my CLose.mqh file program code . Just in case. So that no changes in the market will follow. As long as I'm not making any money yet. Otherwise I'll get tired of writing the next EA. Besides, my question has not been answered. I have fixed the exit outside the array myself. I still have the incorrect start index in the tester's log. But it has not prevented the Expert Advisor from closing trades. If you delete my file, I will thank you for it. That is all for now. 18:21 MSC.
 
Николай Никитюк:
Hello 2016.10.25_18:11 am MSC. A request to the moderators. I can't delete my CLose.mqh file program code . Just in case. So that no changes in the market will follow. As long as I'm not making any money yet. Otherwise I'll get tired of writing the next EA. Besides, my question has not been answered. I have fixed the exit outside the array myself. I still have the incorrect start index in the tester's log. But it has not prevented the Expert Advisor from closing trades. If you delete my file, I will thank you for it. That is all for now. 18:21 MSC.
You need to write to the specific moderator who has your"CLose.mqh" code installed in the terminal. The second person has no access to the terminal or the code.
 
Alexey Kozitsyn:
6. I was also confused by "this function is beyond start"?

Need to add a point by condition to an old indicator written when everything was Start().

Alexey Kozitsyn:It is not sure that you can find the fractal before the 10th candle. Or you can set it to 100, for example;

Beyond the tenth bar the fractal is not interesting.

Alexey Kozitsyn:. If we find a fractal on the candlestick number - we return the fractal price which will be equal to the candlestick's minimum price.

The variable price_dnf always equals zero so I left Low with the bar index where the fractal was found.

As a result, there is a fractal but not a point.

What is wrong?

if( High[i+1]==Low[isFractalDn()])
       {
       ExtMapBuffer3[i]=Low[i+1];
       }
//======
//за пределами Start()

int isFractalDn()
{

for(int i=3; i <= 10; i++)

{
if(iFractals(NULL, 0, MODE_LOWER, i)!= EMPTY_VALUE) return(i);
price_dnf=iFractals(NULL, 0, MODE_LOWER, i);

}
return(-1);
}
 
mila.com:

Need to add a point by condition to an old indicator written when everything was Start().

Beyond the tenth bar the fractal is no longer interesting.


The variable price_dnf always equals zero, so I left Low with index of the bar where the fractal was found.

As a result, the fractal is not even close to it but it sets a point.

What is wrong?

if( High[i+1]==Low[isFractalDn()])
       {
       ExtMapBuffer3[i]=Low[i+1];
       }
//======
//за пределами Start()

int isFractalDn()
{

for(int i=3; i <= 10; i++)

{
if(iFractals(NULL, 0, MODE_LOWER, i)!= EMPTY_VALUE) return(i);
price_dnf=iFractals(NULL, 0, MODE_LOWER, i);

}
return(-1);
}
//+------------------------------------------------------------------+
//|                                                      fraktal.mq4 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
double price_dnf;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   Print(isFractalDn());
   Print(price_dnf);
  }
//+------------------------------------------------------------------+
int isFractalDn()
  {
   for(int i=0; i<=30; i++)
     {
      if(iFractals(NULL,0,MODE_LOWER,i)!=0.0)
        {
         price_dnf=iFractals(NULL,0,MODE_LOWER,i);
         return(i);
         break;
        }
     }
   return(-1);
  }
//+------------------------------------------------------------------+
So, the first fractal
 
pako:
//+------------------------------------------------------------------+
//|                                                      fraktal.mq4 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
double price_dnf;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   Print(isFractalDn());
   Print(price_dnf);
  }
//+------------------------------------------------------------------+
int isFractalDn()
  {
   for(int i=0; i<=30; i++)
     {
      if(iFractals(NULL,0,MODE_LOWER,i)!=0.0)
        {
         price_dnf=iFractals(NULL,0,MODE_LOWER,i);
         return(i);
         break;
        }
     }
   return(-1);
  }
//+------------------------------------------------------------------+
So, the first fractal

Thank you, but there is still no result.

After all, it is essentially the same condition.

if( High[i+1]==Low[isFractalDn()])

if( High[i+1]==price_dnf)

?
 
mila.com:

Thank you, but there is still no result.

After all, it is essentially the same condition.

if( High[i+1]==Low[isFractalDn()])

if( High[i+1]==price_dnf)

Is it correct, according to this condition, the indicator must set points on the entire history?

You do realise that it may be a rare occurrence for the maximum of one candle to coincide with the minimum of another?

And yes, of course, not on the whole story. Only on the one formed at the moment of the indicator's work. At least it seems that way, based on the piece of code you cited.

 
A simple question, but still... I rifled through the Documentation, but could not find a clear answer.
Can structures have functions (methods), or can only classes have functions (methods)? I always thought only the second part of the sentence was true, but I began to have vague suspicions about the first part.
 
BlackTomcat:
A simple question, but still... I searched through the Documentation but failed to find a clear answer.
Can structures have functions (methods), or can only classes have functions (methods)? I always thought only the second part of the sentence was true, but I began to have vague suspicions about the first part.
Structures may have methods and functions.
Reason: