Questions from Beginners MQL5 MT5 MetaTrader 5 - page 193

 
barabashkakvn:
barDown - incorrect value (i.e. there is no index equal to barDown in the MACD array). Check the algorithm and look at the "Experts" tab in the terminal - error messages appear in this tab.
Yep so it is, all read all look. Everything's not running, I'm going to get wise to the date-time. Thank you very much.
 
Hello, help me understand, signed up for a signal in the history of the signal reflected transactions at 0.01 lots, but bring a profit of 1.00 dollars, I also open transactions for 0.01 lots in the dollar account, but bring profit of 0.10 dollars, how to fix that, too, bring the too 1.00 ? I would like to correct this problem in my account. Thank you!
 
zedmen:
Hello, help me understand, signed up for a signal in the history of the signal reflected transactions for 0.01 lots, but bring a profit of 1.00 dollars, I also open transactions for 0.01 lots in the dollar account, but bring profit of 0.10 dollars, how to fix that, too, bring the too 1.00 ? I will try to correct it so it may return 1.00 too. Thank you!
Compare yours and his leverage.
 
artmedia70:

I would advise you to make a single template, which already has all the necessary steps for initialisation, connection, collection of always needed data, etc...

An unexpected idea came to mind - load a template, rename it and write in it only what is relevant to that particular idea. And those functions that you always use, in any code, returning the same data in any situation - put them in classes. And everything will fall into place at once. You can also structure directories. In \experts\ create (I have it that way) a folder called Orders, where I also put all the files belonging to different customers in separate folders, have a folder named Ideas, Tests, etc.

That way you'll get your own things in order.

Thank you. :) I'll have to give it a try when I'm in the mood. Hopefully, I'll get my hands on this topic someday after all... For example, if/when the byproduct of my creation will get so big that it will make no sense to keep all my work in one bottle ^^.

 
C-4:
Unfortunately, even having formally studied OOP you will not be able to build an OOP-program. Here you need rather to enter into the philosophy of this approach, and this is the next level after obtaining formal knowledge. So it turns out, do you really need it? But if you ask questions how to do it better, it means that you feel that the way you've chosen is not optimal. In any case, the choice is yours.

Well, I don't have the goal of building an OOP program one way or another. So philosophy kind of goes a little bit to the woods. :) But it's possible to try to adapt separate elements of OOP where they really make sense and make handling of code more convenient, instead of just adding a dozen of redundant and weakly useful constructions... Here, let's say, on a cursory inspection of a couple of articles such a construct seemed potentially useful for cutting down the number of global variables:

class CSomeClass {
   public:
      int Val;
      void Set(int v);
      int Get(){return(Val);}
};

CSomeClass::Set(int v){
   Val = v;
}

//-------------
CSomeClass RandomName;
RandomName.Set(1);
Print(RandomName.Get());

I'll try to adapt it to some of the most widely used functions for a start. And whether or not this will result in some kind of OOP is not a matter of principle.

 
Hello. Who can give me the link to the indicator handler (expert) where indicator handlers of different periods are applied. For example on the time frame H1 handle D1 etc.. When I look at the chart, I don't know what to do with it. Thanks
 
Vikon:
Hello. Who can give me the link to the indicator handler (expert) where indicator handlers of different periods are applied. For example on the time frame H1 handle D1 etc.. When I look at the chart, I don't know if I'll get it right or not. Thanks
Check out the help for the iMA technical indicator. In the help there is an example with a handle. In the example the handle is for one period, but if you add a couple of lines, it will be for several periods as well
Документация по MQL5: Технические индикаторы / iMA
Документация по MQL5: Технические индикаторы / iMA
  • www.mql5.com
Технические индикаторы / iMA - Документация по MQL5
 
Tell me, when a real signal is connected, does it open orders by itself and close them by itself, or do you have to close them?
 
valek131:
Tell me, when a real signal is connected, does it open orders by itself and close them by itself, or do I have to close it?
It opens and closes automatically. When the signals are switched on, it is better not to use your hands, as it may become unsynchronised.
 
Thank you!
Reason: