[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 967

 
ikatsko:
You need a "New Order" function like "New Bar". The function should have TRUE value only for one tick after the moment when the order was opened. I.e., at the moment when the number of open orders has changed to the higher side. Please help us to

This is how you can track the dealer's changes in StopLevel on each new tick. Use the same principle to track your orders.

В инит:
//---------------------------------------------------
int init()
{
   Level_old =MarketInfo(Symbol(), MODE_STOPLEVEL);
//.............. дальнейший код инит .................
   return;
}
//---------------------------------------------------
В старт:
//---------------------------------------------------
int start()
{
   Level_new=MarketInfo(Symbol(),MODE_STOPLEVEL );    // Последнее значение уровня установки стопов
   if (Level_old!=Level_new)  {                       // Новое не равно старому, значит изменились условия
      Level_old=Level_new;                            // Новое запишем в "старое" для проверки на след. тике
// ............. действия, если новый уровень .......

   }
//.............. дальнейший код старт.................
   return;
}
 
IgorM:


there is such a problem - i had this problem too, if the Expert Advisor makes many trades per year - perhaps too much data is stored for the output of the final result or maybe the indicator buffers eat the memory

i have seen - i don't know, bear with me - for a general picture, the test is for 10 years, and it's better to optimize for one year and then make a selection of the best parameters

And about memory. The memory of 4 GB is not enough? Especially when testing the strategy - I looked - it is used only 50-60%.
 
volshebnik:
And about memory. Is 4GB of memory not enough? Especially when testing the strategy - I looked - it is used only 50-60%.
I understand that the code shown earlier is a part of it, maybe there are slow spots in the other part too
 
volshebnik:
And about memory. Is 4 GB of memory not enough? Moreover, when testing the strategy - I looked - it is used only 50-60%.


well, we do not know how much MT4 can use, and 4Gb cannot be addressed in Win32, you need Win64, and to Win64 you need 64-bit applications, MT5 has a 64-bit terminal, MT4 is not even aware of it

SZZ: don't over optimise - you will get extra confidence in your code. and it's not certain that the market will want to adjust to your optimum parameters ;)

 
Got it... Got it wrong with real-type comparison at zero value...
 
artmedia70:

This is how you can track the dealer's changes in StopLevel on each new tick. Use the same principle to track your orders.


Thanks for the tip! Indeed the lines:

 if (Level_old!=Level_new)  {                       // Новое не равно старому, значит изменились условия
      Level_old=Level_new;  

form the "front", i.e. the change of the current state in relation to the previous one. The old_order parameter is needed. Thanks

 
ikatsko:

Thanks for the tip! Indeed the lines:

form the "front", i.e. the change of the current state in relation to the previous one. The old_order parameter is needed. Thanks

You're welcome - it was also suggested by CK...
 
Techno:
I understand the code shown earlier is part of it, maybe there are slow spots in the other part too
This part counts on ticks. All other calculations are only at the beginning of each hourly candle. It was very slow on the chart and the incomplete loop mentioned by Igor. Maybe there are slow spots, there is a chart there too - candlestick numbers are indicated - this chart is undesirable to remove - it will be more difficult to analyse.
 
IgorM:


well, we do not know how much MT4 can use, and 4Gb cannot be addressed in Win32, you need Win64, and Win64 need 64-bit applications, MT5 has a 64-bit terminal, MT4 is not even aware of it

ZS: don't overdo it with optimization - you'll get extra confidence in your code. and it's not certain that the market will want to adjust to your optimal parameters ;)

Yes Igor, 32bit OS uses max 3.14 GB. I am running 64bit Windows 7. The MT4 terminal is a 32 bit application, but the 64 bit Windows 7 has the ability to support 32 bit applications. Excessive reassurance.... Trying with reassurance ))
 

Please advise:

we have transferred the data of the monthly TF to the daily TF

ArrayCopySeries(TimeArray,MODE_TIME ,Symbol(),PERIOD_MN1); 

limit=Bars-counted_bars;

for(i=0,y=0;i<limit;i++)

if (Time[i]<TimeArray[y]) y++; 
{
        Month_P[i] = iMA(NULL, PERIOD_MN1, 3, 0, MODE_SMA, PRICE_TYPICAL, y+1);
}
How do we compare data of the month chart? I suppose we should take Month_P [i] and Month_P [i+N], where N is the number of bars in the daily timeframe that will surely bring us to the previous monthly bar. And how exactly to determine this number N?
Reason: