RSI divergence

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #151153 quote
    Oliviertrader2020
    Participant
    Average

    Hello,

    I’m trying to create an algorithm based on the divergences.
    I tried to call divergence indicators (RSI or MACD) found on the site but it doesn’t work, I think the error comes from my code.

    For example I tried to call the indicator “DivergenceRSIWithLookback”, and to indicate as conditions to buy if the indicator is > to 0 and the close is > to the highest of the previous candle, or to short if the indicator is < to 0 and the close is < to the lowest of the previous candle, But this does not give any trade. I removed the conditions close >high [1] and close

    I removed the variables from the indicator to integrate them directly into the code but it still didn’t work. It still doesn’t work.

    Here are the indicator and the strategy in itf.
    Can someone help me solve this problem? 🙂

    DEFPARAM Cumulateorders = False
    DEFPARAM FLATAFTER = 214400
    DEFPARAM FLATBEFORE = 000100
     
    // Conditions pour ouvrir une position acheteuse
    indicator1 = Call "DivergenceRSIWithLookback"
    c1 = (indicator1 > 0)
    //c2 = close> high[1]
     
    IF c1  AND Not OnMarket THEN
    BUY 1 CONTRACTS AT MARKET
    ENDIF
     
    // Conditions pour ouvrir une position vendeuse
    indicator2 = Call "DivergenceRSIWithLookback"
    c3 = (indicator1 < 0)
    //c4 = close < low[1]
     
    IF c3 AND Not OnMarket THEN
    SELLSHORT 1 CONTRACTS AT MARKET
    ENDIF
     
     
    SET STOP$LOSS 500
    SET TARGET$PROFIT 500
    Divergence-RSI-with-lookback-1.itf Divergence-Rsi-1.itf
    #151194 quote
    Nicolas
    Keymaster
    Master
    • Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.

    I or someone else, will answer in your other topic: https://www.prorealcode.com/topic/bot-with-rsi-divergence/

    Please respect the posting rules.

    #151200 quote
    GraHal
    Participant
    Master

    I tried for you, but neither the Algo in text above nor the .itf will run in backtest even.

    There are several issues thrown up with error messages that need sorting.

    does not give any trade

    Do you even get the Algo to run correctly in backtest??

    Please post a screen shot of backtest results.

    #151205 quote
    GraHal
    Participant
    Master

    Mods

    I reckon this post should be deleted … to save confusion.

    In Olivier duplicate post there is now a working Algo showing results.

    #151231 quote
    Oliviertrader2020
    Participant
    Average

    Sorry Nicolas, I didn’t know this rule. I would be careful in the future.

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

RSI divergence


ProOrder: Automated Strategies & Backtesting

New Reply
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/21/2020
Status: Active
Attachments: 2 files
Logo Logo
Loading...