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

 
The opening is sorted out. The order opens. But it does not close them on the current candle, either when it reaches the moving average or on trailing stop. It closes on the current candle only at stop loss. What is wrong with my code in closing.
 if(OrderType()==OP_BUY)   // длинная позиция открыта
           {
           if(NormalizeDouble (MathAbs(MA_0-Bid),Digits)<Point)
                {
                 OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); 
                 return(0); 
                }
            // трейлинг-стоп для длинной позиции
            if(TrailingStop>0)  
              {                 
               if(Bid-OrderOpenPrice()>Point*TrailingStop)
                 {
                  if(OrderStopLoss()<Bid-Point*TrailingStop)
                    {
                     OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
                     return(0);
                    }
                 }
              }
           }
         else 
           {
           if(NormalizeDouble (MathAbs(MA_0-Ask),Digits)<Point)
              {
               OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); 
               return(0); 
              }
            // трейлинг-стоп для короткой позиции
            if(TrailingStop>0)  
              {                 
               if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
                 {
                  if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
                    {
                     OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
                     return(0);
                    }
                 }
              }
           }
        }
     }
   return(0);
  }

When I cross out when current price is equal to moving average and trailing stop. I made trailing stop small on purpose but it still does not work.
if(NormalizeDouble (MathAbs(MA_0-Bid),Digits)<Point)
 
people ! explain to a newbie how to set the H3 timeframe and put a rsi 12 and a 3 period on it (display in one window)
 
spongebob >>:
народ ! объясните новичку как установить таймфрэйм Н3 и поставит на него rsi 12 и 3 периодный (отображение в одном окне)

Look for the PeriodConverter script, open an offline chart and put the rsi on it.

 
splxgf >>:

Ищи скрипт PeriodConverter, открывай оффлайновый график и вешай на него rsi.


Even though I don't understand it, thank you very much !!!

 
Hello!
Can you suggest an indicator to draw a shaded area on the chart between two SMA(1) plotted by high & low.
Like this (shaded in point):
 
Gentlemen help me why does my array size say 4319???


#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 White
doubleMapBuffer1[];
int init()
{
IndicatorShortName("eurchf_vasay");
SetIndexStyle(0,DRAW_LINE);

SetIndexBuffer(0,ExtMapBuffer1);


return(0);
}
int start()
{
int i;

i=10;
while(i>=0)
{

ExtMapBuffer1[i]=1;
i--;
}
Print(ArraySize(ExtMapBuffer1));
return(0);
}
 
Hi all, I'm optimising an EA, but after optimisation the results are empty. I have ticked all the boxes on the parameter to be tested, all the other parameters are set, I have tried with and without genetic algorithm, to no avail. All the quotes have been downloaded. In short, I set everything as it was described many times on the forum in numerous articles. It makes 54 passes and the results are empty. The last line of the optimization log, after three lines about EA loading (ok), optimization start and its stopping, says the following:
2010.04.29 22:41:04 There were 54 passes done during optimization, 54 results have been discarded as insignificant
I was optimizing different parameters before and it worked. Now, when I need it especially it doesn't work...
I'm asking everyone who knows anything about the problem to come forward, just crying out for help!!!
 
spongebob >>:


хоть ничего и не понял все равно спасибо вам большое !!!

try again https://www.mql5.com/ru/code/7935

 
artmedia70 >>:
Всем привет! Оптимизирую советника, а после оптимизации в результатах пусто. Галочки установил где нужно на тестируемом параметре, все остальные параметры заданы, пробовал с генетическим алгоритмом и без, бесполезно. Все котировки закачаны. Короче, настраиваю всё так, как не раз описывалось на форуме во множестве статей. Делает 54 прохода, а результаты пустые. В журнале оптимизации последней строкой после трёх строк о загрузке советника (ok), старте оптимизации и её остановке написано вот что:
2010.04.29 22:41:04 There were 54 passes done during optimization, 54 results have been discarded as insignificant
Раньше делал оптимизацию различных параметров, всё работало. Теперь, когда это особенно нужно - не работает...
Прошу всех, кто что-нить знает о проблеме откликнуться, просто взываю о помощи!!!

Free translation: genetic optimisation has found a mistake in the genes... In fact, the optimisation always resulted in a loss.

In the Optimisation Results tab, turn off the Skip Useless Results check box.

 
how to find the previous order?
is this correct?
for (cnt = OrdersTotal() - 1; cnt >= 0; cnt--) {