[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 110

 
sergeev:

What's the forum got to do with it?

the order queue of course.


Thanks for the sensible answer
 
Server:

Thanks for the sensible answer

Even more intelligible:

You organise an enumeration of open positions. You filter them by symbol, type and magician. If profit of the selected position corresponds to the trawl triggering criterion - move the stop of this position to the specified level, not forgetting to do all checks on the correctness of these actions.

I have worked out my turn... Next... :)

 
alsu:



Thank you for your reply about the CCI crossing with zero.
 
MK07:

Thank you for your reply about the CCI crossing with zero.

You have been shown how to calculate CCI crossings.

//+------------------------------------------------------------------+
//|                                                    count bar.mq4 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2012,mario"
#property link      ""

datetime TimeStart = 0;
//+------------------------------------------------------------------+
int init(){return(0);}
int deinit(){Comment("");return(0);}
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
   int f;
   double   MyPoint = 0.0001;
   bool     cu1     = false;
   bool     cu2     = false;
   double   ma_1    = iMA(NULL,0,31,0,MODE_SMA,PRICE_OPEN,0);
   double   ma1     = iMA(NULL,0,11,0,MODE_SMA,PRICE_OPEN,0);
   double   ma_2    = iMA(NULL,0,31,0,MODE_SMA,PRICE_OPEN,1);
   double   ma2     = iMA(NULL,0,11,0,MODE_SMA,PRICE_OPEN,1);
//Уточнение-при кое събитие ще запомни датата-пресичането
//Уточняем,когда запомнит время пересечения
   if(ma2<ma_2 && ma1>ma_1)
      TimeStart=Time[0]; 
   if(ma2>ma_2 && ma1<ma_1)
      TimeStart=Time[0];
//Кога е истината
//Когда истина
   if(ma1>ma_1)
      cu1=true;
   if(ma1<ma_1)
      cu2=true;
//Шифтвам до датата-когато има истина
//Шифт до дата истини
   if(cu1==true || cu2==true)  
      int b1=iBarShift(Symbol(), PERIOD_H1, TimeStart);      
      int b2=iBarShift(Symbol(), PERIOD_H1, TimeCurrent());
//Преброяване на баровете-от нулевия до последната дата
//Пересчитаем бари от нуля до последная дата
    for(int j=b2;j<=b1;j++){
         f=b1-b2;
      }
      
   Comment("\nВреме на брокера: ",TimeToStr(TimeCurrent(),TIME_SECONDS),", Локално време: "+TimeToStr(TimeLocal(),TIME_SECONDS),
             "\nТекущ спред: ",DoubleToStr((Ask-Bid)/MyPoint,1),
             "\n=====================",
             "\n Начална дата:           ",TimeToStr(TimeStart,TIME_DATE|TIME_SECONDS), 
             "\n Брой барове:            ",f,
             "\n=====================" 
             ); 
   return(0);
  }
//+------------------------------------------------------------------+
I think you will be able to handle it from here.
 
alsu:

Is period_converter from the standard supply not suitable?


Of course not, it does not form weeks and above correctly, have you used it?

COMRADES, BRONTO, BRONTO!!! HELP

Another question, what is the tester error? How many bars minimum does the tester need to run and why is this restriction needed?

Can this parameter be edited?

 
ZZZEROXXX:


No of course it does not form weeks and above correctly, have you used it yourself?

COMRADES, BRONTO, BRONTO!!! HELP

Another question, what is the tester error? How many bars does the tester need at least to start?

Put 10 million in Settings!
 
borilunad:
Set it to 10 million in Settings!

I have one million, but I found that if it's less than 100 bars, the tester doesn't test at all. Then the question is, if the 100-bar rule is respected, why does it not test within these 100 bars and starts only afterwards?
 
ZZZEROXXX:

I have a million, I found that if less than 100 bars, the tester does not test at all. Then the question is: if the 100-bar rule is respected, why does it not test within these 100 bars and starts only afterwards?
The 10 million bars are for the minute bars on which the tester simulates ticks. And 100 bars-minutes is very small, less than the bars that fit on a 1-minute chart. The tester should work if there are at least 1440 bars to run from 0.00 to 0.00! That's probably the minimum, and why do you need it? Did you want to test on a short section? But you can't set testing by hours, only by dates, whole days. I understand in your case.
 

This is the function of the indicator:

//+-------------------------------------------------------------------------------------+
//| Определение индекса бара, с которого необходимо производить перерасчет              |
//+-------------------------------------------------------------------------------------+
int GetRecalcIndex(int& total)
{
   int counted_bars = IndicatorCounted();          // Сколько баров уже посчитано
   total = Bars - 1;                               // Определение первого бара истории
   if (indBarsCount > 0 && indBarsCount < total)   // Если не нужно рассчитывать всю..
      total = indBarsCount;                        // ..историю, то начнем с указанного..
                                                   // ..бара - indBarsCount
   if (counted_bars == 0)                          // Кол-во посчитанных баров - 0. 
   {
      DeleteAllObjects();                          // Не забудем удалить все созданные..
                                                   // ..объекты
      return(total);                               // Нужно пересчитать всю историю
   }
   return(Bars - counted_bars - 1);                // Начинаем с первого непосчитанного..
                                                   // ..бара
}

One thing I don't understand. Usually they check the number of uncalculated bars like this:

Bars - counted_bars

The essence is as follows. For example, we have 500 bars. Also 500 have been calculated. After the function is executed, it will return 500 - 500 - 1 = -1. Is it normal?

If it were not -1 at the end, it would return 0, i.e. all bars are calculated. How to understand this point?

 
hoz:

This is the function of the indicator:

One thing I don't understand. Usually they check the number of uncalculated bars like this:

Bars - counted_bars

The essence is as follows. For example, we have 500 bars. Also 500 have been calculated. After the function is executed, it will return 500 - 500 - 1 = -1. Is it normal?

If it were not -1 at the end, it would return 0, i.e. all bars are calculated. How to understand this point?

A zero bar cannot be "calculated" because it is not yet complete.