[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 468

 
rlx:


Thank you!
 
demlin:
Thank you!


Perhaps to optimise the calculation we can check the order history differently

///// Есть некий массив торгуемых инстурментов
string symbolfotrade[] = {"EURUSD", .........}
///// Массив флагов
bool isTradedClosed[] = {false, .....}
bool isTradedOpen[]   = {false, .....}
//// Общая переменная
bool isAllTraded = false;
int  isTradedCount = 0;
int  HistRegistr = 0; //// 
start()
  {
   symbfotradeCount = ArraySize(symbolfotrade);
   вначале перебор закрытых ордеров. С конца в начало
   if (!isAllTraded)
     {
      Перебор закрытых ордеров  с начала в конец 
      int totalHistory = OrdersHistoryTotal();
      for(HistRegistr = HistRegistr; HistRegistr < totalHistory; HistRegistr++)
        {
          символ = OrderSymbol();
          Перебор массива торгуемых инструментов
          for(int i = 0; i < symbfotradeCount; i++)
            {
             if (isTradedClosed[i]) continue;
              Если (символ равен symbolfotrade[i]) то {isTradedClosed[i] = true; isTradedCount++; break}
            } 

        }
      Если isTradedCount==symbfotradeCount то  isAllTraded = true; ///// Чтобы не лазать по массивам
     }
I.e. check only newly closed orders. Thus, we will not try to check closed orders that have already been checked.
 
How much CPU power or RAM memory does the Expert Advisor need to be able to process the information and work on 52 pairs without any problems?
 
demlin:

How do you optimise the multicurrency parameters? In the MT4 tester there's no possibility to test several symbols at once... I'm thinking about the multicurrency one and so far I've come to the idea that I optimize parameters for each symbol separately and then transfer these parameters to my Expert Advisor in the multicurrency mode.

Am I moving in the right direction or it's easier in fact?)

In mql5 it all can be implemented in one EA for testing and trading, but for now I've decided to study mql4.

I've just thought that if you can't test some symbols at once, why bother with one EA if you can just set your own copy of each symbol chart and it will be the same. I would like to hear the opinions of the community members)))

 

Help for a newbie, I am writing an EA using functions from KimIV, at first there were errors from them I think I got rid of them with the help of comments in his branch, but now there are warnings, I cannot understand how to make everything run smoothly when compiling, please tell me what the warnings mean

Function......... is not referenced and will be removed...

 
ara66676:

Help for a newbie, I am writing an EA using functions from KimIV, at first there were errors from them I think I got rid of them with the help of comments in his branch, but now there are warnings, I cannot understand how to make everything run smoothly when compiling, please tell me what the warnings mean

Function ......... is not referenced and will be removed...


It means that this function is not used anywhere.)

Double-click on this message and MetaEditor will show you where it is. You can either delete it or comment out /* */.

 
tol64:


This means that this function is not used anywhere.))

Double-click on this message and MetaEditor will show you where it is. You can either delete it or comment out /* */.

Or do not touch it at all. When you will be remaking your Expert Advisor, it may come in handy.
Better yet, hook up all of Kim's functions at once in the form of libraries and use any of them you want.

All of Kim's functions in the form of plug-in libraries.
 
Def:

Can you please tell me how to open a position after a certain number of bars have passed after crossing, say, a MA?

For example, the price has closed behind the MA. I wait for the next bar and if it is the same colour and not a doji, I open a position.

It turns out that my opening candle is the third.

Example is shown in the attached file.

Thank you.


double mashka=iMA(.....,3);

if(Close[3]>Open[3]&&Close[3]>mashka&&mashka>Open[3]&&Your condition) ....

 
Guys, can you suggest a script which calculates the profit of open positions by a certain magik number, i.e. I want to place two grids of orders with opposite orders on one currency pair, and I can't deal with it manually.
 
zelek:
Guys, can you suggest a script which calculates the profit of open positions by a certain magik number, i.e. I want to place two grids of orders with opposite orders on one currency pair, and I can't deal with it manually.

double CurrentProfit() {
    double profit=0; 
    for (int i=OrdersTotal()-1; i>=0; i--){
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
        if(OrderSymbol()==Symbol()){
          if(OrderMagicNumber()==Magic) profit+=OrderProfit()+OrderSwap()+OrderCommission();
     } } }
return(profit);}