i think that no one can help u without seeing your code
Alright then, the code is attached.
Basically what I want to know is when the price crossed a line of the Gann grid.
Alright then, the code is attached.
Basically what I want to know is when the price crossed a line of the Gann grid.
i was not looking to your code, but with
double ObjectGetValueByShift( | string name, int shift) |
https://docs.mql4.com/objects/ObjectGetValueByShift
you can access the value of an object/line at an specific bar.
if (Close[0]>ObjectGetValueByShift("GannLine",0) do something
can u explain a little bit more what u want, as i saw the indicator every 5 pips the price is crossing one of the lines
on second thought if u need tha values h.h l.h l_l h_l use OBjectGet()
//example double a = ObjectGet("Gann1",OBJPROP_PRICE1);
i was not looking to your code, but with
double ObjectGetValueByShift( | string name, int shift) |
https://docs.mql4.com/objects/ObjectGetValueByShift
you can access the value of an object/line at an specific bar.
if (Close[0]>ObjectGetValueByShift("GannLine",0) do something

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I have programmatically drawn a Gann Grid object using fractals. Now I want to detect if the price has crossed any of the grid lines. Can I do this in mql? If not, does anyone have a formula for Gann Grid I can use to derive this?