What is the code for drawing one Horizontal Line at a specific price??
I am new in all this of programming, i am trying to build my first indicator.
I need that the indicator, draws a single line at opening price for the first minute candle of each day, at 00:01 (t=1), and erase it at 23:59 (t=1439).
i need that the price for this line does not change in time until 23:59 when it shall be erased, and reinitiate again at 00:01 for the next day.
Read about these functions.
https://docs.mql4.com/objects/ObjectCreate
https://docs.mql4.com/objects/ObjectSet
Try to do it first, then post your code if it simply isn't working for you.
The only way to learn is to try and do it.
for(int iBar = Bars - 1 - IndicatorCounted(); iBar >= 0; iBar--){ int iBarD1 = iBarShift(NULL, PERIOD_D1, Time[0]); buffer[iBar] = iOpen(NULL, PERIOD_D1, iBarD1); }
OP said he "need that the indicator" What he asked for can be done with a single buffer. No objects necessary. Indicators use buffers not objects when at all possible.
I would have thought it to be simpler to either use a trend line or horizontal line object in this case, draw it once and then move it at the first tick of the day.
Hello,
I am new in all this of programming, i am trying to build my first indicator.
I need that the indicator, draws a single line at opening price for the first minute candle of each day, at 00:01 (t=1), and erase it at 23:59 (t=1439).
i need that the price for this line does not change in time until 23:59 when it shall be erased, and reinitiate again at 00:01 for the next day.
Can anybody help me with this code?
thank you in advance!!