[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 306

 
borilunad:
unless, of course, the market itself is tweaking them for you, i.e. programmed with feedback

I have inserted on one side the collection of statistics, and on the other side the scanning by transmitted parameters (e.g. scanning by period of waving) in order to find the maximum by statistics, and rescanning periodically by an assigned hotkey. What other ways are there?

Speaking of humour.

#property indicator_chart_window
void start(){
   if(Bid>Ask) Alert("Это конец света");
   return;
}

- end of the world indicator.

 

Hi all!

I'm testing a strategy that involves opening a market order at the opening

ofevery five-minute candlestick.

Some orders the tester (MT-4 from Alpari) does not open and gives error 148.

This error is caused by exceeding the limit of orders opened at the same time.

I am not going to open every five minutes in real life.

Q: How can I remove any limit of open orders at the same time?

In the tester?

Thank you.

 

gyfto, you have misunderstood or I have not explained it well. We have an open position, we need to determine its open price, and when the bar closes above the open price, we exit.

 
borilunad:
Victor, how can you do it without externs, you need to debug in the tester, in the demo! Do you really write in such a way that you don't have to edit anything? I agree that stability is needed in your TS, but it's impossible not to tweak the parameters, unless, of course, the market tweaks them, i.e., you programmed them with feedback! Then you are already a great ace! Congratulations!


It's not that, it's just that with me, everything I write has almost no optimization parameters. I prefer exactly the strategies based on price action Induks I've been studying quietly, just to be able to work with them. But I am only interested in them to visualize what is happening.

And to turn the parameters into parameters, it's a market fit. And fitting it to a specific timeframe is a panacea???

 
cursed:

gyfto, you have misunderstood or I have not explained it well. We have an open position, we need to determine its open price, and when the bar closes above the open price, we exit.


Judging by the above, your condition is in the wrong place. You should initially arrange the search of orders and then, when the order is found, its parameter should be compared with something else.

Otherwise, it is compared to the close price of the bar outside the search, and therefore we have no result.

 
hoz:

... And then the parameters, it's a market fit. And fitting it to a specific timeframe is a panacea???

Yes, if that time frame is RealTime. :)
 
Zhunko:

Victor, you have a lot of variables in your function and none declared.

The compiler said:

variable not defined

A variable is not defined. There are 18 of them.


Vadim, I can see that they are not declared. I've been thinking about it for some time. You haven't declared any variables globally, just like me. But there are NO errors during compilation! I understood that all your variables are defined through function parameters in the inclusion, right?

 
tara:
Yes, if that stretch of time is RealTime. :)


It's not a fit, it's kind of an auto-fit :)
 
hoz:


Vadim, I can see that they are not declared. I've been thinking about it for a while. You haven't declared any variables globally, just like me. But there are NO errors when compiling! I understood that all your variables are defined through function parameters in the inclusion, right?

Any variable must first be declared before it can be used. You can have it in parameters, you can have it globally in the library.
 
<br / translate="no">

Judging by the design of the function, it is highly specialised. Why put it in the library? Especially since it will probably be called in a loop on every bar.

You were saying something about speed and optimization. You are creating a very slow code. In MQL4 you should not put functions in a loop. The fewer function calls in a loop, the faster the code runs.

So this is a function from the library:

//+-------------------------------------------------------------------------------------+
//| Получаем машку с заданными параметрами                                              |
//+-------------------------------------------------------------------------------------+
double GetMA(int typeOfMA)
{
   switch (typeOfMA)
   {
      case 1:      return (iMA(NULL, i_fastMATF, i_fastMAPeriod, i_fastMAShift, i_fastMAMethod, i_fastMAApplied, i_fastMAIndex));
      case 2:      return (iMA(NULL, i_slowMATF, i_slowMAPeriod, i_slowMAShift, i_slowMAMethod, i_slowMAApplied, i_slowMAIndex));
      case 3:      return (iMA(NULL, i_filtrMATF, i_filtrMAPeriod, i_filtrMAShift, i_filtrMAMethod, i_filtrMAApplied, i_filtrMAIndex));
   }
}

Vadim, about Functions in Loop. You mean what the switch operator returns? But it's not like I'm getting values over the whole number of loop variables. It's only comparing the type of the mask received (input variable of the function) and then calculating the value of the mask. It turns out that there are no additional calculations. I just select the type of the mask, and that's it! I want to understand what you mean by:

Zhunko:

In MQL4 you should not put functions in loops. The fewer function calls in the loop, the faster the code works.

Can I clarify?
Reason: