[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 666

 
If only it was Friday the 13th :-)
 
chief2000:
If only it was Friday the 13th :-)
Hurriedly...
 

-Ns rnj &

-cvthnm

-ye b xnj &

-ye b dc`,e-uf-uf

 
IgorM:

nice technical indicator https://www.mql5.com/ru/code/9397

dollar index, please help me instead of drawing two arithmetic averages: ExtMapBuffer2[i] and ExtMapBuffer3[i] to draw one average and one exponential average

Here you go Igor :)
Files:
 
Can you please advise how easy it is to create an object and specify the bar time which is located to the right of the bar with an index of zero as the second time coordinate... Too bad the minus bars are not supported... ))
 
KRUSHNY:
Please advise how to specify the time of the bar on the right side of the bar with index zero as the second time coordinate when creating an object... Too bad minus bars are not supported... ))

There is no such bar. It doesn't exist yet. But there is a way out - to declare a variable of the datetime type, enter there the zero bar opening time and add the number of seconds of one candle of the current timeframe to it.
 
ToLik_SRGV:
Here you go, Igor :)


OK. THANKS A LOT!

I tried to attach function iMAOnArray() - but nothing, it's a weird situation with these built-in functions of calculation using passed parameter - array, not bars - I've tried to make any of these functions work, but there are also iCCIOnArray() and .....

 
IgorM:


OK. THANKS!

I tried to attach function iMAOnArray() - but nothing, in general, some kind of mysterious situation with these built-in functions of calculation by passed parameter - an array, not by bars - as long as I twisted none of these functions work, but there are also iCCIOnArray() and .....


Show me how you did it.
 

Maybe someone had a problem using two EAs on one chart.

The point is that one Expert Advisor (it is New_Platinum) draws lines on the chart from the beginning of the trading day, but starts trading only at 8 PM (terminal time). I don't know its algorithm (ex4 file), decompiling it does not provide any information.

The second Expert Advisor that trades on lines (there are a few of them and in principle any of them can be used).

However... they do not get along on one chart, and I cannot make crossing of two EAs. It is too early to order the creation of a new EA, because the assumed strategy is rather "raw".

Maybe there is a way to draw lines on two charts at once? Or there are some other options?

This Expert Advisor

 

Friends, I can't understand why it doesn't work:

double Loss=0;                                        // Последнее значение убытка
         int    i, k=OrdersTotal(), OrdTicket=-1;

         for (i=k-1; i>=0; i--) {                              // Цикл по всем ордерам терминала
            if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
               if (OrderMagicNumber()!=5100){ 
                  if ((OrderProfit()+OrderSwap()<0)) {            // Если профит позиции меньше 0
                     if (Loss>OrderProfit()+OrderSwap()) {        // Если последнее значение убытка больше убытка позиции  
                        Loss=OrderProfit()+OrderSwap();           // Значит тут убыток больше, запоминаем как последнее
                        OrdTicket=i;                              // Запоминаем номер убыточной позиции
                     }
                  }
               }  
            }
         }

If a position with magic 5100 is found in the loop, the loop must go to a new iteration:

if (OrderMagicNumber()!=5100) 

... But that does not happen and the selected position with magic 5100 starts participating in further calculations as the most unprofitable position...

This is the locking position... And then another locking position is set on it ...

Help me to understand where the dog is hidden...

Reason: