Bot with RSI divergence
Forums › ProRealTime English forum › ProOrder support › Bot with RSI divergence
- This topic has 18 replies, 5 voices, and was last updated 4 years ago by
Zigo.
-
-
11/08/2020 at 4:46 PM #149843
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.
Can someone help me solve this problem? 🙂
12345678910111213141516171819202122232425DEFPARAM Cumulateorders = FalseDEFPARAM FLATAFTER = 214400DEFPARAM FLATBEFORE = 000100// Conditions pour ouvrir une position acheteuseindicator1 = Call "DivergenceRSIWithLookback"c1 = (indicator1 > 0)//c2 = close> high[1]IF c1 AND Not OnMarket THENBUY 1 CONTRACTS AT MARKETENDIF// Conditions pour ouvrir une position vendeuseindicator2 = Call "DivergenceRSIWithLookback"c3 = (indicator1 < 0)//c4 = close < low[1]IF c3 AND Not OnMarket THENSELLSHORT 1 CONTRACTS AT MARKETENDIFSET STOP$LOSS 500SET TARGET$PROFIT 50011/08/2020 at 4:53 PM #149846PS : Sorry for the readability. I did use the add code function in the initial message, then when I modified it when I noticed the bug but the code continued to be displayed with the text. 🙂
11/09/2020 at 4:23 PM #14991911/10/2020 at 6:31 PM #150052Hello @Nicolas,
Yes the indicator returns signals as you can see in the screenshot.
I also tried with the indicator “DivergenceRSIopensource” and the result is the same.I also tried with the other indicators you shared on this page: https://www.prorealcode.com/topic/rsi-divergence/#post-23530 but there are still no trades triggered, whatever the asset or time unit.
Can you help me to program a divergence algorithm? 🙂
11/12/2020 at 8:49 AM #15021711/17/2020 at 12:52 AM #150728Hello Nicolas,
Here are the 2 indicators and the strategy in itf.
Thank you for your help.
11/19/2020 at 3:02 PM #150974Hello @Nicolas,
Indicators and strategy in itf can be found in the previous message.
Thank you for your help.11/22/2020 at 11:32 AM #151196You have wrongly called an indicator that don’t exist? The signals were not present? In any case, test your variables with GRAPH, it is the first step to debug a code that is malfunctioning.
PFA the itf file in order to get the complete code working (with indicator embedded).
1 user thanked author for this post.
11/22/2020 at 12:06 PM #151201Below is one error.
Maybe Nicolas fixed this in the .itf above … I’ll try Nicolas file.
123// Conditions pour ouvrir une position vendeuseindicator2 = Call "DivergenceRSIWithLookback"c3 = (indicator1 < 0)needs to be
123// Conditions pour ouvrir une position vendeuseindicator2 = Call "DivergenceRSIWithLookback"c3 = (indicator2 < 0) //Indicator2 not indicator 111/22/2020 at 12:10 PM #151202Nicolas code works fine … see attached
1 user thanked author for this post.
11/22/2020 at 8:17 PM #151240Evening,
I am working on a set up for this topic. What I have already is coupling of the signals on a target-price (TP).
In the attachment is every line a TP after a signal. Green lines for long trading, yellow lines for short trading.
11/22/2020 at 8:43 PM #15124211/22/2020 at 8:45 PM #15124411/22/2020 at 9:51 PM #151245is it just me!? 🙂
It looks perfectly focused if you view it through the bottom of your second bottle of wine. Don’t ask me how I know.
1 user thanked author for this post.
11/23/2020 at 12:03 AM #151251 -
AuthorPosts
Find exclusive trading pro-tools on