Help for graphical indicators development version 10.3
Forums › ProRealTime English forum › ProBuilder support › Help for graphical indicators development version 10.3
- This topic has 41 replies, 13 voices, and was last updated 5 years ago by dan55.
-
-
04/20/2017 at 7:30 PM #32799
I found an issue regarding the arrow, I have tested back and forth with every bar but arrow could not be drawn in Monday (on daily chart).
As I tested further problem become more specific and I found out, it does not run on money on only forex market charts (Works fine in stock market), arrow will always go back to previous bar.
Is it the bug on prorealtime (i don’t think it is the problem with my coding because draw arrow in every bar except Monday)? Hoping to hearing from you soon.
04/25/2017 at 9:32 AM #33294I have a question to the “drawtext” command. I want an indicator to print a value in the upper right corner of the chart and it is suppsossed to stay fixed there also when i scroll back and forth in the chart. How can this be accomblished? What shall i use for X and Y?
04/25/2017 at 10:39 AM #33299@Suraj
Without your code I can’t help more. I know there is an issue on weekly chart though..
@Despair
Already answered in the documentation page of DRAWARROW: X,Y coordinates use respectively barindex and price, not pixels format. So you can’t have fixed anything on chart while zooming or when the time pass by ..
You should have a look on my dashboard creation blog article, you may find suitable ideas for your needs: indicators dashboard prorealtime04/25/2017 at 7:47 PM #3338904/26/2017 at 11:31 AM #33468Hello , im new to this forum And maybe my question isnt for here . But i am looking for a coder to code MACD indicator with adjustable time frame (expample 1d candlestick chart and weekly macd . Where i can post my request or find coder . Thanks you and sorry for bothering you guys . Happy trading .
05/01/2017 at 12:08 PM #34148Again I’m stuck and can’t see why this is failing. Perhaps someone with at sharp eye can spot the error.
I want to draw a line between two HIGH fractal points, but only if the current one is lower than the previous one. (and vice versa for LOW fractalpoints- but first the HIGH). The line should extent until close crosses the line.
This is how far I’ve come. the lines are just all over the place 🙁
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113stopdraw=1MyEMA23=ExponentialAverage[23](close)MyEMA50=ExponentialAverage[50](close)MyEMA200=ExponentialAverage[200](close)//MyADX=ADX[14]>15factor1=10cp=3factor2=5Fractalhigh=high[cp]mybarhigh=barindex[cp]if high[cp] >= highest[2*cp+1](high) thenfractal=high[cp]fractaltest=fractal[1]>fractalLH = 1elseLH=0endif//if low[cp] <= lowest[2*cp+1](low) then//LL= -1//else//LL=0//endifif MyEMA50+factor1<MyEMA200 and MyEMA23<MyEMA50 thenEMAind=-1elsif MyEMA50-factor1>MyEMA200 thenEMAind=1elseEMAind=1endifif LH=1 and EMAind=1 and stopdraw then// and fractaltest thenDRAWARROWUP(barindex[cp], high[cp]+(factor2*pipsize))coloured(0,255,0)if fractaltest theny1=Fractalhigh[1]x1=mybarhigh[1]y2=Fractalhighx2=mybarhighgradient=(y2-y1)/(x2-x1)count=count+1test1=y1[1]-(gradient)*countDRAWsegment(mybarhigh[1],y1[1],barindex+cp,y1[1]-(gradient)*count)coloured(0,0,255)endifif close<test1 then//and fractaltest thenstopdraw=1elsestopdraw =0//y1=0//y2=0endif//DRAWsegment(barindex-count,lower,barindex,lower)coloured(0,0,0)elsecount=0endif//if LL = -1 and EMAind=-1 then//DRAWARROWDOWN(barindex[cp], low[cp]-(factor2*pipsize))coloured(255,0,0)//Fractallow=low[cp]//mybarlow=barindex[cp]//endif//2. The equation of a line through the origin with a given gradient//http://www.mathcentre.ac.uk/resources/uploaded/mc-ty-strtlines-2009-1.pdf//if LH[1] and LH then//y1=Fractalhigh[1]//x1=mybarhigh[1]//y2=Fractalhigh//x2=mybarhigh//gradient=(y1-y2)/(x1-x2)//count=count+1//DRAWsegment(mybarhigh[1]-count,y1[1],barindex,y1+gradient)coloured(0,0,0)////DRAWsegment(barindex-count,lower,barindex,lower)coloured(0,0,0)//else//count=0//endif////if myadx and fractalhigh[1]>fractalhigh and EMAind=1 then////DRAWSEGMENT(mybarhigh[1],Fractalhigh[1],mybarhigh[0],Fractalhigh[0])coloured(0,0,255)////DRAWTEXT("LONG", barindex-6, high[cp]+(factor2*4*pipsize),SansSerif,Italic, 12) coloured(0,255,0)////y1=Fractalhigh[1]////x1=mybarhigh[1]////y2=Fractalhigh////x2=mybarhigh////gradient=(y2-y1)/(x2-x1)////count=count+1////DRAWsegment(mybarhigh[1]-count+1,y1[1],barindex,y1[1]+gradient*count)coloured(0,0,0)////DRAWsegment(barindex-count,lower,barindex,lower)coloured(0,0,0)////else////count=0//endif//if myadx and fractallow[1]<fractallow and EMAind=-1 then////DRAWSEGMENT(mybarlow[1],Fractallow[1],mybarlow[0],Fractallow[0])coloured(0,0,255)//DRAWTEXT("SHORT", barindex-6, high[cp]-(factor2*4*pipsize),SansSerif,Italic, 12) coloured(255,0,0)//endif//RETURN07/08/2017 at 10:51 PM #40144Here is a template for creating an overlay of an indicator which one can usually not place into the charts window. It is mainly intended for scalping (non trending market) where you have your scalping chart adjusted just once (or twice if price is exploding). As usual heavy commenting (that’s just my style).
Use it like this:
- adjust your price chart window, import the layer
- look at what price level your lowest bars/candles are
- in the adjustment for the layer
- put the value of “ZeroLine” a bit below the price level of your bars/candles
- put the “HundredLine” at a value where you think “enough, not into my price bars”
- adjust color not to disturb too much but be unique to see what belongs to it
- maybe little re-adjustment of the zero and Hundred line
When rewriting the code to your needs: You can use it for any indicator having “fixed borders”, means their values cannot exeede a certain value. Example is the RSI which can have only values between 0 and 100. If negative range is involved: do your logic thinking first, load the indicator you want to layer in a separte window with same length, and choose a price chart which has big enough values to do a 1:1 layer for comparing your logic with the original (DAX, CAC, FTSE, DOW). If the result looks ok, change the price chart to something completely different scaling (forex) and check the ratio is working.
Rewriting for something like ATR (which has the ZeroLine as reference but can value-explode straight through the chart depending on the timeframe) should work, but needs a bit more logical thinking.RSI overlay in chart window12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667// === RSI overlay for a chart// --- for PRT 10.3, July 2017, by AVT bigsister-gmt@gmx.de// === Variables Begin// --- variables for calculation// RSIlength: strategy fixed (default: 9), added changing option// --- variables for painting// user MUST define 0-Line and 100-Line position, automatic calculation is a complete mess// ZeroLine: the lowest line, an RSI value cannot be less than 0// HundredLine: the highest line, an RSI value cannot be higher than 100// UpperBorder1, UpperBorder2: strategy fixed (default: 65), added a second one// LowerBorder1, LowerBorder2: strategy fixed (default: 35), added a second one// R,G,B: the values for the red, green and blue part defining an RGB Color Code// --- set limits to the allowed color values (thanks @Nicolas for the code)// logic max(0,R): if a user pushes the ColorNumberingButton to -1,// R returns the maximum value between 0 and users push// which is in this case 0, because 0 is bigger than -1R = max(0,R)R = min(255,R)G = max(0,G)G = min(255,G)B = max(0,B)B = min(255,B)// === Variables End// === Calculation Begin// --- calculating the painting// naming: O(verlay)[U(pper)|L(ower)]WhateverName[1-9]// --- get the range size between zero and hundred line, then get the ratio value for 1 unit// !!! works directly only for indicators which have fixed limits for their highest and lowest valueORange = HundredLine - ZeroLine // rsi limits: 0-100OUnit = ORange / 100 // instead of normal unit=1 we get maybe a ratio unit=0.34 for forex// --- calculate the values of the border lines// logic: a normal upper border of 65 has the 1-unit value of 65 which is added to the 0-line value 0,// so it would be drawn at the y-axis position 65;// we need the ratio unit of 65, because the distance between 0 and 100 is less than normal,// (and add that to the user-defined 0-line position later when drawing)OUBorder1 = UpperBorder1 * OUnitOUBorder2 = UpperBorder2 * OUnitOLBorder1 = LowerBorder1 * OUnitOLBorder2 = LowerBorder2 * OUnit// --- calculate the value of the rsi// RSI in a separate window would simply use a unit of 1 and draw its line between 0 and 100// --- adjust the RSI values to the calculated ratioORSIval = RSI[RSIlength](close) * OUnit // MUST be close, otherwise a mess with DRAWSEGMENTORSIpreval = RSI[RSIlength](close[1]) * OUnit // DRAWSEGMENT needs a begin, that's the previous value// === Calculation End// === Drawing Begin// --- for orientation: limiting zero and 100 line (positions were given by user)DRAWSEGMENT(barindex-1,ZeroLine,barindex,Zeroline) coloured(R,G,B)DRAWSEGMENT(barindex-1,HundredLine,barindex,HundredLine) coloured(R,G,B)// --- the border lines// border distance as ratio value calculated above, add this distance to the zero line to get its y-axis positionDRAWSEGMENT(barindex-1,ZeroLine+OUBorder1,barindex,Zeroline+OUBorder1) coloured(R,G,B)DRAWSEGMENT(barindex-1,ZeroLine+OUBorder2,barindex,Zeroline+OUBorder2) coloured(R,G,B)DRAWSEGMENT(barindex-1,ZeroLine+OLBorder1,barindex,Zeroline+OLBorder1) coloured(R,G,B)DRAWSEGMENT(barindex-1,ZeroLine+OLBorder2,barindex,Zeroline+OLBorder2) coloured(R,G,B)// --- the rsi line// rsi value as ratio value calculated above, add this rsi value to the zero line to get its y-axis positionDRAWSEGMENT(barindex-1,ZeroLine+ORSIpreval,barindex,Zeroline+ORSIval) coloured(R,G,B)// === Drawing EndRETURN// === Program End07/08/2017 at 10:53 PM #4014608/18/2017 at 1:21 PM #44181Is your fractal line drawing still problematic and if yes, could you paint a line into that picture you had attached to show how a line should look like (don’t understand the text you wrote). Then I could see whether I find a way.
02/13/2019 at 10:02 AM #91262Bonjour Nicolas,
je cherche comment faire un indicateur de lignes horizontales dans chaque UT (4h à 1mn par exemple) en temps réel et non statique.
Par exemple : dans l’UT 4H, je traces les lignes (horizontales) MM7 MM20 MM50 BandeBollinger Haut, Bande Bollinger Bas (avec texte et couleur personnalisé)
Il faut aussi que ces lignes apparaissent égalementdans les autres UT plus petites (1h, 15mn…)
Merci d’avance 🙂
02/13/2019 at 11:25 AM #9127502/13/2019 at 12:11 PM #91278123456789<span lang="en" tabindex="0">Hello Nicolas,I am looking for how to make an indicator of horizontal lines in each UT (15MN to 1mn for example) in real time and not static.For example: in the UT 15MN, I trace the lines (horizontal) MM7 MM20 MM50 BandBollinger Top, Band Bollinger Bottom (with text and custom color)It is also necessary that these lines also appear in the other smaller UTs (5/2/1MN ...) in real time (recalculation OF AVERAGE every second)Thanks in advance </span> -
AuthorPosts
Find exclusive trading pro-tools on