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

 
Roman Shiredchenko:

I've been there and done that. It's just that when the dough is loaded, you have to react quickly... by loading the profile with everything, but not by loading the sets sequentially after the robots on the CU. Yes so it seems - it works, when you load the profile, it loads with all the robot settings. Haven't tested it yet.

When you recompile a robot installed on a chart with the same name - the values of its input parameters don't go into the ones set in the code (ME) - I know it's an old one - just for info.

Although, when edits are made to external parameters - it seems that the settings set in the terminal after compiling code in ME.

When you make changes in external parameters Deinit() function is called, you can adjust it, so it doesn't recalculate all over again. But then you have to re-initialize the variables - you can write a function and put it into Deinit() - it will re-initialize your calculations with new input parameters. As for the simulation of the failure, I was also wondering what this failure looks like, and in order to configure the robot to failure you need to know the nature of the failure and then think about how to deal with it. So you're saying that in the past the robot might crash or get reset because of mt4, I don't know, that's why I'm curious.

 
Who knows if you can put in a macro loop, preferably 3 nested in each other, and whether this thing will rotate, just a macro is written through the slash and the loop through braces and I do not know how to look like such a record, if someone knows can show how the example?
 
Seric29:
Who knows if you can put in a macro loop, preferably 3 nested in each other, and whether this thing will rotate, just a macro is written through the slash and the loop through braces and I do not know how to look like such a record, if someone knows can show how the example?
#property strict

#define  FOR3(a,b,c,loop) for(int i=0; i<a; i++) \
for(int j=0; j<b; j++) \
for(int k=0; k<c; k++) \
{loop;} 

void OnStart()
  {
   int x=0;
   FOR3(2,3,4,Print(x++));
  }
//+------------------------------------------------------------------
 
Igor Makanu:

Great. Thanks.

 
How do I connect Websocket to MT5 using Mql5?
 
Igor Makanu:

I know what users are asking for, make sure the profit for today, for yesterday, for the week appear on the screen, and even draw a virtual take profit line, and if I run a template with the same indicators on a chart, then everything slows down for me!

I've seen how you can wreck the terminal doing something it does not need for trading

;)

I can see that.

There are enough geeks with their wonders, that's good to know! On the other hand, you too have something to work on and with... :-)

 
Seric29:

When you make changes to external parameters the Deinit() function is called, you can adjust it so it doesn't recalculate everything, but then you have to re-initialize the variables, so you can write a function and put it into Deinit() and it will re-initialize your calculations with new input parameters. As for the simulation of the failure, I also became interested in what this failure looks like, and to set up a robot for failure you need to know the nature of the failure and then think how to deal with it. So you're saying that in the past the robot might crash or get confused by mt4, I don't know, that's why I am curious.

it's all crutches... I'm not interested. You don't have to simulate failures - they may happen by themselves... moreover 4 is not supported... :-)

Intervene promptly and respond to trade recovery - that's all.

 
Roman Shiredchenko:

yes that's understandable.

I have enough weirdos with their miracles, that's good to know! On the other hand you too have something to work on and with... :-)

yes, by the way, your problem - to restore the terminal after the crash, probably can be solved more easily: the terminal folder has configuration files, and they store the last state of the terminal configuration, including charts, you can just compare which files are responsible for it, they are not a lot 2 or three, when I looked and just need to make an ordinary command-line binary that will backup these files into the folder terminal

The question may be relevant to you but the problem may be different when you try to open a topic may come up and solve it the best way for you to solve it

 
Igor Makanu:

yes, by the way, your problem - to restore the terminal after the crash, probably can be solved more easily: the terminal folder has configuration files, and they store the last state of the terminal configuration, including charts, you can simply compare which files are responsible for it, they are not many 2 or three, when I looked and just need to make an ordinary command-line binary that will backup these files into the folder of the terminal

I'd say it's the easiest way to solve the problem and it may be relevant to you, try to open a topic may come up and solve the problem however you feel comfortable with it

Thanks.

:-) It's simpler here.

It's just if everything "crashed", I don't know - my terminal may not crash too often, but if it crashes, I just don't want to manually manage the open orders, not to manipulate scripts - a la closing all or for a particular magician, not to connect there any previously saved templates, especially sets with previously saved working exponents parameters not to suddenly load them into robots ... now.

For example, like in a nightmare, some serious money was loaded into trades, exponents entered into deals of significant amounts...

When I turn off my computer in normal mode, close it, restart the computer, restart the terminal - there are POSITIONS in the market, but the exponents who trade (there was a smiley face on top right before the restart) - no in terms of their smiley face on top right...

Actions? Elementary you load the PROFILE previously saved - and that's it. Every robot trades - that's all. Problem solved.

Does it work like this? I'll check and write.

 
How do I set the time filter (by hour) for EA trading? Will the following option work:

if(TimeHour(TimeCurrent())<23 & TimeHour(TimeCurrent())>1){
        //торгуем
}
Reason: