Conversion of RSI CCi MT4 into PTC

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #57562 quote
    Daniel Tan
    Participant
    New

    Hi Everyone,

    I have a MT4 indicator that involves RSI and CCI.. Pretty advance.. I was wondering if anyone can help to convert it to PTC… I have the MQ4 codes.

    2018-01-07-16.14.54.jpg 2018-01-07-16.14.54.jpg
    #57564 quote
    robertogozzi
    Moderator
    Master

    Please update your country flag in your profile. Thanks.

    These are the guidelines to get free conversions https://www.prorealcode.com/topic/free-conversion-mt4-indicators-mql4/

    You should supply a more detailed description and attach the .MQ4 files involved.

    Roberto

    #57597 quote
    Daniel Tan
    Participant
    New

    My bad. Attached is the Mq4 file. This gives the signals to direct up and downwards trend reversal on the difference in RSI and CCI oscillator.

    EATA.mq4
    #57757 quote
    Nicolas
    Keymaster
    Master

    This indicator is repainting itself, are you aware of this behavior? The oscillator is not accurate as the information given in the past could change in the future, so you always get a perfect view of the situation of the past while it was not.

    Are you sure you want it to be converted? As it will not look the same at all in ProRealTime.

    #58797 quote
    Daniel Tan
    Participant
    New

    Yes. I am aware of the repainting. It can be used as a trend filter.

    #58807 quote
    Nicolas
    Keymaster
    Master

    Ok but the way it looks on MT4 will has nothing to be with the translated version, since prorealtime read only the price series only once.. I’ll do it, but I don’t feel you’ll like it 🙂

    #58953 quote
    Daniel Tan
    Participant
    New

    Hi Nicolas,

     

    I am not sure about how you meant by “read only the price series only once” but i appreciate your effort. If you do think there are improvement to it, can update it as well. =)

    #58963 quote
    Nicolas
    Keymaster
    Master

    MT4 version is repainting itself because the data serie is continuously read by a loop at each new tick received, so the code already “know” by advance what the future look like and can change its value according to it. It is a common behavior for metatrader indicator, depends of how it was coded though..

    Because PRT only read once the whole price history, “repainting” indicator doesn’t exist, that’s why you’ll get a very different picture between the 2 versions.

    #58967 quote
    Nicolas
    Keymaster
    Master

    I only code the blue line from the original indicator into ProRealTime, as you can state in the attached picture, they look very different. Because PRT doesn’t know what the future price is.

    no-repainting-indicator-mt4.png no-repainting-indicator-mt4.png
    #59178 quote
    Daniel Tan
    Participant
    New

    Can we take a look at the red line with the crossing.

    #59210 quote
    Nicolas
    Keymaster
    Master

    Sorry, but it leads no where. The calculation made in MQ4 takes values from CCI and RSI from the future by doing loops in the past. I spent a lot of time today trying to reproduce this behavior and results are far from being reliable. This is in the code in its current state (from many other trials I did today): (not to be used in real trading).

     

    defparam calculateonlastbars=1000
    
    lookback=20
    CCIper=14
    RSIper=14
    MaPeriod=2
    koef=8
    //arrows=1 //1 = true , 0 = false
    
    if(koef>8 or koef<0) then
    koef=8
    endif
    
    llimit = lookback
    typical = (high[0] + low[0] + close[0])/3
    for i = llimit-3 downto 0 do
    //typical = (high[i] + low[i] + close[i])/3
    a = cci[CCIper](typical)[i]-rsi[RSIper](typical)[i]
    b = rsi[RSIper](typical)[i]-cci[CCIper](typical)[i]
    if(i-1>=0) then
    a1 = cci[CCIper](typical)[i-1]-rsi[RSIper](typical)[i+1]
    b1 = rsi[CCIper](typical)[i-1]-cci[RSIper](typical)[i+1]
    endif
    if(i-2>=0) then
    a2 = cci[CCIper](typical)[i-2]-rsi[RSIper](typical)[i+2]
    b2 = rsi[CCIper](typical)[i-2]-cci[RSIper](typical)[i+2]
    endif
    if(i-3>=0) then
    a3 = cci[CCIper](typical)[i-3]-rsi[RSIper](typical)[i+3]
    b3 = rsi[CCIper](typical)[i-3]-cci[RSIper](typical)[i+3]
    endif
    if(i-4>=0) then
    a4 = cci[CCIper](typical)[i-4]-rsi[RSIper](typical)[i+4]
    b4 = rsi[CCIper](typical)[i-4]-cci[RSIper](typical)[i+4]
    endif
    if(i-5>=0) then
    a5 = cci[CCIper](typical)[i-5]-rsi[RSIper](typical)[i+5]
    b5 = rsi[CCIper](typical)[i-5]-cci[RSIper](typical)[i+5]
    endif
    if(i-6>=0) then
    a6 = cci[CCIper](typical)[i-6]-rsi[RSIper](typical)[i+6]
    b6 = rsi[CCIper](typical)[i-6]-cci[RSIper](typical)[i+6]
    endif
    if(i-7>=0) then
    a7 = cci[CCIper](typical)[i-7]-rsi[RSIper](typical)[i+7]
    b7 = rsi[CCIper](typical)[i-7]-cci[RSIper](typical)[i+7]
    endif
    if(i-8>=0) then
    a8 = cci[CCIper](typical)[i-8]-rsi[RSIper](typical)[i+8]
    b8 = rsi[CCIper](typical)[i-8]-cci[RSIper](typical)[i+8]
    endif
    next
    
    if koef=8 then
    tt1max=a+a1+a2+a3+a4+a5+a6+a7+a8
    tt2min=b+b1+b2+b3+b4+b5+b6+b7+b8
    endif
    
    bull = average[MaPeriod](tt1max)
    bear = average[MaPeriod](tt2min)
    
    return bull coloured(0,191,255) style(line,2), bear coloured(255,0,0) style(line,2)
    
    Daniel Tan thanked this post
    #59227 quote
    Daniel Tan
    Participant
    New

    Thanks Nicolas. Really appreciate the effort in testing this out.

    #106533 quote
    Aziz5
    Participant
    New

    Hi

    How can I get the blue line just as an independent indicator convert it to MQL4 and Cs  please

    no-repainting-indicator-mt4.png no-repainting-indicator-mt4.png
    #106536 quote
    Vonasi
    Moderator
    Master

    Aziz5 – Welcome to the forums.

    These forums are dedicated to ProRealCode and the ProRealTime platform. Conversion to ProRealCode is carried out for free but translation to any other language is not. You can request a paid for conversion by clicking on the link under ‘Help’.

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

Conversion of RSI CCi MT4 into PTC


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Daniel Tan @daniel_tan Participant
Summary

This topic contains 13 replies,
has 5 voices, and was last updated by Vonasi
6 years, 5 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/07/2018
Status: Active
Attachments: 4 files
Logo Logo
Loading...