The program allocates points to a running total when the conditions of an indicator are reached
Scores are between 1-5 as follows:
1 – Ranging Market. Do not trade
2 – Trend may be forming. Do not trade
3 – Early stages of trend. Monitor
4 – Trending Market. Trade
5 – Strong Trending Market. Trade
// Declaration of Indicators
Indicator2 = ADX[14]
Indicator3 = DIplus[14](close)
Indicator4 = DIminus[14](close)
Indicator5 = SAR[0.02,0.02,0.2]
Indicator6 = Average[10](close)
Indicator7 = ExponentialAverage[30](close)
Indicator8 = RSI[14](close)
//Events
Event1 = Indicator2 >= 15
Event2 = close > Indicator5
//Price above SAR
Event3 = Indicator3 > Indicator4
//DI+ above DI-
Event4 = Indicator6 > Indicator7
//10SMA above 30EMA
Event5 = indicator2 >= 20
//ADX above 20
Event6 = indicator2 >= 25
//ADX above 25
Event7 = indicator8 <70
//RSI below 70
Event8 = close < Indicator5
//Price below SAR
Event9 = Indicator3 < Indicator4
//DI+ below DI-
Event10 = Indicator6 < Indicator7
//10SMA below 30EMA
Event11 = Indicator8 >30
//RSI above 30
// Detection of bullish and bearish engulfing lines
IF Event7 AND Event6 AND Event5 AND Event4 AND Event3 AND Event2 AND Event1 THEN
Score = 5
ELSIF Event7 AND Event5 AND Event4 AND Event3 AND Event2 AND Event1 THEN
Score = 4
ELSIF (Event7 AND Event4 AND Event3 AND Event2 AND Event1) THEN
Score = 3
ELSIF Event7 AND Event3 AND Event2 AND Event1 THEN
Score = 2
ELSIF Event11 AND Event6 AND Event5 AND Event10 AND Event9 AND Event8 AND Event1 THEN
Score = 5
ELSIF Event11 AND Event5 AND Event10 AND Event9 AND Event8 AND Event1 THEN
Score = 4
ELSIF Event11 AND Event10 AND Event9 AND Event8 AND Event1 THEN
Score = 3
ELSIF Event11 AND Event9 AND Event8 AND Event1 THEN
Score = 2
ELSIF Event1 THEN
Score = 1
ELSE
Score = 0
ENDIF
RETURN Score