Pro back-testing bullish / bearish heikin-ashi simple signal / variable

Viewing 3 posts - 16 through 18 (of 18 total)
  • Author
    Posts
  • #201259 quote
    JS
    Participant
    Senior

    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.

    jonpt88 thanked this post
    #201287 quote
    jonpt88
    Participant
    New
    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.
    #201306 quote
    JS
    Participant
    Senior

    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.

    // 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
    
    jonpt88 thanked this post
Viewing 3 posts - 16 through 18 (of 18 total)
  • You must be logged in to reply to this topic.

Pro back-testing bullish / bearish heikin-ashi simple signal / variable


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
jonpt88 @jonpt88 Participant
Summary

This topic contains 17 replies,
has 3 voices, and was last updated by JS
3 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/31/2022
Status: Active
Attachments: 1 files
Logo Logo
Loading...