Pro back-testing bullish / bearish heikin-ashi simple signal / variable
- This topic has 17 replies, 3 voices, and was last updated 2 years ago by .
Similar topics:
Forums › ProRealTime English forum › ProOrder support › Pro back-testing bullish / bearish heikin-ashi simple signal / variable
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.
If 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.
Hi @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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
// Festlegen der Code-Parameter DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert Once n=16 // Heikin Ashi setup once xOpen = open xClose = (open + close + high + low) / 4 if barindex > 0 then xOpen = (xOpen + xClose[1]) / 2 endif xLow = min(low,min(xClose,xOpen)) xHigh = max(high,max(xClose,xOpen)) // Bullish = xClose > xOpen Bearish = xClose < xOpen indicator2 = RSI[n](Close) // Bedingungen zum Einstieg in Long-Positionen indicator1 = Average[n](close) c1 = (Bullish AND Bearish[1]) and xClose Crosses Over indicator1 and indicator2 Crosses Over 20 IF C1 THEN BUY 1 CONTRACT AT MARKET ENDIF // exit LONG trade on a Bearish candlestick c2 = (Bearish and xClose Crosses Under indicator1) IF c2 THEN SELL AT MARKET ENDIF // SHORT trades when switching from bullish to bearish c3 = (Bearish AND Bullish[1]) and xClose < indicator1 and indicator2 Crosses Under 80 IF c3 THEN SELLSHORT 1 CONTRACT AT MARKET ENDIF // exit SHORT trade on a Bullish candlestick c4 = (Bullish and xClose Crosses Over indicator1) IF c4 THEN EXITSHORT AT MARKET ENDIF |
Find exclusive trading pro-tools on