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

 
bestfx:

Me too. On your resource, all the codes are through Guys, there are standard language functions, and rewriting them over is ludicrous.

On our resource, all the codes are through. Marasmus is in your head, and judging by the piece of code you wrote, I conclude that your code writing is and in PXP too. The style is outstanding...
 

Hello.

Some time ago, when displaying TRIX MTF type indicators on the MT4 working window, an extra line of bars appears. As I found out on one of the foreign forums, this happens in the latest releases of MT4.

Can I independently take actions (with your instruction) to correct this problem, or this effect will be eliminated by you in the further releases of MT4.

Sincerely, Evgeniy. 412500@gmail. com; 4125er@gmail.com

 
Craft:

Good afternoon.

Can you tell me how to find the highest close in an array:

double hc = iClose(NULL, 0, iHighest(Symbol(), 0, MODE_HIGH, PERIOD_M1, kk));

Is it done this way or am I mistaken?

I couldn't find any answer by searching for "highest close".

Maybe it's like this:

string sym;int PER=1;//таймфрейм
//+------------------------------------------------------------------+
//| script program                                                   |
//+------------------------------------------------------------------+
int init(){sym=Symbol();return(0);}
int start(){int bar=iHighest(sym,PER,MODE_CLOSE,iBars(sym,PER)-1,0);
  double hc=iClose(NULL,PER,bar);Print(sym," PERIOD_M",PER,"  max_close =",hc,"  Time =",
  TimeToStr(iTime(NULL,PER,bar),TIME_DATE|TIME_MINUTES));return(0);}
//+------------------------------------------------------------------+
 
MikeM:
Time[i] - the time corresponding to the i-th bar on the chart.
I don't understand about "tomorrow's" data on the chart. Where do they show it? I want oooh-ooh-ooh!!!

This is a very old version of my indicator...
I was just counting the bars to the right time for me to place the arrow there - but this is not the right version, because in some cases it's holidays, and just the time of the trading session and the instrument (in this case it's sberbank)

I have now completely rewritten the code and I want it to be ok...

I want to get =) time values in X-axis under the last blue arrow, to check the location.

In fact, the new version of the indicator has in its arrays the information about the location of the next arrow along the X axis (time) and price, all that is left is to transfer it to the chart..... in general, help me, tell me how to do it nicely

Screenshot from an old version...

с

 
anyone here is answering questions at all)
 

Good afternoon. Can you please advise me, under these conditions, the orders do not open through the level. What is wrong here?

double Mash_Price_1=iCustom(NULL,0,"mashka",0,0);
double Mash_Price_2=iCustom(NULL,0,"mashka",0,1);
double Mash_Price_3=iCustom(NULL,0,"mashka",0,2);

double Max_1,Max_2; //уровень цены 

if(Mash_Price_1>Max_1 && Mash_Price_2==Max_1 && Mash_Price_3<Max_1 || 

Mash_Price_1>Max_1 && Mash_Price_2 < Max_1 && Mash_Price_3<Max_1 ||

Mash_Price_1>Max_1 && Mash_Price_2==Max_1 && Mash_Price_3==Max_1)
{
Opn_B=true;
Opn_S=false;
}
if(Mash_Price_1<Min_1 && Mash_Price_2==Min_1 && Mash_Price_3>Min_1 ||
Mash_Price_1<Min_1 && Mash_Price_2 > Min_1 && Mash_Price_3>Min_1 ||
Mash_Price_1<Min_1 && Mash_Price_2==Min_1 && Mash_Price_3==Min_1)
{
Opn_B=false;
Opn_S=true;
}
}



while(true)
{
if(Total==0 && Opn_B==true)
{
RefreshRates();
SL=Bid-New_Stop(StopLoss)*Point;
TP=Bid+New_Stop(TakeProfit)*Point;
Print("Попытка открыть Buy. Ожидаем ответа...");
Ticket=OrderSend(Symb,OP_BUY,Lts,Ask,2,SL,TP);
if(Ticket>0)
{
Print("Открыт ордер Buy ",Ticket);
return;
}
if(Fun_Error(GetLastError())==1)
continue;
return; 
}

if(Total==0 && Opn_S==true)
{
RefreshRates();
SL=Ask+New_Stop(StopLoss)*Point;
TP=Ask-New_Stop(TakeProfit)*Point;
Print("Попытка открыть Sell. Ждем ответа...");
Ticket=OrderSend(Symb,OP_SELL,Lts,Bid,2,SL,TP);
if(Ticket>0)
{
Print("Открыт ордер Sell ",Ticket);
return;
}
if(Fun_Error(GetLastError())==1)
continue;
return;
}
 
deyron:

Good afternoon. Can you please advise me, under these conditions, the orders do not open through the level. What is wrong here?


There is a button SRC for code insertion

What do you have that these variables are equal to?

double Max_1,Max_2; //уровень цены 
 
int Bar_Beg = iBarShift(Symbol(),0,Cur_Beg,false);//начальный бар
int Bar_End = iBarShift(Symbol(),0,Cur_End,false);//конечный бар
int Dif_Bar = Bar_Beg - Bar_End;//Разница баров для расчетов Мах и Мин

int High_1 = iHighest(Symbol(),0,MODE_HIGH,Dif_Bar,Bar_End); //Максимальное значение бара
int Low_1 = iLowest (Symbol(),0,MODE_HIGH,Dif_Bar,Bar_End); //Минимальное значение бара

Max_1=High[High_1];
Min_1=Low[Low_1];

And Mashka=(High[i]+Low[i])/2;

 
deyron:

Here's Mashka with level Min_1.

Here's an option if:


Green Max_1,

from the history

Max_1 = 1.5485 Min_1 = 1.5461 Mash_Price_1 = 1.5496 Mash_Price_2 = 1.5495 Mash_Price_3 = 1.549

In which direction do you look for the trouble?

Have you tried error handling?
 
If there were attempts to open an order, it would be shown in the messages. And if there is no attempt to open an order, why would there be an error. The question is whether the conditions of Macha passing through the levels are set correctly. Why do the orders open much later than expected when the parameters are hardcoded?
Reason: