Range Rule bias RSI

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #205705 quote
    yas
    Participant
    Junior

    Hi Guys

    Need bit of help on my code i am trying to code this indicator using RSI but i am getting the following error on the code when trying to upload to the pro real time

    error is postive integer field expected with rsi

    here is the code

    //settings
    rsiperiod=RSI[14](close)
    rsios=30//oversold level
    rsiob = 80 //overbrought Level
    rsisupport=40//rsi bulishsupport level
    rsisell=60//rsi bearish support level
    rsisellsup=50//rsi bear market support
    // end of settings
    rangeBias = 0 //0=bullish, 1=strong bullish, 2=bearish, 3=strong bearish
    if rangebias=0 then
    lo=40
    mid=60
    hi=80
    elsif rangebias=1 then
    lo=54
    mid=65
    hi=85
    elsif rangebias=2 then
    lo=35
    mid=55
    hi=75
    elsif rangebias=3 then
    lo=30
    mid=50
    hi=70
    else
    lo=40
    mid=60
    hi=80
    endif
    source=customclose
    irsi=rsi[rsiperiod](source)
    if irsi<=lo then
    r=0
    g=255
    elsif irsi <= mid then
    r=255
    g=255
    elsif irsi <= hi then
    r=255
    g=165
    else
    r=255
    g=0
    endif
    return irsi coloured(r,g,0)

     

    anyone can help please

    #205706 quote
    yas
    Participant
    Junior

    can some one help me with this code error please

    #205708 quote
    robertogozzi
    Moderator
    Master

    You posted your request at 12:33, now it’s 12:43 and you are urging a reply.

    You will get one, as soon as someone is available. Be patient, please 🙂

    #205709 quote
    JC_Bywan
    Moderator
    Master

    Hi,

    Topic moved from french probuilder forum to english probuilder forum, to comply with forum rules in yellow box below, appearing just before the “submit” button.

    You have this line:

    irsi=rsi[rsiperiod](source)

    requiring your rsiperiod to be an integer,

    but at the beginning, it is defined as:

    rsiperiod=RSI[14](close)

    which is not an integer…

    So depending on what you’re trying to achieve, either you make rsiperiod an integer to start with, or you use something else which is an integer in your irsi definition

    #205711 quote
    robertogozzi
    Moderator
    Master

    The issue is in line 2, since  is assigned an RSI value, instead of a number of periods.

    It should read:

    rsiperiod=14
    #205712 quote
    robertogozzi
    Moderator
    Master

    Two replies in a row is better than one!

    JC_Bywan thanked this post
    #205713 quote
    yas
    Participant
    Junior

    Thank you much appreciated many thanks again for speedy response

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

Range Rule bias RSI


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
yas @yas Participant
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by yas
3 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 12/13/2022
Status: Active
Attachments: No files
Logo Logo
Loading...