David Vieira Kurz: I want to draw a triangle between 3 ZigZag points. I already have the ZigZag Points. How can I draw the triangle between them?
This is what I got so far: ObjectCreate(0,"Foobar",OBJ_TRIANGLE,0,Time[0],p2,Time[25],p3); // looks like a ball, not a triangle?
| You need three coordinates (price and time.) You save the prices in your p0 .. p5 variables but don't save the corresponding time.
|
Thanks for your answer, @whroeder1.
I could solve the problem by doing following:
static int xxo = 0; static int xxo_p0 = 0; static int xxo_p1 = 0; ... for (xxo=0;xxo<100;xxo++) { OHLC = Open[xxo]+","+High[xxo]+","+Low[xxo]+","+Close[xxo]; Foobar = TimeToString(Time[xxo]); if(Low[xxo]==p0){ xxo_p0 = xxo; } if(High[xxo]==p1) { xxo_p1 = xxo; } ... ObjectDelete("Foobar"); ObjectCreate(0,"Foobar",OBJ_TRIANGLE,0,Time[xxo_p4],p4,Time[xxo_p3],p3,Time[xxo_p2],p2); // Looks okay now ObjectSetInteger(0,"Foobar",OBJPROP_COLOR,Green); ...
Have a nice day,
David
Why are you looking for the high/low. You already know the bar index, thus the bar time.
p0=iCustom(Symbol(),0,"zigzag",ExtDepth,ExtDeviation,ExtBackstep,0,i);
1) "i" is always 0 in my case.
2) I need the High/Low, because I want to draw the triangles on the extremes on the candles. Please apologize if I understand you wrong.
In the end it shall be a simple way to find Gartley Patterns.
This is how it looks right now:
Best Regards,
David
David Vieira Kurz: "i" is always 0 in my case. i=0; while(n<5){ : p0=iCustom(Symbol(),0,"zigzag",ExtDepth,ExtDeviation,ExtBackstep,0,i); : i++; | Absolutely not. |

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,
I want to draw a triangle between 3 ZigZag points. I already have the ZigZag Points. How can I draw the triangle between them?
This is what I got so far: