Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1035
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Ask here.
OK, now one more question. How to make the indicator read from a certain bar, on any startup or compilation???? Because there are more bars every minute.....
Help to convert the script into a function to add to an EA
Permanent link to the script https://forum.mql4.com/ru/5872#24097
A bar has a specific time. Use that time to calculate the right bar. Then it won't bother you that there are more and more bars every minute.
Is that a number in the form of the number of seconds since 1970?
Do you mean a number in the form of number of seconds since 1970?
The int variable contains the number of seconds since 1970, while the datetime variable contains the date.
If you need a certain bar in the history, then it doesn't matter how you specify it - by date or by number of seconds, in any case, the variable will indicate the time of opening of this particular bar, regardless of the arrival of new ticks and opening of new bars.
else {rezult=Up/Down; string value=DoubleToString(rezult, 5); Alert("Down=",Down,",Up=",Up,",Zero=",Zero); Alert("POWER UP=",value);}The values Down, Up and Zero the Alert outputs, but it doesn't want to divide.
Please help. I can't understand the reason - it doesn't do division, gives 1,00000 result for all values of divisor and divisor.Below is a snippet of codeps. SRC is not inserted, I'll write it this way: Down, Up and Zero values alert outputs, but does not want to divide.
Everything is inserted normally.
And where and what type of variables are declared?
Please help. I can't figure out the reason - it doesn't do division, gives 1.00000 result for all values of divisor and divisor.Below is a snippet of codeps. SRC is not inserted: if(Down>Up) {rezult=Down/Up; string value=DoubleToString(rezult, 5); Alert("Down=",Down,",Up=",Up,",Zero=",Zero); Alert("POWER DOWN=",value);}
else {rezult=Up/Down; string value=DoubleToString(rezult, 5); Alert("Down=",Down,",Up=",Up,",Zero=",Zero); Alert("POWER UP=",value);}The Alert outputs values Down, Up and Zero, but does not want to divide.
double op_i,cl_i,rezult;