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

 
Hello, I'm writingthe close prices of othercurrencies (in different colours) and the last barin the indicator buffer.As a result, I start the indicator - everything is correct. Then I start writing new bars. If I switch timeframes back and forth, the chart is nice, but I get horrible bars. How do I fix it? The EA goes crazy :)
price[i] = ((iClose(name, 0, i))/MarketInfo(name, MODE_POINT))/(1/MarketInfo(name, MODE_TICKVALUE))
 
Can you guys tell me what this error is? 2017.03.17 05:32:09.929 FxMath_DayTrader_USDJPY USDJPY,Daily: Failed to download image from file \Images\rfx1.com\image\fxmath.bmp. Error code 5020

 
MONTE_CRISTO:
Can you guys tell me what this error is? 2017.03.17 05:32:09.929 FxMath_DayTrader_USDJPY USDJPY,Daily: Failed to download image from file \Images\rfx1.com\image\fxmath.bmp. Error code 5020

Unable to download image to the specified address.
 
Aleksandr Hudilainen:
Failed to load image to specified address.

2017.03.17 05:56:02.237 FxMath_DayTrader_USDJPY USDJPY,Daily: Alert: UrlLinkLabel : Could not open URL link. hResult = 2 Error 4202 - object does not exist. which is what?

 
MONTE_CRISTO:

2017.03.17 05:56:02.237 FxMath_DayTrader_USDJPY USDJPY,Daily: Alert: UrlLinkLabel : Could not open URL link. hResult = 2 Error 4202 - object does not exist. which is what?


Could not open URL link. HResult = 2 Error 4202 - object does not exist.
 
Nikolay Fedyay:

Thank you.

How about if you want to know the crossing point when there are no bars yet, i.e. a date in the future.

you can calculate "in how many bars there will be an intersection" (just school geometry)

But the date can only be approximated by this, as the bars are formed only when the market is open, i.e. they are different for each instrument.

Simplified, if you know the calendar in advance:

  • add 24 hours to the current day, if it turns out to be Saturday/Sunday you skip it, if it's a general calendar holiday you skip it, if it's a bank holiday you skip it.
  • For W1 and higher you have to take into account that the weekly bar starts from Saturday to Sunday, M1 - as according to the calendar
  • for less than a day it is necessary to consider the market opening/closing time and the work schedule of your DC
  • at a change of dates (in the morning, at the first ticks) you have to repeat all previous calculations

that is so messy, that MT has a big problem with it :-)

 
I've been learning to write MQL4 Expert Advisors for about three weeks now! I wrote a compiled EA, no errors or warnings and everything seems fine. I found a big BUT it doesn't want to work . Maybe I can ask here where I made a mistake and what I did wrong. If someone tells me what to do, let me know. I am afraid this is my first time here and how to do it. Although I see how.
 

Hello!

Can you tell me which functions (user functions, special functions, standard functions) are used to communicate between terminals? Example:[product name deleted by moderator](copyer of deals for MetaTrader 4 terminal, copies (synchronizes, duplicates) trades from any accounts). And why does it not depend on ticks?

 
nickor29:

Hello!

Can you tell me which functions (user functions, special functions, standard functions) are used to communicate between terminals? Example:[product name deleted by moderator](copyer of deals for MetaTrader 4 terminal, copies (synchronizes, duplicates) trades from any accounts). And why does it not depend on ticks?


Functions of work with files, standard. It does not depend on ticks, because it works in a timer.
 

Is there an alternative to converting int to double for mathematical operations?

int NOL_Sell=1; //по факту счетчик - поэтому в double сразу нельзя
int N_Sell=2;   //по факту счетчик - поэтому в double сразу нельзя

double ProcTotalSell=StrToDouble(IntegerToString(NOL_Sell))/StrToDouble(IntegerToString(N_Sell))*100.0;