[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 454

 
Roman.:

:-) That's our way. I was beginning to realise that the mats were directed at inept helpers to solve your problem. :-)

That's what I thought too, good thing I was wrong.
 
skyjet:

Hello, I have a question relating to the strategy tester. I know not all of us use it and are sceptical about the tester. My question, in the tester's Model selection window, there are three lines to choose from: by opening prices, all ticks, control points

Yes, after the designation there is an explanation, which to me, unfortunately, is not fully understood. All the time I worked with the tester I was using open prices, but I decided to try All ticks. I got two drastically different results and wondered why?

Please explain!

And by the way, Merry Christmas!


It's just that your EA is not designed for this model, and maybe not for others either. There are a number of features
 
elmucon:


see the method editor in help how the iLowest and iLow functions work

Thank you very useful functions
 
Vinin:

It's just that your EA is not designed for this model, and maybe not for others either. There are a number of special features
Victor, if you don't mind explaining, please :)
 

Complicated, but I'll give it a try. At the opening prices, the take and stops should not be inside the zero bar.

If the take and stops are outside the zero bar, the other two models allow for a more accurate assessment of the EA's performance.

If non-minute timeframe is used, the results will be approximately equal

 
Vinin:

Complicated, but I'll give it a try. At the opening prices, the take and stops should not be inside the zero bar.

If the take and stops are outside the zero bar, the other two models allow for a more accurate assessment of the EA's performance.

If non-minute timeframe is used, the results will be approximately equal

Thank you very much! By the way: What does zero bar mean? Is it a value of 0?
 
skyjet:
Thank you very much! By the way, I have a question: what is meant by a zero bar? Is it a value equal to 0?

The zero bar is the current bar. The one that hasn't closed yet (the rightmost one on the chart).

Simply put, Victor meant - if you use Ask and Bid (current prices) for stops and takes or closing/opening prices, you can only test by ticks

If you set stops and takes at the open/close/high/low price of a non-zero bar and also open with the opening of a new bar, you can also test by the open prices

 
artmedia70:

The zero bar is the current bar. The one that has not yet closed (the rightmost one on the chart).

Simply put, what Victor meant to say is - if you use Ask and Bid (current prices) for stops and takes or closing/opening prices, then you can only test by ticks

Thanks for the clarification :)
 

Hello all, can't attach to the candle hour

//+------------------------------------------------------------------+
//|                                                         test.mq4 |
//|                      Copyright © 2011, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
//----
   int bars = 9; // количество баров
   datetime some_time=D'2011.12.23 01:00';                  // время отсчета свечи
   int      start=iBarShift("GBPUSD",PERIOD_H1,some_time);  // нахождение нужной свечи по времени 
//+------------------------------------------------------------------+   
   double Shift_high = iHighest(NULL,PERIOD_H1,MODE_HIGH,bars,start); //поиск бара с максимальной ценой из bars начиная с 0-го бара
   double Price_high = iHigh   (NULL,PERIOD_H1,Shift_high); // присвоение переменной максимального значение цены
//+------------------------------------------------------------------+   
   Alert("max = ", Price_high); // максимум за 9 баров


//----
   return(0);
  }
//+------------------------------------------------------------------+
вот сделал так, но тут идет привязка к дате (дню) а мне нужно чтобы проверял только час, то есть переменная start равнялась 1 часу не важно какому дню
нашел int Hour() но не понял как им пользоваться int start = int Hour(1) пробовал писать не получается, помогите пожалуйста
 

Hello Gentlemen Traders! As I understand it correctly, newcomers to MQL4 are allowed to ask questions here.

Question: The Expert Advisor makes a Buy trade when the condition (CCI > 100) arisesand closes it at TakePrfit = (1 - 2p). However, if after the take profit the price keeps going up again, the condition (CCI> 100) arisesand the EA keeps opening until the StopLoss is triggered on a pullback or reversal.

How to make first buy also last until next cross

CCI<100.

P.S. The criterion of crossing CCI level <100 is not acceptable, because it is short term and I can't make it wait for the other signals.


extern double TP=1;

extern double SL = 10;

extern int VCCI34 = 100;

extern inttern NCCI34 = -100;

//+------------------------------------------------------------------+

//| expert start function |

//+------------------------------------------------------------------+

int start()

{

//----

double Lot=0.01;

int total = OrdersTotal();

int x1 = iCCI(Symbol(),0,34,PRICE_TYPICAL,0);

int x2 = iCCI(Symbol(),0,34,PRICE_TYPICAL,1);


if (x1 > VCCI34 && x2 < VCCI34 && total == 0)

{

OrderSend(Symbol(),OP_BUY,Lot,Ask,3,Ask-SL*Point,Ask+TP*Point, "myi order",0,0,CLR_NONE );

}

if (x1 < NCCI34 && x2 > NCCI34 && total == 0)

{

OrderSend(Symbol(),OP_SELL,Lot,Ask,3,Bid+SL*Point,Bid-TP*Point, "myi order",0,0,CLR_NONE);

}

//----

return(0);

}

//+------------------------------------------------------------------+