Support Board
Date/Time: Sun, 24 Nov 2024 02:44:51 +0000
Post From: Long Entry and Short Exit | Short Entry and Long Exit
[2024-07-08 07:35:26] |
User471063 - Posts: 7 |
I modified K1 and M1 i don't see any changes. Test / debug each conditions below add to H and all of them working 1,0 correctly. There are few adjustments for ATR average and Volume average I added study ATR 20 ID7.SG1@3, ID8.SG4@3 Relative volume to simplify our testcase. H10 for buy H20 for Sell returns 1,0 is there any way mirror these values to K and M as actual trigger or just use K3 =IF(H10 =1,1,0) and M3 =IF(H10 =1,1,0)? Answer to your previous question K1=0 and M1=0 to prevent immediate reversal. Concept: =OR( AND( E3 > B3, // Condition 1: Close price greater than open price F3 > AVERAGE(F4:F23) * 1.5, // Condition 2: Volume greater than 1.5 times the average volume of previous 20 periods ID4.SG1@3 > AVERAGE(ID4.SG1@4:ID4.SG1@23), // Condition 3: Average True Range (ATR) at the current point greater than the average ATR over previous 20 periods ID5.SG1@3 > ID6.SG1@3, // Condition 4: Short-term EMA (Exponential Moving Average) greater than long-term EMA K1 = 0, // Condition 5: Long entry signal (K) is 0 (indicating no active long entry) M1 = 0 // Condition 6: Short entry signal (M) is 0 (indicating no active short entry) ), AND( M1 = 1, // Alternative Condition 1: Short entry signal (M) is 1 (indicating an active short entry) E3 <= B3 * 0.94 // Alternative Condition 2: Close price less than or equal to 94% of the open price ) ) Test: buy =OR( AND( E3 > B3, F3 > ID8.SG4@3 * 1.5, ID4.SG1@3 > ID7.SG1@3, ID5.SG1@3 > ID6.SG1@3, K1 = 0, M1 = 0 ), AND( M1 = 1, E3 <= B3 * 0.94 ) ) Sell =OR( AND( E3 < B3, // Condition 1: Close price less than open price F3 > AVERAGE(F4:F23) * 1.5, // Condition 2: Volume greater than 1.5 times the average volume of previous 20 periods ID4.SG1@3 > AVERAGE(ID4.SG1@4:ID4.SG1@23), // Condition 3: Average True Range (ATR) at the current point greater than the average ATR over previous 20 periods ID5.SG1@3 < ID6.SG1@3, // Condition 4: Short-term EMA (Exponential Moving Average) less than long-term EMA K1 = 0, // Condition 5: Long entry signal (K) is 0 (indicating no active long entry) M1 = 0 // Condition 6: Short entry signal (M) is 0 (indicating no active short entry) ), AND( K1 = 1, // Alternative Condition 1: Long entry signal (K) is 1 (indicating an active long entry) E3 >= B3 * 1.05 // Alternative Condition 2: Close price greater than or equal to 105% of the open price ) ) =OR( AND( E3 < B3, F3 > ID8.SG4@3 * 1.5, ID4.SG1@3 > ID7.SG1@3, ID5.SG1@3 < ID6.SG1@3, K1 = 0, M1 = 0 ), AND( K1 = 1, E3 >= B3 * 1.05 ) ) is it possible create multiple studies in the H column either one study case will return signal for Buy or Sell it depending on the market conditions or do you want me to use separate sheet for switch cases? Thanks Abdul |