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

 
Artyom Trishkin:

Can you give me an indicator? What is shown in the data window (Ctrl+D) when you move the mouse over the indicator bars? How many buffers are there and what values are in them?


No problem. These are indicators from Symphony trading strategy. Interesting TS, but it is too fussy to work with five-minute indicators, I do not always have time. I wanted to try to automate it and see what would happen. But as I'm purely an amateur at programming, I'm stuck. Basically, I came across an Expert Advisor for this strategy somewhere. But it is very tricky, I can not run it in the Strategy Tester (maybe because it takes information from the older TF - for M5 and H1) and I can not say when I tried it on demo, but one deal was opened, but with error according to TS. I wanted to simplify it and write it my way, but it didn't work. I can reset the original EA (though not quite, because I had to correct the errors during compilation). as well as his version (if it's not too much nerve on my part).

 

Good afternoon!

I have a part of code in my Expert Advisor which works by OnTimer() EventSetMillisecondTimer(50) and I need to make another part by EventSetMillisecondTimer(2000). Any suggestions on how to implement?

 
Youri Lazurenko:

No problem. These are the indicators from the Symphony trading strategy. Interesting TS, but it's hectic to work with five minutes, I don't always have time. I wanted to try to automate it and see what would happen. But as I'm purely an amateur at programming, I'm stuck. Basically, I came across an Expert Advisor for this strategy somewhere. But it is very tricky, I can not run it in the Strategy Tester (maybe because it takes information from the older TF - for M5 and H1) and I can not say when I tried it on demo, but one deal was opened, but with error according to TS. I wanted to simplify it and write it in my own way, but it didn't work. I can throw the original EA (though not entirely, because I had to correct the errors during compilation). as well as its version (if it's not too much gall from my part).

Impertinence is a blessing in disguise, of course ;) Just send us the indicator, so that we can see it and tell us how to get data from it. The rest is up to you. What will not work - ask here, and people will help you. This is better for you than having someone do everything for you and you will remain in the dark.

 
Nauris Zukas:

Good afternoon!

I have a part of code in my Expert Advisor which works by OnTimer() EventSetMillisecondTimer(50) and I need to make another part by EventSetMillisecondTimer(2000). Any suggestions on how to implement?

On one program - one timer. Make one timer and two counters in it - one for each delay.

 
Artyom Trishkin:

One timer per program. Make one timer and two counters in it - one for each delay.

Thank you, but I haven't understood the implementation of how to do it. At the moment it looks like this to me in EA. Can you show me how to add a second counter here?

int OnInit()
  {
   EventSetMillisecondTimer(50);
   return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
  {
   EventKillTimer();
  }

void OnTimer()
  {
  }
 
Artyom Trishkin:

You know, you can always be cheeky.) Just send us the indicator to have a look at it and tell us how to get data from it. The rest is up to you. What will not work - ask here, and people will help you. This is better for you than having someone do everything for you and you will remain in the dark.

Thank you very much. To be honest, I would certainly be more interested in doing everything myself. I have got an interesting hobby in my old age, but my wife scolds me for not leaving the computer. Please advise how to get the data from the indicator.

 
Youri Lazurenko:

Thank you very much. To be honest, I would certainly be more interested in doing everything myself. I have got an interesting hobby in my old age, but my wife scolds me for not leaving the computer. And with the receipt of data from the indicator, please advise.

Symphonie_Sentiment_Indikator_v3.0.mq4 - decompiled.

I have deleted the attached files in the zip archive, because we do not allow to distribute and work with decompiles here. The person who uploaded those files will be banned. Up to delete his account (it all depends on persistence of user in desire to get a ban). For the first time - a warning.

I understand that you might not know about it (since it's your hobby and your wife is cursing), but do please read the text of this indicator - the variables were generated by decompiler and have no semantic meaning in their names - it can be seen with the naked eye.

 
Artyom Trishkin:

Symphonie_Sentiment_Indikator_v3.0.mq4 - decompiled.

I deleted the attached zip-archive files, because distributing and working with decompiles is forbidden here. A person who uploaded such files will be banned. Up to delete his account (it all depends on persistence of user in desire to get a ban). For the first time - a warning.

I understand that you might not know about it (since it's your hobby and your wife is cursing), but do please read the text of this indicator - the variables were generated by decompiler and have no semantic meaning in their names - it is clear to the naked eye.

I'm sorry, but.

Firstly, I even did not suspect that this is some kind of left file, because I downloaded it from a normal site.

Secondly, it is for you, a professional can see with unaided eye. For me - a file as a file, even suspicions did not creep in. I apologize again, I myself was upset by this fact. Good luck with that.

 
Artyom Trishkin:

One timer per program. Make one timer and two counters in it - one for each delay.

I have so far done this, but if you suggested otherwise, correct me:

int Timer1=50;
int Timer2=2000;
int countTimer1=0;

int OnInit()
  {
   EventSetMillisecondTimer(Timer1);
   return(INIT_SUCCEEDED);
  }

void OnDeinit(const int reason)
  {
   EventKillTimer();
  }

void OnTimer()
  {
   countTimer1++;
   if(countTimer1>=MathFloor(Timer2/Timer1))
     {
      Print(" TimeCurrent()= ",TimeCurrent()," countTimer1= ",countTimer1);
      countTimer1=0;
     }
  }
 
Artyom Trishkin:

Symphonie_Sentiment_Indikator_v3.0.mq4 - decompiled.

I deleted attached files from the zip-archive, because distributing and working with decompilation is forbidden here. The person who uploaded such files will be banned. Up to delete his account (it all depends on persistence of user in desire to get a ban). For the first time - a warning.

I understand that you might not know about it (since it's your hobby and your wife is cursing), but do please read the text of this indicator - the variables were generated by decompiler and have no semantic meaning in their names - it is clear to the naked eye.

Don't think I'm being cheeky, but I still want to understand it. I downloaded these indicators from my strategy author's page at Forex Factor (free access, whole package, 2012). I compared them to mine and see no difference. Will the decompiler be published there too. If you can, or need to, I can attach the files (I will not immediately so as not to break the taboo).

Reason: