Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1946

 
Artyom Trishkin #:

See Scriptor' s indicators.

Thanks, found it, but it's a bit different, only on one row

 
Vitaly Muzichenko #:

Thanks, I found it, but it's a bit different, it's only for one row.

I think there are several rows too.

 
Artyom Trishkin #:

I think there are a few rows in there too.

There are over 1500 codes, I must have missed it, unfortunately

 
Vitaly Muzichenko #:

Thanks, I found it, but it's a bit different, only on one row.

Vitaly, you surprise me. All such indicators are based on building DRAW_ARROW with the appropriate code. In your drawing the squares are the code 167

      ObjectSetInteger(0, up_arrow, OBJPROP_ARROWCODE, 167);    // установим код стрелки 

And the level of the series is set as Artyom's cat or cat wishes. It may be in whole numbers or in tenths.

Start and ask about what doesn't work.

 
Vitaly Muzichenko #:

Can you tell me if I've seen an indicator subwindow drawn in this style somewhere in kodobase?

Can't find it


DRAW_ARROW is not good ?

8 buffers if drawing with one colour, 16 if with two.

or DRAW_COLOR_LINE with thicker lines.

The sense is that the lines are always at the same level (first 1 second 2 etc.), only the colour changes.

 
Alexey Viktorov #:

Vitaly, you surprise me. All such indicators are based on DRAW_ARROW drawing with a corresponding code. In your picture the squares are code 167

And the level of the row is set as Artyom's cat or cat wishes. It may be in whole numbers or in tenths.

Start and ask about what doesn't work.

I don't understand the principle of indenting from the bottom so that it's equal in several rows

That's where I can't get started

 
Vitaly Muzichenko #:

I don't understand the principle of indenting from the bottom so that it is evenly spaced in several rows

This is where I can't start.

Start by making the value of the bottom level 1, the value of the second level 2 and so on. Then you may decrease it. If it is for mql4, then you need 2 buffers per level if you have only 2 colours. For mql5 it should be 2 buffers per level, data and colour. Verticality is adjusted by the indicator window height.

 

Please advise, I couldn't find it. How to bring server time with different shifts to meta-quota time. I'm doing something, but it's in the wrong place and I don't like it. I remember Saber even mentioned a summer winter shift, but couldn't find it.

My thoughts are as follows. We only have local comp time available at all brokers. We don't know the time shifts of other brokers. Of course, we can use global variables of the terminal, though not for sure, or files, but it's much easier - the necessary shift intuition. We obtain the broker's shift. We calculate the difference AND TimeShift + difference*3600, taking into account the sign of the difference.

Is this correct?

Added.

Cool, in MT you can only get the shift between GMT time and local time)))) No shift between server time and GMT......

Heh, decided))) Based on Dmitry Fedoseyev)))

class CTradeTimeGMT{
protected:
int StartTime;
int EndTime;
int GMTRatio;
public:
void Init(int StartHour, int StartMinute, int EndHour, int EndMinute, int GMTshift){
StartTime=3600*StartHour+60*StartMinute;
EndTime=3600*EndHour+60*EndMinute;
GMTRatio=(GMTshift*3600)-int(((TimeCurrent()-TimeGMT())/3600)*3600);
}
bool Check(){
int CurTime=(int)((TimeCurrent()+GMTRatio)%86400);
if(StartTime<EndTime){
return(CurTime>=StartTime && CurTime<EndTime);
}
else{
return(CurTime>=StartTime || CurTime<EndTime);
}
}
};

input int STARTHour = 16;
input int STARTMinute = 13;
input int ENDHour = 19;
input int ENDMinute = 59;
input int GMTShift=2;   // сдвиг который нужен для всех брокеров при указании времени


CTradeTimeGMT tt;

int OnInit()
  {
//---
  tt.Init(STARTHour,STARTMinute,ENDHour,ENDMinute,GMTShift); 
//---
   return(INIT_SUCCEEDED);

void OnTick()
  {
 FlagTrade=tt.Check();
if( !FlagTrade )return;

// торговое время одинаковое для всех
}
 
Hello, I am trying to publish an Expert Advisor on the Market with a simple code, but it does not pass validation in the version section. Help me understand why the code does not pass validation. There are two errors in the testing report. The first is that all messages should be in English, I fixed it, and the second error:You should add the ability to check trading functions for errors in the Strategy Tester.
1. It is forbidden to add any restrictions on the operation of the Product, depending on time, type or number of trading account, financial instrument, etc.
2. For a News Expert Advisor, you can generate test news of different importance several times a day.
3. For a multi-currency Expert Advisor add the ability to trade only one currency pair.I am attaching the code file of the Expert Advisor.Only if you can, you can correct all the errors in the file, and then explain what was wrong.
Files:
2nd3.mq4  12 kb
 

Please advise where to "dig" about sending a signal when the price reaches the standard horizontal line on the chart to another device with the same account,

Thank you in advance, thank you

Reason: