Build a simple indicators dashboard with prorealtime v10.3

Recently on forum, someone ask me how to build a dashboard with multiple indicators informations. While it is not possible with version 10.2, the new graphical instructions of the new prorealtime version 10.3 can build an informative dashboard with any useful information you can imagine. Let’s see how to build a simple one in this blog article.

A dashboard to rule them all

With an informative dashboard, you can “compile” a lot of informations in one place. It also mean that you don’t even need to add the bunch of indicators you need in your every day trading on chart. A simple dashboard indicator will take the place of all the other ones.

Let’s say you need to define the actual trend of the current timeframe, you only need to test if a fast moving average is above or below a slower one. This information could be compiled as a simple arrow on the bottom right corner of your screen, with no need of moving average on your chart. That’s the main purpose of a dashboard and I gonna give you some examples in the next paragraphs.

 

Important things to do first

Firstly, we define that we want to do graphical instruction only one time, on the last bar only (the actual one) with the drawonlastbaronly instruction ; otherwise, the prorealtime graphical engine will draw our dashboard on every bar instead while loading the whole data history and it will be the mess on your screen! 🙂

defparam drawonlastbaronly=true

Secondly, to draw things on screen we need X and Y coordinates. With prorealtime, these informations are stored in “barindex” for the X coordinate and in price for the Y one. So it’s pretty much easy to know in real time where to place our graphical components. But, because these coordinates are not absolute ones, we need to define an X offset to be sure that multiple components will not overlaid on other ones.

While we are zooming in on chart, less “barindex” will be visible and distance between them (between candlesticks) will widen. And because of the same behaviour or the barindex, while zooming out, more barindex will be visible and more candlesticks too, and distance between them will be very tight. Our X offset will reduce this effect, but can’t delete it completely. That’s how we have to deal with these no-absolute (no pixels ones!) coordinates .. when we want to align text on the same row.

Xoffset = 40

This parameter could be an external one that you can modify at will to have the best result on screen. It depends mainly of the quantity of candlesticks drawn on your chart window.

barindex drawtext

Another solution would be to write the label with the information in the same line, but the entire line would have the same colour (indicator label + information). Since I want to introduce you how to make a nice looking dashboard with different components, let’s keep it that way.

First example, oversold/overbought information of an oscillator

Let’s take the Commodity Channel Index (CCI) indicator and retrieve its overbought and oversold informations. If the oscillator is above 100, it’s overbought, under -100 = oversold, otherwise we only test if it is declining or rising and write it up on screen:

dashboard indicator prorealtime cci test

Here is the code for this first example :

//---CCI 
//label
DRAWTEXT("CCI",barindex-Xoffset,0.1,SansSerif,Bold,16)coloured(230,230,250)
//informations
if myCCI<-100 then
 DRAWTEXT("oversold",barindex-10,0.1,SansSerif,Bold,16)coloured(153,0,0)
elsif myCCI>100 then
 DRAWTEXT("overbought",barindex-10,0.1,SansSerif,Bold,16)coloured(0,153,0)
elsif myCCI>=myCCI[1] then
 DRAWTEXT("rising ▲",barindex-10,0.1,SansSerif,Bold,16)coloured(153,153,0)
elsif myCCI<=myCCI[1] then
 DRAWTEXT("declining ▼",barindex-10,0.1,SansSerif,Bold,16)coloured(153,153,0)
endif

The Y coordinate is near 0 because PRT don’t know in advance where you put your graphical component. By default, an indicator will always open at 0. So if you draw something at 1 or 10 on Y coordinate, you will not see it, unless you change yourself the scale of the indicator by hand.

 

Second example, add the current trend information

By comparing 2 simple moving average, a fast one over or below a slower one, we define if the current trend is bullish or bearish:

bullish trend prorealtime dashboard

Simple and effective code with a nice looking on chart!

//---Trend
//label 
DRAWTEXT("TREND:",barindex-Xoffset,-0.4,SansSerif,Bold,16)coloured(230,230,250)
//informations
if maFast<maSlow then 
 DRAWTEXT("BEARISH ■",barindex-10,-0.4,SansSerif,Bold,16)coloured(153,0,0)
else
 DRAWTEXT("BULLISH ■",barindex-10,-0.4,SansSerif,Bold,16)coloured(0,153,0)
