Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 06:23:26 +0000



Post From: Spreadsheet system for trading question about IF

[2014-04-14 05:12:56]
Sawtooth - Posts: 4120
To include conditions for a sell, you'll also need the same formula with all of the comparison operators reversed.
Since this would make a huge formula, it might be easier to divide it in cells in column H, then reference those cells in J26, like this:

H26: BuyA 2 lot
H27: =AND(AA3>AG3,AA4<AG4,AG3>AC3,AG3>AE3,AG3>AI3)
H28: BuyB 2 lot
H29: =AND(AA3>AI3,AA4<AI4,AI3>AC3,AI3>AE3,AI3>AG3)
H30: SellA 2 lot
H31: =AND(AA3<AG3,AA4>AG4,AG3<AC3,AG3<AE3,AG3<AI3)
H32: SellB 2 lot
H33: =AND(AA3<AI3,AA4>AI4,AI3<AC3,AI3<AE3,AI3<AG3)
H34: Buy 1 lot
H35: =AND(AA3>AC3,AA4<AC4,AC3>AE3,AC3>AG3,AC3>AI3,AO3>AQ3)
H36: Sell 1 lot
H37: =AND(AA3<AC3,AA4>AC4,AC3<AE3,AC3<AG3,AC3<AI3,AO3<AQ3)

J26:
=IF(OR(H27,H29,H31,H33),2,IF(OR(H35,H37),1,0))