The issue with the code in identifying the pullback.

Jan 24, 2025
1
0
6
39
The issue with this code:

The code first verifies Condition 1 and starts checking candles to confirm Condition 2.

However, when it encounters a candle where the Low price is below the Threshold value, instead of evaluating and confirming Condition 2, it prints the following message:

1. It seems that the code does not allow a candle with a Low price below the Threshold to be properly evaluated. This causes Condition 2 to remain unconfirmed even when it is actually met.

2. The issue is that the evaluation of Condition 2 is not performed correctly for candles that meet the required criteria.



Examples:

• In one case, the code checks up to candle 8, but when it reaches candle 9 (which has a price below the Threshold), instead of confirming Condition 2, it prints the message `Condition 2: false`.

• In another example, the code checks up to candle 5, but when it reaches candle 6 (which has a price below the Threshold), again, the message `Condition 2: false` is printed.



Conclusion:

The code fails to properly evaluate and confirm Condition 2 for candles that meet the required criteria.
 

Attachments

  • pullback.txt
    6.6 KB · Views: 1

Enivid

Administrator
Staff member
Nov 30, 2008
19,368
1,553
144
Odesa
www.earnforex.com
Sorry, but I'm not sure why you expect the condition #2 to ever be met. You are finding the lowest low of the last 10 candles, then you subtract 10 points from it and try to find a low that below that among the same 10 candles. That's just mathematically impossible.