Trigger = OBJ_HLINE;
That sets Trigger to an internal constant.
double Trigger =ObjectCreate("Trigger", OBJ_HLINE, 0, Time[0], Bid, 0, 0);
That sets Trigger to the return value of ObjectCreate(), which is a boolean. This is specified in the documentation:
https://www.mql5.com/en/docs/objects/objectcreate
To get the price, try something like this (in MQL5):
Print(StringFormat("price is [%.5f]", ObjectGetDouble(0, "elmo", OBJPROP_PRICE, 0)));
That sets Trigger to an internal constant.
That sets Trigger to the return value of ObjectCreate(), which is a boolean. This is specified in the documentation:
https://www.mql5.com/en/docs/objects/objectcreate
To get the price, try something like this (in MQL5):
Ah i see! Thanks, I have MQL4 as using MT4.. is there anything that would work for this in MT4?
Ah i see! Thanks, I have MQL4 as using MT4.. is there anything that would work for this in MT4?
cancel that, i managed to do it with this:
double Trigger = ObjectGetDouble(0,"Trigger",OBJPROP_PRICE,0);
thanks for your help !
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hey,
I have written the following code that describes a pin bar and a subsequent bar that closes above the pin bar to confirm it, I would like to control the EA taking these trades by having a horinzontal line on the chart named "trigger" that I can manually move to support and resistance levels. I have managed to get it to draw the line but am now struggling to get the EA to recognise the Hline when i refer to it with "High[2]>trigger".
I also tried this but that didn't work either:
Is there a way to achieve what I'm trying to do here?
Many thanks for any help!!