Algo not doing what its supposed to – why?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #105460 quote
    jebus89
    Participant
    Master

    Or am i missing something here?

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Conditions to enter short positions
    indicator1, ignored = CALL "hh ll(1) highlow(2) low/high"[15]
    c1 = (close > indicator1)
    
    indicator2 = RSI[4](close)
    c2 = (indicator2 > 70)
    
    
    indicator3 = RSI[4](close)
    c3 = (highest[10](indicator3[1] > indicator3))
    
    IF c1 AND c2 AND c3 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit short positions
    ignored, indicator4 = CALL "hh ll(1) highlow(2) low/high"[15]
    c4 = (close CROSSES UNDER indicator4)
    indicator5 = RSI[4](close)
    c5 = (indicator5 CROSSES UNDER 40)
    
    IF c4 OR c5 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    

    The HH / LL indicator:

    hil = highest[h1](close[1])
    lol = lowest[h1](close[1])
    
    RETURN HIL COLOURED(0,200,0) AS "HH",lol COLOURED(200,0,0) AS "LL"
    

     

     

    So its basicly saying:

    1. Price is higher than previous 15 highs

    2. RSI 4 is above 70

    3. RSI4 below the highest RSI4 for the past 10 bars.

     

    As u can see in the photo, price is above HH (highest high past 15 candles), RSI is above 70.

    But… RSI is above the highest RSI4 past 10 bars. Meaning it should not have taken the trade.

     

    Am i missing something here or is there something wrong with PRT?

    Edit: Sorry for a messy photo but the arrow to watch is the Yellow short-arrow.

    wrong.png wrong.png
    #105463 quote
    jebus89
    Participant
    Master

    I found the error, missing right paranthesis here:

     

    indicator3 = RSI[4](close)
    c3 = (highest[10](indicator3[1] ) <– (this one) > indicator3))

     

    Thread can be closed or whatever.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Algo not doing what its supposed to – why?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
jebus89 @jebus89 Participant
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by jebus89
6 years, 6 months ago.

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