[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 523
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
Hello again. Thank you for the previous reply - very helpful. Please help again. I've got the function I need from one Expert Advisor that counts account profit (loss) for today (if f0_5(0)), yesterday (if f0_5(1)), etc:
The result should be a decimal fraction (supposedly), but the function returns an integer for some reason. In general, please help me to change the function so that it was a fraction with two decimal places.
Although I may have screwed up here: checked using Print(), but the function actually counts normally? In general, please help me to understand.
Here's the famous idnikator.
Can you get a picture like this!? :))))))
Here it is.
You surprise me again! The so-called last 10, from 0 to the 10th bar we have on the chart in contact with the price! Forget about the thirtieth and five thousandth bars in the history! We have already gone through them, and we need them only for the tester. And we need the latest ones, starting from zero, and of course, the new ones in the future - that's where we are going! ;))
You surprise me again! The so-called last 10, from 0 to the 10th bar we have on the chart in contact with the price! Forget about the thirtieth and five thousandth bars in the history! We have already gone through them, and we need them only for the tester. And we need the latest ones, starting from zero, and of course, the new ones in the future - that's where we are going! ;))
That last i.e. closer to current price I have already understood. But this piece of codeBars*6 - 60 I do not understand. What it will return? I want to understand how it may be calculated logically. May I ask you to explain? Maybe it's easy for someone, but I'm not a programmer by education, so I'm having a hard time understanding this flow of information. I am reading the tutorial, and am gradually asking the questions that I come across. I very much hope that the questions will soon be more relevant than they are now.
Roll:
5940 -The starting index of the initial array to copy the last 10 bars (bar is 6 indexes).
Dear experts, isn't there an error in the textbook?
Here is my reasoning:
At the beginning of the code,int ArrayCopyRates function is called which copies the data of the bars of the current chart into a two-dimensional array of RateInfo[][6] type and returns the number of copied bars or -1 in case of failure according to the example of this function:
the current bar is the bar with index 0-0 , thus, returning to the original code, we copy the element with index 0-0 (the current bar) of array1 , to array2 with index 0-0, we get the last 10 bars (where the last bar is the current bar, the one with index [0]), which is contrary to what we wrote in the tutorial... so by copying element with index Bars*6-60,60 of array1 into array2 with index 0 we get information about bars from history.
Hello.
I have a custom indicator.
I'm writing an EA...and I have a question...how to access my indicator? Specifically, take the data from the specified bar (in my case, I need to take the 2nd bar). I have windowsPriceMax, but as far as I understood it, it displays only the last value of subwindow chart and it's not clear, if for example I have 3 lines on the indicator, what will it display?
Hello.
I have a custom indicator.
I'm writing an EA...and I have a question...how to access my indicator? Specifically, take the data from the specified bar (in my case, I need to take the 2nd bar). I received windowsPriceMax, but as far as I understand it, it outputs only the last value of the chart and I don't understand if I have 3 lines on the indicator, what will it output?
double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift)
Calculation of the specified custom indicator. The custom indicator must be compiled (a file with EX4 extension) and located in terminal_directory\experts\indicators.
Parameters:
symbol - symbol name of the instrument, on the data of which the indicator will be calculated. NULL means the current symbol.
timeframe - Period. Can be one of the chart periods. 0 means period of the current chart.
name - Custom indicator name.
... - Parameter list (if needed). Passed parameters should correspond with the order of declaration and type of external (extern) variables of the custom indicator.
mode - Index of the indicator line. Can be from 0 to 7 and must correspond to the index, used by one of the SetIndexBuffer functions.
shift - Index of the value received from the indicator buffer (shift relative to the current bar by the specified number of periods back).