[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 753
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
Please advise what the catch is:
1) I fill a two-dimensional array with the time of formation of the ZigZag extremum and the extremum value itself.
2) Filling the second array with ones or twos depending on whether the extremum corresponding to a given element is a local maximum or minimum.
3) I output the results through Alert.
but in a place where 1 or 2 should be printed zeros are always printed.
What's the catch?!?
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
string TimeSave1[100][2], TimeSave2[100][2];
double A[], B[];
double Number_of_extremum[];
extern string Currency = "EURUSD";
+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
int k;
k=0;
double date;
int status;
for(int shift = 0; shift <= Bars-1; shift++)
{
date = iCustom(NULL, 0, "ZigZag", 12, 5, 3, 0, shift);
//----------------------------------------------------
if(date > 0)
{
TimeSave1[k][0]=TimeToStr(Time[shift]);
TimeSave1[k][1]=date;
k++;
}
}
//====================================================
for (int u=1;u<=k;u++)
{
if (StrToDouble(TimeSave1[u][1])<=StrToDouble(TimeSave1[u-1][1]))
{
Number_of_extremum[u]=1;// значит под номером u - нашли min
}
else
if (StrToDouble(TimeSave1[u][1])>=StrToDouble(TimeSave1[u-1][1]))
{
Number_of_extremum[u]=2;// значит под номером u - нашли max
}
}
//====================================================
for (int j=1;j<10;j++)
{
Alert("время== ",TimeSave1[j][0], " значение== ", TimeSave1[j][1], " max/min== ", Number_of_extremum[j]);
}
//----
return(0);
}
//+------------------------------------------------------------------+
And one more clarification:
how to compare dates and times in mql (for example, I need to determine which vertex of ZZ was formed earlier - for this I need to compare the time of their formation...)
Didn't look at the rest - just got here...
Friends, a question:
Faced this problem:
the indicator outputs some information via Alert.
But, gradually the Alert output field accumulates too much "crap"...
When I will start the indicator again, will it be possible to erase all old records in Alert?
Thanks in advance.
P.S.
Please comment on my post earlier (why null values are displayed instead of 1 and 2)
I didn't find it on the forum...
Question - is it possible to change the comment on the order? Well, when OrderSend() operation I put into the comment some value of "OrderNotModify", and doing further actions with this order, for example partial closing, I change OrderComment to "OrderIsModify"... or not?
Can you tell me what the catch is:
Array is filled from 0, but here the 0th index is skipped, and we fill from the 1st, and
The array is filled from 0, but here the 0th index is skipped and filled from the 1st, and
I don't quite understand your comment.
1) k - at start - is not zero! k = the number of ZigZag vertices we have detected at a certain depth of history!
2) "so, it always work [1][1]>=[0][1]" - why does it always work? if previous element of TimeSave1 array > next element, it won't work.
repeat, please, what you meant to say.
didn't quite understand your comment.
1) k - at start - is not equal to zero! k = the number of ZigZag vertices we have detected at a certain depth of history!
2) "so, it always work [1][1]>=[0][1]" - why does it always work? if previous element of TimeSave1 array > next element, it won't work.
Please tell me again what you want to say.
I understand k. This is what I don't understand.
in the right part
is it possible to change the order comment?
Looks like no.
so... it looks like it's the heat... And it's affecting my compiler too :)
see, I need to run through an array that records the date of formation of the max/min of the ZigZ and the value of that max/min.
I need to understand, in fact, which vertex of ZZ is a minimum and which is a maximum.
To do this I compare the next highest point of ZZ to the previous one.
If the consecutive top is larger, then it is a top.
if it is smaller, it is a trough.
Depending on whether it is a vertex or a trough, we add 1 or 2 to an element of another array, respectively.
I am curious about this, WHERE the error could be!!!!
I want to be able to calculate fiba levels based on two known values:
Fib zero level corresponds to 1.2807, level 23.6 corresponds to 1.2838.
We need to find the other 38.2, 50.0, 61.5, 100.0 levels and what prices they correspond to.
I couldn't even find any connection between 1.2807 and 1.2838 to understand the principles of
of finding all the other values.
Please, tell me, somebody ... :)
Has anyone met the indicator to see the time of the bar opening in a low TF, not how much time is interesting, and to draw the marks on the chart where the bar started and where it ended
I think so. The code is not optimized, but it does draw what I would like to see.