As part of a trading system that I am creating, I want to be able to enter a trade if the absolute difference between the current bar's close and the previous bar's close is greater than 2.5%.

If the current bar closed down more than 2.5% relative to the previous bar's close, go long.

If the current bar closed up more than 2.5% relative to the previous bar's close, go short.

The problem is that I do not know how to use the Drag-and-Drop (DnD) indicators to accomplish this.

a) I know that I have to set up a comparison between the current bar's close (i.e., Close) and the previous bar's close (i.e., Shift Series-1 Close).

b) I then have to divide the difference between the two closes by the previous bar's close to determine the price change. I then take the absolute value of the price change.

c) Once I know the price change in absolute terms, I can then compare it to a constant value of 2.5% to determine whether a trade should be entered.

In shorthand, these are the calculations:

If Input 1 (Close) < Input 2 (Shift Series -1 Close) AND

absolute value of (Input 1 - Input 2) / Input 2 > 2.5%,

GO LONG.

If Input 1 (Close) > Input 2 (Shift Series -1 Close) AND

absolute value of (Input 1 - Input 2) / Input 2 > 2.5%,

GO SHORT.

Help me use the DnD indicators to meet the objectives stated above.

Thanks.

#### Calculating Price Change Between Two Bars Using DnD

Posted By
davidfw1866
11 Years Ago

Rated 5 stars based on 1 vote.