endif

 

Adding a signal from the current above conditions

Simple condition for a signal:

  • if the CCI is rising and the trend is bullish, then it’s a buy signal
  • if the CCI is declining and the trend is bearish, it’s a sell signal

By adding some variables in our previous conditions, we don’t need to make the whole test once again:

//---CCI 
//label
DRAWTEXT("CCI:",barindex-Xoffset,0.1,SansSerif,Bold,16)coloured(230,230,250)
//informations
if myCCI<-100 then
 DRAWTEXT("oversold",barindex-10,0.1,SansSerif,Bold,16)coloured(153,0,0)
elsif myCCI>100 then
 DRAWTEXT("overbought",barindex-10,0.1,SansSerif,Bold,16)coloured(0,153,0)
elsif myCCI>=myCCI[1] then
 DRAWTEXT("rising ▲",barindex-10,0.1,SansSerif,Bold,16)coloured(153,153,0)
CCIstate = 1
elsif myCCI<=myCCI[1] then
 DRAWTEXT("declining ▼",barindex-10,0.1,SansSerif,Bold,16)coloured(153,153,0)
CCIstate = -1
endif

//---Trend
//label 
DRAWTEXT("TREND:",barindex-Xoffset,-0.4,SansSerif,Bold,16)coloured(230,230,250)
//informations
if maFast<maSlow then 
 DRAWTEXT("BEARISH ■",barindex-10,-0.4,SansSerif,Bold,16)coloured(153,0,0)
 TRENDstate = -1
else
 DRAWTEXT("BULLISH ■",barindex-10,-0.4,SansSerif,Bold,16)coloured(0,153,0)
 TRENDstate = 1
endif

I added the “CCIstate” and “TRENDstate” to store the conditions needed to draw the trades signals.

Now we can add our signals labels in the dashboard:

dashboard prorealtime

trade signals indicator

and the signals code:

//---Signals
//buy signal
if TRENDstate=1 and CCIstate=1 then 
 DRAWTEXT("Buy signal ▲",barindex-10,0.5,SansSerif,Bold,16)coloured(0,200,0)
elsif TRENDstate=-1 and CCIstate=-1 then
 DRAWTEXT("Sell signal ▼",barindex-10,0.5,SansSerif,Bold,16)coloured(200,0,0)
else
 DRAWTEXT("No signal, wait..",barindex-10,0.5,SansSerif,Bold,16)coloured(180,180,0)
endif

 

As usual, the complete code can be downloaded below this post. Hope you like it. If you need assistance to make your own dashboard with your own ideas, you can create a new forum topic and I’ll help you there.

