[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 430
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
Guys,help with the code.
Help find the price of the first arrow up (on the chart marked these places in yellow) or down (green).I can find the price and time of formation of the last arrow up and down(on the chart marked these places in black) is this:
for(u=Bars-1;u>0;u--){
if(iRSI(NULL,PERIOD_M5,14,PRICE_CLOSE,0) >70)
{time70=iTime(Symbol(), PERIOD_M5,u);//shows time of the last arrow down
price70=iOpen(Symbol(), PERIOD_M5, u);}} //shows price of the last down arrow
for(p=Bars-1;p>0;p--) {
if(iRSI(NULL,PERIOD_M5,14,PRICE_CLOSE,0) <30)
{some_time30=iTime(Symbol(), PERIOD_M5,p); //showstime oflast arrow up
price30=iOpen(Symbol(), PERIOD_M5, p);}}//shows price of last up arrowI need the script to automatically set the minimum server stop loss on the current symbol when opening an order. What should be written here? OrderSend(Symbol(),OP_BUY,0.01,Ask,10,?,0);
Read
В документации есть 2 момента касательно индикаторов.
In special constants, these are:
" indicator_buffers number of buffers to calculate the indicator, up to a maximum of 8 "
Under custom indicators:
" Allocates memory for buffers used for custom indicator calculations. The number of buffers cannot exceed 8 and be less than the value specified in the indicator_buffers property. If the custom indicator requires additional buffers for counting, you should use this function to specify the total number of buffers. "
If the number of buffers is specified, I think this already means allocating memory for buffers. Correct me if you mean something else here, please.
Good afternoon. Question about a file pointer... In the MQL4 book, found at MQL4.community, in the "Standard Functions" section, there is an example of the script "File Operations", which is intended for reading data from a file and displaying graphical objects in a symbol window:
Below, when analyzing this script in the Book on MQL4, the following phrase is given: "if the specified check (the last 2 lines in block 5-6) is removed, an extra object will be created at runtime. And only after that, the while loop's termination condition will trigger and control will be passed to block 8-9".
Do I understand it correctly? A file pointer is NOT INFLOWED BY TEXT SIGNS (for example: text| where | is a file pointer), but is a pointer WITH EXPRESSION, for example: text where k is the "to" character, k-th is highlighted by a file pointer. This explains the need for strings (see p.164):
Indeed. On penultimate iteration, after creating LAST object
2007.05.11 18:30;JPY
the file pointer is at the position of the last object, i.e:
2007.05.11 18:30;JPY IndustrialManufacture
(where o is the "o" character, k is the file index). Then when passing control to while statement header, FileIsEnding(handle) function will obviously return true, because file pointer is NOT at end of file, but at LAST character of that file. Then when the first two lines are executed, the file pointer will move to empty space and if there are no lines
the script will create a graphic (i.e. a line) with an empty description and a time coordinate that corresponds to 0. This is what is meant in the phrase: "if the specified check (the last 2 lines in block 5-6) is removed, then an extra object will be created at runtime. "
Question: do I understand correctly:
a) the definition of a file pointer;
b) the meaning of the phrase "If the specified check (the last 2 lines in block 5-6) is deleted, then an extra object will be created at program execution.And only after that the while loop's end condition will be triggered and control will be passed to block 8-9".
P.S. In order not to litter the forum, thank you in advance for your answer
Please tell me, I have no experience, if between two ticks my program sends several commands to the server, will they all be executed, or only the first command ? Where can I find information on this subject ?
Please tell me, I have no experience, if between two ticks my program sends several commands to the server, will they all be executed, or only the first command ? Where can i find information on this subject ?
Read:
https://book.mql4.com/ru/basics/common
Read:
https://book.mql4.com/ru/basics/common
Hello! I have a question about indicators in MQL4 and I can't figure it out... For example, I have a simple fractal indicator:
If I compile it in this form, when extending the left border of the chart and loading history, it starts glitching and shows marks where they should not be (see screenshot in attachment). If we comment out a part of the code:
Then these glitches disappear... The same glitches appear when loading history, if you fill only "nonempty" elements of the indicator array and don't reset indicator value where there are no labels...
Why does this happen? Why, it turns out, is it necessary to recalculate the whole indicator when loading the history? And why do I have to null the values of "empty" elements of the array?
If the bars were indexed from left to right, at history loading the indexes of the bars would change, and the indicator would be incorrectly displayed without recalculation, then we would understand this glitch ... But in MT4 bars are indexed from right to left, so, when loading the history, the indexes of the bars, that were indexed, should remain the same (and the indicator values, too), then why recalculate the indicator and where do these mark shifts come from?
Why is it necessary to recalculate the whole indicator when loading the history? And why should the values of "empty" elements of the array be zeroed? And if you don't do this, then the indicators are displayed incorrectly...
IndicatorBuffers specifies the total number of buffers used.
Example.
#property indicator_buffers 2
.......... .................................
IndicatorBuffers 3
Draws two lines, the third buffer is not shown but is used for intermediate calculations.