Errors, bugs, questions - page 1018

 
A100:
Doesn't work at non-trading times. What's in the way?

Are you sure about the parameters?

Both examples look wrong:

ChartGetInteger( chart_ID, CHART_BRING_TO_TOP, 0, true )  - последний параметр должен быть long&, а не bool
ChartGetInteger( chart_ID, CHART_BRING_TO_TOP, true )     - последний параметр должен быть номер подокна, а не bool

Looks like confused with ChartSetInteger?

 
Renat:

Are you sure about the parameters?

Both examples look wrong:

Looks like confused with ChartSetInteger?

Yes, sorry, mistranslated from my code - does not work at non-trading time
bool bringToTop = true;
ChartSetInteger( chart_ID, CHART_BRING_TO_TOP, 0, bringToTop ) 
ChartSetInteger( chart_ID, CHART_BRING_TO_TOP, true )
//этим хотел показать что пробовал оба варианта
ChartGetInteger and should not work, because CHART_BRING_TO_TOP- write only. I will correct application to ServiceDesk
 

I am doing a retracement (with a pause of 5000) of all charts:

a) (yesterday) non-trading day - no reaction - when unloading the script goes to the 1st chart, even if the script was not started from it

b) now - everything works correctly

If necessary - I will attach the code - a simple loop - GetLastError - no errors

 

I don't know how important this is, but

ChartSetInteger( chart_ID, CHART_BRING_TO_TOP, true )
ChartSetInteger( chart_ID, CHART_BRING_TO_TOP, false )
now (at trading time) work the same way - the chart is placed on top of the others
 

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

Renat, 2013.07.22 09:22

Are you sure about the parameters?

Both examples look wrong:

ChartGetInteger( chart_ID, CHART_BRING_TO_TOP, 0, true )  - последний параметр должен быть long&, а не bool
ChartGetInteger( chart_ID, CHART_BRING_TO_TOP, true )     - последний параметр должен быть номер подокна, а не bool

Looks like confused with ChartSetInteger?

If my mistake is confirmed and the changes will be made - I also ask to consider making CHART_BRING_TO_TOP not only write only, but also read as you have written through ChartGetInteger.
long ChartID()
can not help in this case, since the latter strictly speaking does not return the current selection, but the one from which the script is running. And in the process of running the script, the user can change the current one.
 
MetaDriver:

Only lots and lots of .mqh and one executable .mq5, nothing else.

Let me add. The advantage of the absolute, modular approach in comparison with the relative one, is that in the case of
Print( __FUNCTION__, __FILE__ )

If there is only one .ex5 module, it is not clear which one to look for among the many .mqh modules, which makes a big difference given the large size of the code.

At the same time, please ask the Developers:

Is it possible to introduce an additional predefined macrosubstitution__MODULE__ analogous to __FILE__ - only without extension .mq5?

This is needed to compile an expression of the following form: __MODULE__::f()

This is often used during development to change filenames and transfer functions from module to module

 
A100:
I will add. The advantage of the absolute modular approach, as compared to the relative one, is that when it emerges from

it is not clear in which module to look for the function, and if there is only one .ex5, it is not clear in which .mqh, which makes a big difference when the code is large.

You are delirious, brother.

h1.mqh :

string GetH1()
{
  return  "Файл: "+__FILE__+"   Функция: "+__FUNCTION__;
}

h2.mqh :

string GetH2()
{
  return  "Файл: "+__FILE__+"   Функция: "+__FUNCTION__;
}

PrintTest, mq5 :

#include "h1.mqh"
#include "h2.mqh"

void OnStart()
  {
   Print( "Файл: "+__FILE__+"   Функция: "+__FUNCTION__);
   Print(GetH1());
   Print(GetH2());
  }
//+------------------------------------------------------------------+

Result:

2013.07.22 14:40:17 PrintTest (EURUSD,M1) File: h2.mqh Function: GetH2
2013.07.22 14:40:17 PrintTest (EURUSD,M1) File: h1.mqh Function: GetH1
2013.07.22 14:40:17 PrintTest (EURUSD,M1) File: PrintTest.mq5 Function : OnStart

---

Please make a conclusion for yourself: "Before you develop grandiose nested defines, it's a good idea to understand how the preprocessor actually works".

Good luck to you!

Files:
h1.mqh  1 kb
h2.mqh  1 kb
PrintTest.mq5  1 kb
 
MetaDriver:

Please conclude: "Before designing grandiose, multi-nested defines, it's a good idea to understand how the preprocessor actually works.

Devote some time and effort to this. You need to learn more about the building site and material properties to build strong and comfortable structures.

Your mind is very sophisticated and thoughtful, but by feeding your own hasty conclusions into its input, you are doomed to often come to the wrong decisions.

 
MetaDriver:

Your mind is very sophisticated and thoughtful, but by feeding it your own hasty conclusions, you are doomed to often come to the wrong decisions.

May I join your Padawan? :)
 
TheXpert:
May I join your Padawan? :)

Is there any money? :))

--

But let's not joke:

It's a pity that there are almost no threads on this forum devoted to sensible structuring of programs. A harmonious structure is the key to trouble-free development of large systems.

How to encourage people to discuss such things?

Reason: