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

 
granit77:
Read the answer again, slowly and thoughtfully:


Thank you.

Tell me if the program text is correct in this case

int ticket; // ticket number
int digits =MarketInfo(Symbol(),MODE_DIGITS); // store the number of digits
double volume =MarketInfo(Symbol(),MODE_MINLOT); // store the minimum lot

ticket=OrderSend(Symbol(),OP_BUY,volume,Ask,2,
0, // SL
0); // TP

OrderSelect(ticket,SELECT_BY_TICKET);
OrderModify(ticket,OrderOpenPrice(),
NormalizeDouble(Bid-150*Point,digits),// SL
NormalizeDouble(Bid+150*Point,digits),// TP
0,Blue)

return (0);

 

How can I connect my EA to a chart with a closed session and start executing the algorithm on the first tick of a new open session? Can you please tell me how.

I asked about it here https://www.mql5.com/ru/forum/135822, but the question went unnoticed. =(

 
Stan:

How can I connect my EA to a chart with a closed session and start executing the algorithm on the first tick of a new open session? Can you please tell me how.

I asked about it here https://www.mql5.com/ru/forum/135822, but the question went unnoticed. =(

But do not distort the truth. The answer has been given. There will be no other, because it is absolutely correct. Read it again.
TheXpert:

Nothing.

Initialization of the EA takes place when you place it, and it starts only when the tick appears.

It means

you only have to place the EA on the chart, wait for the session start and decide what to do - pending or on the market

.

But there is another thing, when ticks are ticking but trading is prohibited, but it is another song, it can be solved

.

That is, you throw the EA on the chart when there are no trades, the EA initializes and hangs peacefully for any length of time. When a trade starts, the first tick causes the EA to execute its algorithm.
 
<br/ translate="no">

Can you guys tell me why when I run tests on different TFs, the test results are different, the charts are also naturally different, opening price tests are the signal part of the Expert Advisor... May be it is because of the history curve? (Although, this happens with different instruments and different brokers).

...
// ----------------------------Считаем параметры технических индикаторов:------------------------------------
   
   double MA_1 = iMA(Symbol(),trend_period,Period_MA,0,MODE_EMA,PRICE_TYPICAL,1);
   
   double ADX1_1 = iADX(Symbol(), trend_period, Period_ADX, PRICE_OPEN, MODE_MAIN,0);           // рассчет ADX - торгуем по тренду
   double ADX1_2 = iADX(Symbol(), trend_period, Period_ADX, PRICE_OPEN, MODE_MAIN,1);
   double ADX_PLUS1_1 = iADX(Symbol(), trend_period, Period_ADX, PRICE_OPEN, MODE_PLUSDI,0);
   double ADX_PLUS1_2 = iADX(Symbol(), trend_period, Period_ADX, PRICE_OPEN, MODE_PLUSDI,1);
   double ADX_MINUS1_1 = iADX(Symbol(), trend_period, Period_ADX, PRICE_OPEN, MODE_MINUSDI,0);
   double ADX_MINUS1_2 = iADX(Symbol(), trend_period, Period_ADX, PRICE_OPEN, MODE_MINUSDI,1);
   
   double iVAR_1 = iCustom (Symbol(),trend_period, "iVAR", n, nBars, 0, 1);                    // расчет индикатора iVAR
   
   // определение входа в рынок по пробою фрaктала        
      F1=iFractals(Symbol(), signal_period, MODE_UPPER, 3); 
        if (F1>0) F11 = F1;      
             
      F2=iFractals(Symbol(), signal_period, MODE_LOWER, 3); 
        if (F2>0) F22 = F2; 
...

               if (Ask > F11 &&                                                                    // пробой фракталя вверх на СИГНАЛЬНОМ таймфрейме 
                   ADX1_1 > ADXOpenLevel  && ADX_PLUS1_1 - ADX_MINUS1_1 > 0 && 
                   ADX1_1 < ADX_PLUS1_1 && ADX1_1 > ADX1_2  &&                                   // АДХ основной тенденции для лонга растет и выше уровня
                      Open[1] > MA_1 && Close[1] > MA_1 &&                                       // цена выше МА основной тенденции 
                      iVAR_1 < 0.5 &&                                                            // тренд на основном ТФ   
             //.........................................ФИЛЬТРЫ...................................
             //                                        ПОЛОСОВОЙ
             //              iOpen(Symbol(), trend_period,1) < iClose(Symbol(), trend_period,1) &&  // белая свеча на основной тенденции
             
             //                                        ДИСКРЕТНЫЙ (ПО ЧАСАМ)                          
             //             (Hour()==9 || Hour()==10 || Hour()==11 || Hour()==12 || Hour()==13 || Hour()==23 || Hour()== 0 
             //             || Hour()==16 || Hour()==17 || Hour()==22 || Hour()==19 || Hour()==20 || Hour()==21 ))
                            (TimeHour(TimeCurrent()) >= Start && TimeHour(TimeCurrent()) <  End))
                          
               {
               WmOrderSend(Symbol(), OP_BUY, Lots_New, Ask, 0, 0, "старт после профита", MagicNumber);
               }
        

And trend_period >= signal_period . I mean, say, trend_period =PERIOD_H1, signal_period =PERIOD_M30, I test one and the same Expert Advisor, controlling the opening of a new bar according to the tester's model - by opening prices on TFs M1, M15, M30 - and every time I get new charts and different reports... Why is it possible? Tell me, who knows, or has faced with similar ...

P.S. This question has already asked - people recommended to do the calculation of a fractal on 3rd bar, because on 2nd (as I had earlier) its re-rendering on different TFs is possible, I corrected it on 3, but the question remains open...


 
Can you tell me please! How do I write the difference in MACD variables in pips? For example:
if ( MACDCurrent-MACDSignal)>5*Point   // ??
 
forexnew:
It's a tricky one. And how did you solve the problem of not saving the uploaded data without switching the timeframe, if that's not a secret? The point is that the EA does not see the uploaded data until it is re-initialised.
The task was to save the uploaded history to the history files. While loading, all the history is stored in memory. After closing the MT4 window, we start saving it to the files using MT4 tools. This is not a quick process.
 

Dear Professionals!

I am asking for your help!

if (((pBid-OrderOpenPrice()) >= -60)
{
ticket=OrderSend(Symbol(),OP_BUYSTOP,Lot,OOP-23*Point,5,pBid-SL*Point,OOP-3*Point,"Отложка BUY_STOP ",mn,5,0);
}
if (((OrderOpenPrice()-pAsk) >= -60)
{
ticket=OrderSend(Symbol(),OP_SELLSTOP,Lot,OOP+23*Point,5,pAsk+SL*Point,OOP+3*Point,"Отложка SELL_STOP ",mn,5,0);
}

I have a trading robot that makes 20-80 trades each. I can not understand it depends on the brokerage company?

Instead of one - puts 100 pcs.

Please help!

 

Hello! Gentlemen... I have this question... a netbook (toshiba) with a 1.66 single-core CPU... and 1 gig of RAM... will it cope with a robot with a large code? That is, will there be no difference in decision making speed with PC ? And will a 3G modem be suitable for trading ?

------------------------------------------------------------------------------------

In details... I need my EA to work 24 hours a day and be "online"... I don't know how to solve this problem, because in my area there are frequent power outages, as a consequence of not working PCs and ISP equipment, which is in the entrance... I think to solve this problem by buying a netbook and 3G modem...

 

Professionals, please advise what the problem is.

Simple expert:

int start()
{ 

Print(TimeToStr(iTime(pair, PERIOD_D1, 1)),", ", TimeToStr(TimeCurrent())); 

} 

The tester outputs:

2011.09.29 01:04:47 2011.09.26 23:58 Test EURUSD,M1: 1970.01.01 00:00, 2011.09.26 23:58
2011.09.29 01:04:47 2011.09.26 23:58 Test EURUSD,M1: 1970.01.01 00:00, 2011.09.26 23:58
2011.09.29 01:04:47 2011.09.26 23:58 Test EURUSD,M1: 1970.01.01 00:00, 2011.09.26 23:58
.........................................
2011.09.29 01:04:47 2011.09.26 23:57 Test EURUSD,M1: 1970.01.01 00:00, 2011.09.26 23:57
2011.09.29 01:04:47 2011.09.26 23:57 Test EURUSD,M1: 1970.01.01 00:00, 2011.09.26 23:57
.....................................
2011.09.29 01:04:47 2011.09.26 23:56 Test EURUSD,M1: 1970.01.01 00:00, 2011.09.26 23:56
2011.09.29 01:04:47 2011.09.26 23:56 Test EURUSD,M1: 1970.01.01 00:00, 2011.09.26 23:56

Although in theory the first date should be the beginning of the previous day.

Please, advise where to look. All of the history is downloaded.

 
Zzumer:

Although in theory the first date should be the beginning of the previous day's day.

Tell me where to look. All the history is downloaded.


So you're on the minutes.

1000 first bars (17 hours) is not enough to refer to the previous day.

Reason: