monolisa wrote:I think an indi could be used to draw the lines easily (master coder TRO/blubbb/whoever might be able to help developing the indi). What you need are:

1. Time/price of the lower left corner of the square (t1/p1)

2. The time period of the square (in bars) (b)

You can then determine the square's right upper corner, which is the intersection of a 45* trendline from the starting point and a vertical line at the end of the time period. Let's say the price difference is k (in pips).

Now you have the co-ordinates of the 2 corners. Using simple calculations you can find out the 2 co-ordinates of the angled trendlines. For example, these are the co-ordinates of a 30* trendline (uptrend):

Time(lower left corner) = t1

Price(lower left corner) = p1

Time(upper right corner) = t1 + b - 1

Price(upper right corner) = p1 + tan(30*pi/180) * k / 1000

For angles above 45* it's the number of bars that varies. Here's an example of a 60* trendline (uptrend):

Time(lower left corner) = t1

Price(lower left corner) = p1

Time(upper right corner) = t1 + ROUND(b * (tan(60*pi/180))^-1) (I round it because time bar could not be divided)

Price(upper right corner) = p1 + k / 1000

Here are the DOP lines I have manually drawn using the calculation methods above.

Lis

This has already been created. MO has a copy to test to make sure it's doing what he wants. Once he confirms it's working and that it will help rather than hinder. He'll post.

dee