Login Page - Create Account

Support Board


Date/Time: Fri, 29 Nov 2024 23:51:16 +0000



[Programming Help] - 2 conditions in the same cell

View Count: 477

[2023-01-06 15:23:48]
Hopeman - Posts: 166
Dear support,

I am trying to give two separate input conditions for the same cell and Sierra Chart only recognizes one,
My question is if it is possible to combine two different conditions in the same cell since I have tried different variations and Sierra Chart only recognizes the first one, thanks
These are the formulas First
=AND(CROSSFROMBELOW(E3:E5,AB3:AB5),AND(CROSSFROMBELOW(AM3:AM5,AW3:AW5),O3,Q3)

Second =AND(CROSSOVER(E3:E5,AB3:AB5),OR(AM3:AM5,AW3:AW5),O3,Q3)


First and second combined =IF(AND(CROSSFROMBELOW(E3:E5,AB3:AB5),AND(CROSSFROMBELOW(AM3:AM5,AW3:AW5),O3,Q3)),IF(AND(CROSSFROMBELOW(E3:E5,AB3:AB5),OR(AM3:AM5,AW3:AW5),O3,Q3)), "", ""), "")


I have tried several combinations and I still do not give the solution. I understand that the program can only read one formula,

Thank you
[2023-01-06 18:01:15]
John - SC Support - Posts: 36350
Your ANDs and your ORs are not placed correctly.

The AND and OR take a comma delimited set of items and determines the individual results and then tests against the individual items. Such as AND(Condition1, Condition2) where both Condition1 and Condition2 need to be True for the AND to be True. But you have the AND for a single item, which is not needed and will not work.

For example, your Formula 1 should be the following:
=IF(AND(CROSSFROMBELOW(E3:E5,AB3:AB5), CROSSFROMBELOW(AM3:AM5,AW3:AW5)),O3,Q3)
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-01-06 19:37:35]
Hopeman - Posts: 166
Sierra chart does not recognize the formulas described with any of the variations described, it must have a different language than excel since I cannot get it to recognize the order or the formula described


=IF(AND(CROSSFROMBELOW(E3:E5,AB3:AB5), CROSSFROMBELOW(AM3:AM5,AW3:AW5)),O3,Q3)),IF(AND(CROSSFROMBELOW(E3:E5,AB3:AB5),CROSSFROMBELOW(AM3:AM5,AV3:AV5)),O3,Q3))
Date Time Of Last Edit: 2023-01-06 19:40:28
[2023-01-06 23:08:03]
John - SC Support - Posts: 36350
You need to nest the IF statements. right now you have two separate IF statements that will not work (it would not work in Excel either). The nesting of IF statements works exactly the same in Sierra Chart as it does in Excel. You need to do the following:
=IF(AND(CROSSFROMBELOW(E3:E5,AB3:AB5), CROSSFROMBELOW(AM3:AM5,AW3:AW5)),O3,IF(AND(CROSSFROMBELOW(E3:E5,AB3:AB5),CROSSFROMBELOW(AM3:AM5,AV3:AV5)),O3, Q3))
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-01-10 19:49:18]
Hopeman - Posts: 166
Thanks John, you helped me!
Date Time Of Last Edit: 2023-01-10 19:54:45
[2023-01-13 15:27:13]
Hopeman - Posts: 166
Hello, I'm trying to create an exit condition that takes into account the formula described here in ticks from the same bar or the next one, the problem is that it doesn't read the exit and I don't want to activate more than one entry per bar, I've tried.

=(E3<AB5),$J$10/$J$56<-8) and some other variable but I can't find the solution and I don't know if it is possible to exit in the same bar or in the next one if there is a discount in ticks.

I've been going around for a couple of days and I can't find the solution. The formula with different conditions is the one attached here. What I'm looking for is that if no condition is met and the price is returned within the VA, if there are less than 8 tiks the ticket it closes, would you be so kind as to help me find the solution,

=AND(OR(CROSSFROMBELOW(E3:E5,AC3:AC5),CROSSFROMBELOW(AM3:AM5,AX3:AX5)), OR(CROSSFROMBELOW(AM3:AM5,AX3:AX5),OR(CROSSFROMBELOW(AM3:AM5,AV3:AV5),OR(CROSSFROMBELOW(AM3:AM5,AW3:AW5),OR(CROSSFROMBELOW(E3:E5,AC3:AC5),$J$10/$J$56<-8)))))

Best Regards

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

Login

Login Page - Create Account