Pro back-testing bullish / bearish heikin-ashi simple signal / variable
Forums › ProRealTime English forum › ProOrder support › Pro back-testing bullish / bearish heikin-ashi simple signal / variable
- This topic has 17 replies, 3 voices, and was last updated 3 years ago by
JS.
-
-
09/23/2022 at 9:16 PM #201259
I’ve tried it for you but it’s not a good combination.
When I add the RSI, two of the three conditions must make a crossing at the same time because xClose must cross over the average and at the same time the RSI must cross over 20.
The RSI is not a good addition here as a third condition.
1 user thanked author for this post.
09/24/2022 at 12:38 PM #201287If it is not too much to ask – could you just apply any third variable (MACD, RSI, as you deem fit) – for me to see how the code would look like such case. Thank you so much in advance for this and for all your replies before. Very very helpful and very much appreciated.
09/24/2022 at 4:36 PM #201306Hi @jonpt88
This is what the code could look like with a third condition.
I have used the example of the RSI here but as indicated the extra RSI condition is not an improvement.
Heikin Ashi + Average + RSI12345678910111213141516171819202122232425262728293031323334353637383940414243// Festlegen der Code-ParameterDEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviertOnce n=16// Heikin Ashi setuponce xOpen = openxClose = (open + close + high + low) / 4if barindex > 0 thenxOpen = (xOpen + xClose[1]) / 2endifxLow = min(low,min(xClose,xOpen))xHigh = max(high,max(xClose,xOpen))//Bullish = xClose > xOpenBearish = xClose < xOpenindicator2 = RSI[n](Close)// Bedingungen zum Einstieg in Long-Positionenindicator1 = Average[n](close)c1 = (Bullish AND Bearish[1]) and xClose Crosses Over indicator1 and indicator2 Crosses Over 20IF C1 THENBUY 1 CONTRACT AT MARKETENDIF// exit LONG trade on a Bearish candlestickc2 = (Bearish and xClose Crosses Under indicator1)IF c2 THENSELL AT MARKETENDIF// SHORT trades when switching from bullish to bearishc3 = (Bearish AND Bullish[1]) and xClose < indicator1 and indicator2 Crosses Under 80IF c3 THENSELLSHORT 1 CONTRACT AT MARKETENDIF// exit SHORT trade on a Bullish candlestickc4 = (Bullish and xClose Crosses Over indicator1)IF c4 THENEXITSHORT AT MARKETENDIF1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on 