yasParticipant
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
yasParticipant
Junior
can some one help me with this code error please
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 🙂
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
The issue is in line 2, since is assigned an RSI value, instead of a number of periods.
It should read:
rsiperiod=14
Two replies in a row is better than one!
yasParticipant
Junior
Thank you much appreciated many thanks again for speedy response