[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 17

 

Yes, thank you, I looked at the tutorial. Didn't help(

Ok, since it's bullshit, then do you have an indicator/script/advisor that draws a grid of vertical lines with a certain pitch?

 
r.ig.h:

Yes, thank you, I looked at the tutorial. Didn't help(

Ok, since it's bullshit, then do you have an indicator/script/advisor that draws a grid of vertical lines with a certain pitch?

https://www.mql5.com/ru/code/8684

Or draw it yourself, i found something similar, i don't even remember why i did it anymore

#property indicator_chart_window

extern int num    = 10;
extern color line = White;
int init()
{return(0);
}
  
void clear(){
   for(int i=ObjectsTotal()-1; i>=0;i--) {
      string name = ObjectName(i);
      if (StringFind(name,"timeH1_") !=-1) ObjectDelete(name);
    }
}

int deinit(){
clear();
return(0);
}

int start()
{   
   int counted_bars = IndicatorCounted();
   if(counted_bars < 0)   return(-1);
   clear();
   for (int i=0;i<=num;i++){ 
      string name = "timeH1_"+TimeToStr(Time[i],TIME_DATE|TIME_MINUTES);
      ObjectCreate(name,OBJ_VLINE,0,iTime(NULL,PERIOD_H1,i),0);
      ObjectSet(name,OBJPROP_COLOR,line);
      ObjectSet(name,OBJPROP_STYLE,STYLE_DOT);
    }
return(0);
}
 
Thank you very much, at least something.
 
Hello! Please help! I take the current price a=Bid (for example the price is 1.4110) and with this number I need to do some mathematical transformations (see below). Then I check if amongst the pending/open orders there is an order with the opening price just calculated with the variable "a". It often happens that the program does not see an order with the price "a" but it is placed!
a=Bid;
a=100*a;
floor=MathFloor(a);
rest=a-floor;

if(rest>=0 && rest<=0.2) rest=0.2;
if(rest>0.2 && rest<=0.4) rest=0.4;
if(rest>0.4 && rest<=0.6) rest=0.6;
if(rest>0.6 && rest<=0. rest=0.8;
if(rest>0.8 && rest<=1) rest=1;

a=NormalizeDouble((floor+rest)/100-0.0099, Digits);
Please tell me why the program can't see the order?
 
Casey:

Hello! Please help! I take the current price a=Bid (for example the price is 1.4110) and with this number I need to do some mathematical transformations (see below). Then I check if among pending/open orders there is an order with the opening price of the just calculated value of the variable "a". And it often happens that the program does not see an order with the price "a" but it is set!
Can you please advise why the program does not see the order?

It may be that the OrderOpenPrice() function returns the non-normalized price value. Secondly, it is better not to compare real numbers for equality. It is better to subtract one price from another and compare it with some constant. Look around the forum "Comparing real numbers" or "Comparing double numbers".
 
r.ig.h:

Yes, thank you, I looked at the tutorial. Didn't help(

Ok, since it's bullshit, then do you have an indicator/script/advisor that draws a grid of vertical lines with a certain pitch?

Why the tutorial https://docs.mql4.com/ru/dateandtime

For example, let's simulate Monday's work from a certain time

int starttime=7*60;// offset from the beginning of Monday in seconds

datetime nexttimer=0;


start(){

if nexttimer=0{

nexttimer= TimeCurrent()- (TimeDayOfWeek(TimeCurrent())-1)*60*60*24;//

From this date we get the beginning of the day and add the offset.

while if nexttimer< TimeCurrent()) {nexttimer=nextimer+9*60*60;}

}

if nexttimer= TimeCurrent(){

write the needed action

nextimer=nexttimer+9*60*60;

}

}

Well, that's without taking into account weekends and so on.

 
Hello all! Please tell me if there is a script, so that each transaction was accompanied by an arrow at the opening and closing, as well as the line at the closing? Well, as in testing ... I've already got sick of googling! Damn. Already started quietly myself from other scripts to collect :))) I built a script that opens the deal;)but I can't find any ready-made one.... Please help me!!!
 
Mr.Ross:
Hello all! Please tell me if there is a script, so that each transaction was accompanied by an arrow at the opening and closing, as well as the line at the closing? Well, as in testing ... I've already got sick of googling! Damn. Already started quietly myself from other scripts to collect :))) I built a script that opens a deal;)but I can't find any ready-made one.... Please help me!
I need an EA. The script works once when attached to the chart of the currency pair.
 
Ah yes! That's right! You need an advisor! But I don't think there's one...? What do you think?
 
Mr.Ross:
Ah yes! That's right! You need an advisor! But I don't think there's one...? What do you think?
It won't take long to make one. But what's the point of additional visual support for the trades? If you can convince me that it is very useful, they will do it - no problem... :)