Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 01:18:27 +0000



Post From: Converting a Slope Study Alert into Buy/Exit

[2014-09-21 03:25:05]
Sawtooth - Posts: 3993
I think the formula is not considering equal slopes.

I would use a formula like this for signals at changes in the direction of slope:

OR(AND(ID1.SG2[-2]>ID1.SG2[-1],ID1.SG2>ID1.SG2[-1]),
AND(ID1.SG2[-2]<ID1.SG2[-1],ID1.SG2<ID1.SG2[-1]),
AND(ID1.SG2[-2]=ID1.SG2[-1],ID1.SG2>ID1.SG2[-1]),
AND(ID1.SG2[-2]=ID1.SG2[-1],ID1.SG2<ID1.SG2[-1]))

This can be shortened to:
OR(AND(ID1.SG2[-2]>=ID1.SG2[-1],ID1.SG2>ID1.SG2[-1]),
AND(ID1.SG2[-2]<=ID1.SG2[-1],ID1.SG2<ID1.SG2[-1]))

This will alert at every change in direction (up to down, down to up, equal to up, equal to down), and it should work for any bar type.
Date Time Of Last Edit: 2014-09-21 15:09:30