Diagonal Line
- Coding Problem
- Draw diagonal line in MQL4
- Erasing lines
y = m*x + b
How much information do you have about your diagonal line?
Using the line equation above, you would be comparing your close price to y. CLOSE > y is above the line, CLOSE < y is below the line.
m = ((price at beginning of diagonal line) - (price at end of diagonal line)) /(number of bars crossed by the line)
b is probably just 0.
x = bar in question (the one with the CLOSE price you want to test)
I don't have enough information to put it into code. What is this diagonal line you speak of? Is it an indicator?
I need example code that shows how to calculate the position of the CLOSE in relation to a diagonal line. In other words ... if I have a diagonal line (not horizontal) I need to calculate whether the bar closed above or below the diagonal line.
ObjectGetValueByShift(objName, shift)returns the price of the line at bar shift. Compare to Close[shift]
returns the price of the line at bar shift. Compare to Close[shift]
This is what I'm looking for ... thanks