Share this

  1. Willievs • 240 days ago #

    Hi

    I am using ProRealtime though IG but it loads version 10.2. How can I get it to load version 10.3. Also, does 10.3 support auto trading inside a candle?

    Regards

    Willie

    • Nicolas • 240 days ago #

      Hi, you can get PRT v10.3 directly through prorealtime.com website. The prorealtime.com trading brokerage don’t offer automatic trading sorry, it’s only possible with PRT-CFD or directly through IG. The PRT 10.3 version will come soon or late to IG, it will support the inside bar trading with the multitimeframe feature.

  2. Stef • 215 days ago #

    Hi @Nicolas. Has 10.3 been released yet? When I go to the prorealtime website I only get v10.3 beta still?

    • Nicolas • 215 days ago #

      Yes, it will be named Beta until its final release, but you can use this version. Because it is in continuous development, new features will come to this version, that’s why it is called “beta”.

  3. Dimi.A • 135 days ago #

    Nic, I tried adding the code to my chart and it keeps saying “Syntax Error An indicator code must end with keyword RETURN”.
    What have I done wrong?

  4. Nicolas • 135 days ago #

    Did you try with PRT 10.3? You can download the file from the article instead of copy/paste, to avoid syntax error problem.

    • Dimi.A • 135 days ago #

      Awesome, that solved it!

      How do I change
      maFast = average[7](close)
      maSlow = average[21](close)

      into EMA 13 and EMA 55 close?

      I tried changing it to:
      emaFast = average[13](close)
      emaSlow = average[55](close)
      but no luck!

  5. Sofitech • 124 days ago #

    Dans un dashboard, est-il possible de faire appel à la valeur d’un indicateur dans un timeframe défini, différent de celui de la fenêtre utilisée.

    Exemple : je trade en 70 ticks. Mais je veux afficher la valeur du RSI(14) du M5.

    • Nicolas • 124 days ago #

      Non, tant que nous n’aurons pas le support multitimeframe, cela ne sera pas possible. Ça arrive bientôt !

  6. JohnVS • 17 days ago #

    Hi Nicolas,

    Is there any development on this dashboard?

    Would love to see a a few things being added to it 

    rgds

    John

     

    • Nicolas • 17 days ago #

      This dashboard code is an example and can be adjusted to add any other indicators or price information you would find useful!

  7. JohnVS • 17 days ago #

    Yeah even with my poor skills in programming i succeeded in changing it to the RSI 🙂

    yaaay for me.

    But what i would like is there to put some more indicators in there.

    Like stochastic and the swingcounter which you are making now.

    Could you give me an axample how to add at least 1 more indicator so i try and put 1 or 2 more i like in there myself

    rgds

    John

     

    • Nicolas • 17 days ago #

      To add another indicator, you have to copy/paste the CCI example from the code and change it to your preferred indicator. Don’t forget to change the X/Y coordinates to not overlap the other indicator.

  8. JohnVS • 17 days ago #

    Nicolas,

     

    hahaha yeah i was afraid you was gonna say that 😀

    okay i will try my best 

    I probably get back to you 😛

    rgds

    John

  9. JohnVS • 17 days ago #

    Nicolas,

    Wow much to my surprise I managed to get another indicator on the dasboard 🙂

    Now i have a question to you regarding adding the swingteller as you made.

    Is it possible to get the current swing number on the dashboard? 

    I have been trying but for some reason i cant get it visable

    Thanks in advance again

    John

     

    • Nicolas • 17 days ago #

      Please make a whole new thread for this request in ProBuilder support forum.

  10. JohnVS • 2 days ago #

    Hey all,

    I’ve working on this Dashboard and it wasnt easy 😛 but here is what i have uptil now

    dont know if this the right way to post it but here goes

    for now it works best viewed on a daily screen witj 100 units to show

    defparam drawonlastbaronly=true
    //symbolen
    //■
    //▼
    //▲
    //—indicators
    myStochastic = stochastic[12,3](close)
    mashort = ExponentialAverage[8](close)
    mamiddle = average[50] (close)
    maLong = average[200] (close)

    rem Dynamische RSI
    DRAWTEXT(” Dyn. RSI :”,barindex-Xoffset-35,+0.4,SansSerif,Bold,12)coloured(0,0,0)
    periodmoy=50
    periodeRSI=12
    coeff=2
    monrsi=RSI[periodeRSI](close)

    ind = SQUARE(monrsi)
    ind1 = Average[periodmoy](monrsi)
    ind2 = Average[periodmoy](ind)

    variance = ind2 – SQUARE(ind1)
    ecart = SQRT(variance)

    UpBand = ind1 + coeff*ecart
    DownBand = ind1 – coeff*ecart

    if Monrsi>UPband then
    DRAWTEXT(” Overbought”,barindex-Xoffset-25,+0.4,SansSerif,Bold,12)coloured(0,200,0)
    elsif Monrsi crosses under Upband then
    DRAWTEXT(” Sell ▼”,barindex-25,+0.4,SansSerif,Bold,12)coloured(255,0,0)
    elsif Monrsi<downband then
    DRAWTEXT(” Oversold”,barindex-Xoffset-25,+0.4,SansSerif,Bold,12)coloured(255,0,0)
    elsif Monrsi crosses over Downband then
    DRAWTEXT(” Go Long ▲”,barindex-25,+0.4,SansSerif,Bold,12)coloured(0,200,0)
    elsif monrsi>=monrsi[1] then
    DRAWTEXT(” Rising ▲”,barindex-25,+0.4,SansSerif,Bold,12)coloured(0,200,0)
    elsif monrsi<=monrsi[1] then
    DRAWTEXT(” Decline ▼”,barindex-25,+0.4,SansSerif,Bold,12)coloured(255,0,0)
    endif

    //—adjust Xoffset
    if barindex>1000 then
    Xoffset = 1
    elsif barindex>=20000 then
    Xoffset = 1
    else
    Xoffset = 1

    //—Trend Short
    //label
    DRAWTEXT(“Short Sup/Res:”,barindex-Xoffset-8,+0.7,SansSerif,Bold,12)coloured(0,0,0)
    //informations
    a=round(mashort*100)/100
    if mashort<mashort[1] then
    DRAWTEXT(” BEAR ▼”,barindex+0.5,+0.7,SansSerif,Bold,12)coloured(255,0,0)
    Drawtext(“#a#”,barindex-Xoffset-1.35,+0.7,SansSerif,Bold,12)coloured(0,0,0)
    else
    DRAWTEXT(” BULL ▲”,barindex+0.5,+0.7,SansSerif,Bold,12)coloured(0,200,0)
    Drawtext(“#a#”,barindex-Xoffset-1.35,+0.7,SansSerif,Bold,12)coloured(0,0,0)
    endif

    //—adjust Xoffset
    if barindex>1000 then
    Xoffset = 1
    elsif barindex>=20000 then
    Xoffset = 1
    else
    Xoffset = 1

    //—Trend Middle
    //Label
    DRAWTEXT(“Middl Sup/Res:”,barindex-Xoffset-8,0.25,SansSerif,Bold,12)coloured(0,0,255)
    //informations
    b=round(mamiddle*100)/100
    if mamiddle<mamiddle[1] then
    DRAWTEXT(” BEAR ▼”,barindex+0.8,+0.25,SansSerif,Bold,12)coloured(255,0,0)
    Drawtext(“#b#”,barindex-Xoffset-1.35,+0.25,SansSerif,Bold,12)coloured(0,0,0)
    else
    DRAWTEXT(” BULL ▲”,barindex+0.1,+0.25,SansSerif,Bold,12)coloured(0,200,0)
    Drawtext(“#b#”,barindex-Xoffset-1.35,+0.25,SansSerif,Bold,12)coloured(0,0,0)
    endif

    //—adjust Xoffset
    if barindex>1000 then
    Xoffset = 1
    elsif barindex>=20000 then
    Xoffset = 1
    else
    Xoffset = 1

    //—Trend Long
    //Label
    c=round(malong*100)/100
    DRAWTEXT(“Long Sup/Res:”,barindex-Xoffset-8,-0.2,SansSerif,Bold,12)coloured(255,0,0)
    //informations
    if malong<malong[1] then
    DRAWTEXT(” BEAR ▼”,barindex+0.1,-0.2,SansSerif,Bold,12)coloured(255,0,0)
    Drawtext(“#c#”,barindex-Xoffset-1.35,-0.2,SansSerif,Bold,12)coloured(0,0,0)
    else
    DRAWTEXT(” BULL ▲”,barindex+0.1,-0.2,SansSerif,Bold,12)coloured(0,200,0)
    Drawtext(“#c#”,barindex-Xoffset-1.35,-0.2,SansSerif,Bold,12)coloured(0,0,0)
    endif

    //—Stochastic
    //label
    DRAWTEXT(” Stochastic : “,barindex-Xoffset-35,+0.1,SansSerif,Bold,12)coloured(0,0,0)
    //informations
    if myStochastic>80 then
    DRAWTEXT(” Overbought”,barindex-25,+0.1,SansSerif,Bold,12)coloured(0,200,0)
    elsif myStochastic crosses under 80 then
    DRAWTEXT(” Sell▼”,barindex-25,+0.1,SansSerif,Bold,12)coloured(255,0,0)
    elsif myStochastic<20 then
    DRAWTEXT(” Oversold”,barindex-25,+0.1,SansSerif,Bold,12)coloured(255,0,0)
    elsif myStochastic crosses over 20 then
    DRAWTEXT(” Go Long ▲”,barindex-25,+0.1,SansSerif,Bold,12)coloured(0,200,0)
    elsif mystochastic>mystochastic[1] then
    DRAWTEXT(” Rising ▲”,barindex-25,+0.1,SansSerif,Bold,12)coloured(0,200,0)
    elsif mystochastic<mystochastic[1] then
    DRAWTEXT(” Decline ▼”,barindex-25,+0.1,SansSerif,Bold,12)coloured(255,0,0)

    endif
    //Swingcounter
    //label
    DRAWTEXT(“Swingcounter : “,barindex-Xoffset-35,+0.7,SansSerif,Bold,12)coloured(0,0,0)
    Lb=4

    //continue swing Up
    if UpCount>0 and Close>Close[Lb] then
    DownCount=0
    UpCount=UpCount+1

    //draw count
    if UpCount=2 then
    drawtext(” +2″,barindex-27,0.7,SansSerif,Bold,12)coloured(0,200,0)
    elsif UpCount=3 then
    drawtext(” +3″,barindex-27,0.7,SansSerif,Bold,12)coloured(0,200,0)
    elsif UpCount=4 then
    drawtext(” +4″,barindex-27,0.7,SansSerif,Bold,12)coloured(0,200,0)
    elsif UpCount=5 then
    drawtext(” +5″,barindex-27,0.7,SansSerif,Bold,12)coloured(0,200,0)
    elsif UpCount=6 then
    drawtext(” +6″,barindex-27,0.7,SansSerif,Bold,12)coloured(0,200,0)
    elsif UpCount=7 then
    drawtext(” +7″,barindex-27,0.7,SansSerif,Bold,12)coloured(0,200,0)
    elsif UpCount=8 then
    drawtext(” +8″,barindex-27,0.7,SansSerif,Bold,12)coloured(0,200,0)
    elsif UpCount=9 then
    drawtext(” +9″,barindex-27,0.7,SansSerif,Bold,12)coloured(0,200,0)
    last9bar=barindex
    //reset count
    UpCount=0
    endif
    //up swing fail
    elsif UpCount>0 and Close<Close[Lb] then
    //draw fail count
    drawtext(“F”,barindex-29,0.7,SansSerif,Bold,16)coloured(255,0,0)
    //reset count
    UpCount=0
    endif

    //continue swing Down
    if DownCount>0 and Close<Close[Lb] then
    UpCount=0
    DownCount=DownCount+1

    //draw count
    if DownCount=2 then
    drawtext(” -2″,barindex-27,0.7,SansSerif,Bold,12)coloured(255,0,0)
    elsif DownCount=3 then
    drawtext(” -3″,barindex-27,0.7,SansSerif,Bold,12)coloured(255,0,0)
    elsif DownCount=4 then
    drawtext(” -4″,barindex-27,0.7,SansSerif,Bold,12)coloured(255,0,0)
    elsif DownCount=5 then
    drawtext(” -5″,barindex-27,0.7,SansSerif,Bold,12)coloured(255,0,0)
    elsif DownCount=6 then
    drawtext(” -6″,barindex-27,0.7,SansSerif,Bold,12)coloured(255,0,0)
    elsif DownCount=7 then
    drawtext(” -7″,barindex-27,0.7,SansSerif,Bold,12)coloured(255,0,0)
    elsif DownCount=8 then
    drawtext(” -8″,barindex-27,0.7,SansSerif,Bold,12)coloured(255,0,0)
    elsif DownCount=9 then
    drawtext(” -9″,barindex-27,0.7,SansSerif,Bold,12)coloured(255,0,0)
    last9bar=barindex
    //reset count
    DownCount=0
    endif
    //down swing fail
    elsif DownCount>0 and Close>Close[Lb] then
    //draw fail count
    drawtext(“F”,barindex-29,0.7,SansSerif,Bold,16)coloured(0,200,0)
    //reset count
    DownCount=0
    endif

    //begin swing Up
    if UpCount=0 and barindex-last9bar>1 then
    r = close[Lb]
    if close>r then
    UpCount=1
    DownCount=0
    //draw count
    drawtext(” +1″,barindex-27,0.7,SansSerif,Bold,12)coloured(0,200,0)
    endif
    endif

    //begin swing Down
    if DownCount=0 and barindex-last9bar>1 then
    r = close[Lb]
    if close<r then
    DownCount=1
    UpCount=0
    //draw count
    drawtext(” -1″,barindex-27,0.7,SansSerif,Bold,12)coloured(255,0,0)
    endif
    endif
    endif
    endif
    endif

    //Pattern
    //label
    DRAWTEXT(” Candlestick Pattern :”,barindex-Xoffset-38,-0.5,SansSerif,Bold,12)coloured(0,0,0)

    // Trend direction identification
    //(choose 0=No Trend check, 1=MACD, 2=SAR[default], 3=Directional Movement, 4=Moving Averagea crossing, 5=Stochastic)
    TDS=0
    //text color
    // white = 255,255,255 ; black = 0,0,0
    r = 0
    g = 0
    b = 0

    atr = averagetruerange[10](close)*0.50

    body=close-open

    abody=abs(body)

    if range>0 then
    ratio=abody/range
    else
    ratio=0
    endif

    middle=(open+close)/2

    bodytop=max(open, close)

    bodybottom=min(open, close)

    shadowtop=high-bodytop

    shadowbottom=bodybottom-low

    longcandle= (ratio>0.6)

    DojiSize = 0.05
    data=(abs(open – close) <= (high – low) * DojiSize)
    if data then
    DRAWTEXT(“Doji”, barindex, high+atr*0.50, Dialog, Standard, 10) COLOURED(R,G,B)
    endif

    //Trend Detection
    if TDS=0 then
    TrendUp=1
    TrendDown=1
    else
    if TDS=1 then
    TrendUp=(MACDline[12,26,9](close)>0 AND MACD[12,26,9](close)>0)
    TrendDown=(MACDline[12,26,9](close)<0 AND MACD[12,26,9](close)<0)
    else
    if TDS=2 then
    TrendUp=(SAR[0.02,0.02,0.2]<low)
    TrendDown=(SAR[0.02,0.02,0.2]>high)
    else
    if TDS=3 then
    TrendUp=(ADX[14]>23 AND DI[14](close)>0)
    TrendDown=(ADX[14]>23 AND DI[14](close)<0)
    else
    if TDS=4 then
    TrendUp=(Average[3](close)>Average[12](close))
    TrendDown=(Average[3](close)<Average[12](close))
    else
    if TDS=5 then
    TrendUp=(Stochastic[12,3](close)>Average[3](Stochastic[12,3](close)))
    TrendDown=(Stochastic[12,3](close)<Average[3](Stochastic[12,3](close)))
    endif
    endif
    endif
    endif
    endif
    endif

    //Bullish Signal

    BullSeparatingLine=(body[1]<0 AND longcandle[1] AND body>0 AND longcandle AND open>=open[1] AND shadowtop<0.1*abody)
    if BullSeparatingLine then
    DRAWTEXT(” Kickup”,barindex-25,-0.5,SansSerif,Bold,12)coloured(0,200,0)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    MorningStar=(body[2]<0 and body>0 and longcandle[2] and open[1]<close[2] and open>close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and low[1]<low and low[1]<low[2] and high[1]<open[2] and high[1]<close)
    if TrendDown[2] AND MorningStar then
    DRAWTEXT(” Morning star”,barindex-25,-0.5,SansSerif,Bold,12)coloured(0,200,0)
    DRAWARROWUP(barindex-1,low[1]) COLOURED(0,155,10)
    endif

    PiercingLine=(body[1]<0 and body>0 and longcandle[1] and longcandle and open<low[1] and close>middle[1] and close<open[1])
    if TrendDown[2] AND PiercingLine then
    DRAWTEXT(” Piercing Line”,barindex-25,-0.5,SansSerif,Bold,12)coloured(0,200,0)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    AbandonedBabyBottom=(body[2]<0 and body>0 and longcandle[2] and ratio[1]<0.3 and high[1]<low[2] and high[1]<low)
    if TrendDown[2] AND AbandonedBabyBottom then
    DRAWTEXT(” Abandoned Baby”,barindex-25,-0.5,SansSerif,Bold,12)coloured(0,200,0)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishHarami=(body[1]<0 and body>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendDown[2] AND BullishHarami then
    DRAWTEXT(” Bullish Harami”,barindex-25,-0.5,SansSerif,Bold,12)coloured(0,200,0)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    BullishEngulfing=(body[1]<0 and body>0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendDown[2] AND BullishEngulfing then
    DRAWTEXT(” Bullish Engulfing”,barindex-25,-0.5,SansSerif,Bold,12)coloured(0,200,0)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    DragonflyDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
    if TrendDown[2] AND DragonflyDojiBottom then
    DRAWTEXT(” Dragonfly Doji”,barindex-25,-0.5,SansSerif,Bold,12)coloured(0,200,0)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    GravestoneDojiBottom=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
    if TrendDown[2] AND GravestoneDojiBottom then
    DRAWTEXT(” Gravestone Doji”,barindex-25,-0.7,SansSerif,Bold,12)coloured(0,200,0)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    DojiStarBottom=(body[1]<0 AND longcandle[1] AND low<low[1] AND open<close[1] AND ratio<0.3 AND range<0.3*range[1])
    if TrendDown[2] AND DojiStarBottom then
    DRAWTEXT(” Doji”,barindex-25,-0.5,SansSerif,Bold,12)coloured(255,0,0)
    endif

    BullishHaramiCross=(body[1]<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
    if TrendDown[2] AND BullishHaramiCross then
    DRAWTEXT(” Bullish Harami Cross”,barindex-25,-0.5,SansSerif,Bold,12)coloured(0,200,0)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    Hammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
    if TrendDown[2] AND Hammer then
    DRAWTEXT(” Hammer”,barindex-25,-0.7,SansSerif,Bold,12)coloured(0,200,0)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    InvertedHammer=(body[1]<0 and longcandle[1] and low<low[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
    if TrendDown[2] AND InvertedHammer then
    DRAWTEXT(” Inverted Hammer”,barindex-25,-0.6,SansSerif,Bold,12)coloured(0,200,0)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    //Bearish Signal—————————————

    BearSeparatingLine=(body[1]>0 AND longcandle[1] AND body<0 AND longcandle AND open<=open[1] AND shadowbottom<0.1*abody)
    if BearSeparatingLine then
    DRAWTEXT(” Kicker down”,barindex-25,-0.5,SansSerif,Bold,12)coloured(255,0,0)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    EveningStar=(body[2]>0 AND body<0 and longcandle[2] and open[1]>close[2] and open<close[1] and ratio[1]<0.3 and abody[1]<abody[2] and abody[1]<abody and high[1]>high and high[1]>high[2] and low[1]>open[2] and low[1]>close)
    if TrendUp[2] AND EveningStar then
    DRAWTEXT(” Evening Star”,barindex-25,-0.5,SansSerif,Bold,12)coloured(255,0,0)
    DRAWARROWDOWN(barindex-1,high[1]) COLOURED(255,0,10)
    endif

    DarkCloudCover=(body[1]>0 and body<0 and longcandle[1] and longcandle and open>high[1] and close<middle[1] and close>open[1])
    if TrendUp[2] AND DarkCloudCover then
    DRAWTEXT(” Dark Cloud”,barindex-25,-0.5,SansSerif,Bold,12)coloured(255,0,0)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    AbandonedBabyTop=(body[2]>0 and body<0 and longcandle[2] and ratio[1]<0.3 and low[1]>high[2] and low[1]>high)
    if TrendUp[2] AND AbandonedBabyTop then
    DRAWTEXT(” Abandoned Baby”,barindex-25,-0.5,SansSerif,Bold,12)coloured(255,0,0)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishHarami=(body[1]>0 and body<0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1])
    if TrendUp[2] AND BearishHarami then
    DRAWTEXT(” Bearish Harami”,barindex-25,-0.5,SansSerif,Bold,12)coloured(255,0,0)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    BearishEngulfing=(body[1]>0 and body<0 and bodybottom<bodybottom[1] and bodytop>bodytop[1] and longcandle)
    if TrendUp[2] AND BearishEngulfing then
    DRAWTEXT(” Bearish Engulfing”,barindex-25,-0.5,SansSerif,Bold,12)coloured(255,0,0)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,20)
    endif

    DragonflyDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>3*abody and shadowtop<shadowbottom/3)
    if TrendUp[2] AND DragonflyDojiTop then
    DRAWTEXT(” Dragonfly Doji”,barindex-25,-0.5,SansSerif,Bold,12)coloured(255,0,0)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    GravestoneDojiTop=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>3*abody and shadowbottom<shadowtop/3)
    if TrendUp[2] AND GravestoneDojiTop then
    DRAWTEXT(” Gravestone Doji”,barindex-25,-0.5,SansSerif,Bold,12)coloured(255,0,0)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    DojiStarTop=(body[1]>0 AND longcandle[1] AND high>high[1] AND open>close[1] AND ratio<0.3 AND range<0.3*range[1])
    if TrendUp[2] AND DojiStarTop then
    DRAWTEXT(“Doji”,barindex-25,-0.5,SansSerif,Bold,12)coloured(255,0,0)
    endif

    BearishHaramiCross=(body[1]>0 and longcandle[1] and bodybottom>bodybottom[1] and bodytop<bodytop[1] and ratio<0.3 and range<0.3*range[1])
    if TrendUp[2] AND BearishHaramiCross then
    DRAWTEXT(” Bearharami Cross”,barindex-25,-0.5,SansSerif,Bold,12)coloured(255,0,0)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    ShootingStar=(body[1]>0 and longcandle[1] and high>high[1] and shadowtop>2*abody and shadowbottom<0.3*abody)
    if TrendUp[2] AND ShootingStar then
    DRAWTEXT(” Shooting Star”,barindex-25,-0.6,SansSerif,Bold,12)coloured(255,0,0)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    HangingMan=(body[1]>0 and longcandle[1] and high>high[1] and shadowbottom>2*abody and shadowtop<0.3*abody)
    if TrendUp[2] AND HangingMan then
    DRAWTEXT(” Hanging Man “,barindex-25,-0.7,SansSerif,Bold,12)coloured(255,0,0)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    //Gaps
    GapUp=(low>high[1])
    GapDown=(high<low[1])
    if GapUp then
    DRAWTEXT(“G “, barindex, (high[1]+low)/2, Dialog, Bold, 10) COLOURED(0,0,0)
    else
    if GapDown then
    DRAWTEXT(“G “, barindex, (high+low[1])/2, Dialog, Bold, 10) COLOURED(0,0,0)
    endif
    endif

    //Tweezers Top and Bottom
    TweezersTop=(body[1]>0 AND longcandle[1] AND body<=0 AND high=high[1])
    if TrendUp[2] AND TweezersTop then
    DRAWTEXT(” Tweezer Top”, barindex-25,-0.7,SansSerif,Bold,12)coloured(255,0,0)
    DRAWARROWDOWN(barindex,high) COLOURED(255,0,10)
    endif

    TweezersBottom=(body[1]<0 AND longcandle[1] AND body>=0 AND low=low[1])
    if TrendDown[2] AND TweezersBottom then
    DRAWTEXT(” Tweezer Bottom”, barindex-25,-0.7,SansSerif,Bold,12)coloured(0,200,0)
    DRAWARROWUP(barindex,low) COLOURED(0,155,10)
    endif

    // inputs
    Period = 12
    Lookback = 3
    ob = 70
    os = 30

    //calc

    //—indicator RMI
    // Label
    DRAWTEXT(” Rel.Momentum : “,barindex-Xoffset-36,-0.2,SansSerif,Bold,12)coloured(0,0,0)
    momup=max(close-close[lookback],0)
    momdown=max(close[lookback]-close,0)

    up = average[period,1](momup)
    dn = average[period,1](momdown)

    rm=up/dn

    rmi = 100*rm/(1+rm)
    if RMI > ob then
    DRAWTEXT(” Overbought”,barindex-Xoffset-25,-0.2,SansSerif,Bold,12)coloured(0,200,0)
    elsif RMI crosses under ob then
    DRAWTEXT(” Sell ▼”,barindex-25,-0.2,SansSerif,Bold,12)coloured(255,0,0)
    elsif RMI< os then
    DRAWTEXT(” Oversold”,barindex-Xoffset-25,-0.2,SansSerif,Bold,12)coloured(255,0,0)
    elsif RMI crosses over os then
    DRAWTEXT(” Go Long ▲”,barindex-25,-0.2,SansSerif,Bold,12)coloured(0,200,0)
    elsif rmi>=rmi[1] then
    DRAWTEXT(” Rising ▲”,barindex-25,-0.2,SansSerif,Bold,12)coloured(0,200,0)
    elsif rmi<=rmi[1] then
    DRAWTEXT(” Decline ▼”,barindex-25,-0.2,SansSerif,Bold,12)coloured(255,0,0)
    endif

    RETURN

    Hope you like it.

    rgds

    John

avatar
Register or

Top