[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 367
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
Three maxima for the period, not the most recent. Or rather, not necessarily the last.
Look: you have an array with values. You need to find three maxima in this array. They don't have to be the last or first in the timeseries array. You just need to find the three maxima.
1. Let's copy your array into a temporary one (we will look for them in the temporary array):
int ArrayCopy( object &dest [], object source[], int start_dest=0, int start_source=0, int count=WHOLE_ARRAY)
Copies one array into another. The arrays must be of the same type. Arrays of type double[], int[], datetime[], color[], and bool[], can be copied as arrays of the same type.Returns the number of copied elements.
2. look for maximal value in temporary array:
int ArrayMaximum( double array[], int count=WHOLE_ARRAY, int start=0)
Search for the element with the maximum value. The function returns the position of the maximal element in the array.3. Save found index into array (e.g. MassIndexMaxValue[])
4. zero the value of found maximum in time array - just write zero there
5. Again search for the next maximum value in the temporary array (the index of the first one we have found is already stored in MassIndexMaxValue[] and the value of this maximum is zeroed)
This loop goes on until we find the required number of maximal values in the temporary array.
MassIndexMaxValue[] array will now contain indexes of the required number of maximal values in your array.
Let's reset the size of the temporary array to zero - there's no reason to clog memory
That's how it goes...
ZS... I just did a quick sketch on the spot... I may have made a mistake - I was awake when I was writing and didn't check anything, but the function has something like this content:
When it's called:
FindMaxValue(Ваш_Массив_Значений, MassIndexMaxValue, 3);
... The previously defined array int MassIndexMaxValue[] must contain the indices of the three maximal values found in your_Array_Value[];
I can't figure out how the percentage of profit per trade and percentage of loss per trade are calculated. Can you tell me?
http://www.assessor.ru/forum/index.php?t=822
Look: you have an array with values. You need to find three maxima in this array. They don't have to be the last or first in the timeseries array. You just need to find the three maxima.
Artem, thank you very much!
I'm glad that my idea with zeroing out the maximum value of the array was correct, and you've described everything in detail, with copying into another array, now I will deal with the minutiae
And following Vladimir's advice I will start with the algorithm of the program, I will process your information and I am sure everything will work out - good teachers.
SPECIAL THANKS FOR THE ARTICLE https://www.mql5.com/ru/articles/1357
Good afternoon!
Can you please tell me how to get signals from a custom indicator into an Expert Advisor?
I used iCustom, but owls still don't receive the signal
Good afternoon!
Can you please tell me how to get signals from a custom indicator into an Expert Advisor?
I used iCustom, but owls still don't get the signal
Perhaps the iCustom indicator code doesn't lend itself to it... there is too little information in your question to answer.
Good afternoon!
Can you please tell me how to get signals from a custom indicator into an Expert Advisor?
I used iCustom, but owls still don't receive the signal
Is it the same with other indicators? If yes, you incorrectly use the iCustom() function. If no, try to check the code of the indicator - it may be that your indicator doesn't use any indicator buffer at all - it works with the construction of graphical objects.
Hello, there is a function:
But it doesn't work for some reason. It is called in the EA right at the beginning after int start() as follows:
The Expert Advisor is loaded successfully in the Log and Experts tabs, and nothing else appears. Although it should say, "We do not trade on weekends." Because 26.11.2011 is Saturday.
Where is the error and what am I doing wrong?
Perhaps the iCustom indicator code does not lend itself to... There is too little information in your question to answer.
Hello, there is a function:
But it doesn't work for some reason. It is called in the EA right at the beginning after int start() as follows:
The Expert Advisor is loaded successfully in the Log and Experts tabs, and nothing else appears. Although it should say, "We do not trade on weekends." Because 26.11.2011 is Saturday.
Where is the error and what am I doing wrong?
Today is Saturday - a day off. You start Expert Advisor, initialization occurs, but since it is day off and there is no tick, the start function is not started (i.e. Trade() is not called.). To check if it works correctly, you need to stick the call of this function in the initialization block, or test it in the tester.
The indicator draws support and resistance lines, which it does during visualisation. The indicator itself gives a signal LT_1 == 1 or -1 when crossed.
Then do not bother at all - just move the code of the indicator to the Expert Advisor as it is to fulfill the trading criteria and that's all - then in the board, according to these transferred trading conditions with this indicator, you open positions through the Expert Advisor and that's it ...