I want to write an indicator to connect all the peak which meet my requirement (a little like ZigZag, but different for defining the peak); I write the codes as below, but the codes never work well, and I don;t know where something wrong exist.
the logic is very simple, but there must be some error about it, i mean when I attached it to chart, the line will show after a little time, 5 seconds or more, why not like zigzag(show immediately)?
anybody can give me some advice?
thanks.
Comparing doubles like this is prone to problems . . .
if(High_Refer_0 == High[x] && High_Refer_0-Low_Refer_0 >= Mini_Swing*Point_Adapted) //peak confirm if(High_Last_Time != Time[x]&& Show_Con == 0)
. . . read this thread and adjust your code: Can price != price ?
Comparing doubles like this is prone to problems . . .
. . . read this thread and adjust your code: Can price != price ?
I know your meaning thanks
the line which is draw by this code will show after a few seconds after it is attached to chart; maybe because there are too many bars, and the computing is so much, so it needs some time?
thanks
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want to write an indicator to connect all the peak which meet my requirement (a little like ZigZag, but different for defining the peak); I write the codes as below, but the codes never work well, and I don;t know where something wrong exist.
the logic is very simple, but there must be some error about it, i mean when I attached it to chart, the line will show after a little time, 5 seconds or more, why not like zigzag(show immediately)?
anybody can give me some advice?
thanks.