Login Page - Create Account

Support Board


Date/Time: Thu, 27 Feb 2025 12:38:01 +0000



Formula Help

View Count: 501

[2021-06-30 06:25:01]
User486817 - Posts: 83
hello,

if someone can help me it would be greatly appreciated. I have four total easy formulas. i think it may be a syntax error but i am too inexperienced to find it.

If the slope of ID5 and ID3 is already down, and in that condition, ID2 also goes down, that is a sell signal and vice versa.

DOWN

AND (AND((ID3.SG1[0] < ID3.SG1[-1]) , (ID3.SG1[-1] >= ID3.SG1[-2]))), AND((ID5.SG1[0] < ID5.SG1[-1]) , (ID5.SG1[-1] >= ID5.SG1[-2]))) , AND((ID2.SG1[0] < ID2.SG1[-1]) , (ID2.SG1[-1] >= ID2.SG1[-2])))

UP

AND (AND((ID3.SG1[0] > ID3.SG1[-1]) , (ID3.SG1[-1] <= ID3.SG1[-2])) , AND((ID5.SG1[0] > ID5.SG1[-1]) , (ID5.SG1[-1] <= ID5.SG1[-2])) , AND((ID2.SG1[0] > ID2.SG1[-1]) , (ID2.SG1[-1] <= ID2.SG1[-2])))

Then, if the slope of ID5 is down, and in that condition, ID2 slopes down, that is a sell signal and vice versa.

DOWN

AND (AND((ID5.SG1[0] < ID5.SG1[-1]) , (ID5.SG1[-1] >= ID5.SG1[-2]))) , AND((ID2.SG1[0] < ID2.SG1[-1]) , (ID2.SG1[-1] >= ID2.SG1[-2])))

UP

AND (AND((ID5.SG1[0] > ID5.SG1[-1]) , (ID5.SG1[-1] <= ID5.SG1[-2])) , AND((ID2.SG1[0] > ID2.SG1[-1]) , (ID2.SG1[-1] <= ID2.SG1[-2])))

i hope someone kind finds this.

kindest regards,
[2021-06-30 12:04:03]
Sawtooth - Posts: 4176
All of the formulas require that all of the lines change slope in the same bar.

If some have already changed slope, and then one has changed slope, the formulas would look like this
(after also removing the unnecessary ANDs and parentheses) :

Down:
=AND( ID3.SG1[0] < ID3.SG1[-1] , ID5.SG1[0] < ID5.SG1[-1] , ID2.SG1[0] < ID2.SG1[-1] , (ID2.SG1[-1] >= ID2.SG1[-2])
Up:
=AND( ID3.SG1[0] > ID3.SG1[-1] , ID5.SG1[0] > ID5.SG1[-1] , ID2.SG1[0] > ID2.SG1[-1] , (ID2.SG1[-1] <= ID2.SG1[-2])

Down:
=AND( ID5.SG1[0] < ID5.SG1[-1] , ID2.SG1[0] < ID2.SG1[-1] , ID2.SG1[-1] >= ID2.SG1[-2])
Up:
=AND( ID5.SG1[0] > ID5.SG1[-1] , ID2.SG1[0] > ID2.SG1[-1] , ID2.SG1[-1] >= ID2.SG1[-2])
[2021-07-01 01:32:39]
User486817 - Posts: 83
thank you tomglib. your help is greatly appreciated. i hope all is well with you and i hope you achieve what it is you want.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account