Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 228

 
artmedia70:

Made a sketch ..................................

prettier quickly
 
How do I set the averaging period in the custom indicator, for enumeration in the tester?
 
Forexman77:
How do I set the averaging period in the custom indicator, for enumeration in the tester?

https://docs.mql4.com/ru/indicators/iCustom


Instead of a dotted line, enter your parameters in the exact same order as in the indicator code.

 
gince:


So, what's the deal with the successful entrances only? What about the others? They're half as good as the successful ones. And do not forget that you drew the inputs not from where the signal will be. The signal appears three bars to the right of the rightmost fractal. And that's not the entry you drew.
 

Good afternoon.

Help me out, I'm confused.

There is a custom indicator.

It has two buffers,

If it is trending up, the indicator puts value in buffer 1 and colours the curve part blue.

If it is going down, the indicator put value in buffer 0 and change the curve part in red.

I need to know which way the trend is going, should I check the buffer value for EMPTY_VALUE or what is the value greater than zero or null ?

because if the value is zero then it is not EMPTY_VALUE

is it correct ?

double slopeUP=iCustom(NULL,0,"Slope Direction Line",period,method,price, 1, 1);
double slopeDN=iCustom(NULL,0,"Slope Direction Line",period,method,price,0, 1);

if (slopeUP != EMPTY_VALUE ) UpTrend=true;
if (slopeDN != EMPTY_VALUE ) DnTrend=true;
 

Hello.

I am facing this problem. I am setting variables for counting orders and making trade decisions on them. But MetaTrader is using them as global variables. As a result, when I run the Expert Advisor on two or more currency pairs. It makes decisions based on the total number of orders.

How to fix it? The task is to make decisions based on the number of orders only for its own pair.

code:

int BuyCount;                        // количество позиций 

//--------------------------Поиск ордеров------------------------------------------------
void FindOrders()  
{
RefreshRates();
for(int cnt = 0; cnt < OrdersTotal(); cnt ++)                  //Для всехоткрытых ордеров
 {
  OrderSelect (cnt, SELECT_BY_POS, MODE_TRADES);      // Выбираем со всего масива ордеров
  if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber)//Выбирам ордера експерта
   CommonProfit += OrderProfit()+OrderSwap();              // Подсчет совокупного профита
   if(OrderType()==OP_BUY)                                              
    {
     BuyCount++;                                                    // Количество ордеров
    }
}

//--------------------------Окончательное вычисление средних цен-------------------------
// позже в другой функции


bool SendOrder()
{
//-------------------------Вход в рынок-------------------------------------------------- 

if ( BuyCount==0 && SellCount==0 &&  BuyStopCount==0 && 
SellStopCount==0 && BuyLimitCount==0 && SellLimitCount==0)   // Если нет не каких ордеров
 {
 Lot=Lots;
 RefreshRates();
// ну и по тексту.
 

Good afternoon,

Question on strategy tester in mt4.

I download, install and update the terminal using my broker's links.

Tried to reinstall it several times. But the tester keeps freezing

after you hit start. Only sometimes all of a sudden it decides to work and

and runs the test as it should be. I've loaded the quotes. Nothing has changed.

Is it just me with Windows 7 or is the tester in the terminal not working?

 
Limita:


How to fix it? The task is to make decisions based on the number of orders only on its own pair.


I don't see any problems in this area, except to reset BuyCount to zero.
 
Limita:

Hello.

I am facing this problem. I am setting variables for calculating orders and making trade decisions on them. But MetaTrader is using them as global variables. As a result, when I run the Expert Advisor on two or more currency pairs. It makes decisions based on the total number of orders.

How to fix it? The task is to make decisions based on the number of orders only for its own pair.

code:


The staples are missing....

void FindOrders()  {
 RefreshRates();
 for(int cnt = 0; cnt < OrdersTotal(); cnt ++) {                    //Для всехоткрытых ордеров
  if(OrderSelect (cnt, SELECT_BY_POS, MODE_TRADES)){               // Выбираем со всего масива ордеров
   if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber){ //Выбирам ордера експерта
    CommonProfit += OrderProfit()+OrderSwap();                     // Подсчет совокупного профита
    if(OrderType()==OP_BUY){
     BuyCount++;                                                    // Количество ордеров
    }
   }
  }
 }  
}
 
splxgf:
I do not see problems in this area except to reset BuyCount to zero.


I am zeroing it just above. It is not indicated in the copied section.

But EAs from all pairs stack their orders there and work out their logic from the amount.

I cannot understand why my ***Count variables work as global.

The logics is working in the Strategy Tester.

It is working correctly on the demo. Two pairs and more and all together they all execute the same logic.

Reason: