Zig Zag with Value
Forums › ProRealTime English forum › ProBuilder support › Zig Zag with Value
- This topic has 6 replies, 4 voices, and was last updated 6 years ago by mikael.
-
-
09/25/2017 at 11:03 AM #47224
Hi guys, Ive been having a look around the forum but cant seem to find anything which shows the value of the zig zag. I have this indicator on MT4 but much prefer Pro Realtime so hoping someone could point me in the right direction!
I’ve attached a picture from the MT4 indicator.
Many Thanks in advance for your help!
09/25/2017 at 2:29 PM #47272- go to Library
- use “view entire library as list”
- in your browser (usually under “Edit”) use “search” and enter “zig”
- this will go through everything with name or tag containing zig(zag)
You will find for example this: https://www.prorealcode.com/prorealtime-indicators/fractals-zigzag/
It is drawing the zigzag lines and putting a square at the end point.
- keep the site open in case you decide for it and for comparing the picture with the code.
- read the code
- the square is done by DRAWTEXT
- open the PRT documentation here: https://www.prorealcode.com/prorealtime-documentation/
- go to graphical
- go to DRAWTEXT (you end up here: https://www.prorealcode.com/documentation/drawtext/ )
- read it
- in Example 3 you find how to display values with DRAWTEXT, so it should be possible to use that indicator as your base.
- keep the site open in case you need to have a second look how it is done.
Download the indicator and import it to your PRT, then use “modify code”
- give the indicator another name like Myfractals-zigzag
- from documentation we know, that the y-value is the price and we need to insert price values as #value# (instead of the squares)
- in the code it’s important, that those are exact values, i.e. nothing like + or * something to create a distance between candle and price for better view:
snip of fractals_zigzag1234567if LH>0 and (lastpoint=-1 or lastpoint=0) thenDRAWSEGMENT(lastX,lastY,TOPx,TOPy) COLOURED(200,0,0,255) // red line from lastX/lastY to TOPx/TOPyDRAWTEXT("■",TOPx,TOPy,Dialog,Bold,20) coloured(200,0,0,255) // red "square" at top with y-value=TOPyif LL<0 and (lastpoint=1 or lastpoint=0) thenDRAWSEGMENT(lastX,lastY,BOTx,BOTy) COLOURED(0,200,0,255) // green line from lastX/lastY to BOTx/BOTyDRAWTEXT("■",BOTx,BOTy,Dialog,Bold,20) coloured(0,200,0,255) // green "square" at bottom with y-value=BOTy- the value for/instead of the red square should be TOPy and for/instead of the green square should be BOTy
- so we change the corresponding lines to:
value for square123DRAWTEXT("#TOPy#",TOPx,TOPy,Dialog,Bold,20) coloured(200,0,0,255) // red "square" at top with y-value=TOPyDRAWTEXT("#BOTy#",BOTx,BOTy,Dialog,Bold,20) coloured(0,200,0,255) // green "square" at bottom with y-value=BOTySave and test, if test ok, done, if not cry 😉
Please note, due to leaving IG I don’t have PRT any longer for testing, but that’s the way I go if I need to create/modify indicators.
09/25/2017 at 3:29 PM #47280uppsss, seems we lost the closing tag for PRT code somewhere on our way.
1234567891011if LH>0 and (lastpoint=-1 or lastpoint=0) thenDRAWSEGMENT(lastX,lastY,TOPx,TOPy) COLOURED(200,0,0,255) // red line from lastX/lastY to TOPx/TOPyDRAWTEXT("■",TOPx,TOPy,Dialog,Bold,20) coloured(200,0,0,255) // red "square" at top with y-value=TOPy// replaced:DRAWTEXT("#TOPy#",TOPx,TOPy,Dialog,Bold,20) coloured(200,0,0,255) // red "square" at top with y-value=TOPyif LL<0 and (lastpoint=1 or lastpoint=0) thenDRAWSEGMENT(lastX,lastY,BOTx,BOTy) COLOURED(0,200,0,255) // green line from lastX/lastY to BOTx/BOTyDRAWTEXT("■",BOTx,BOTy,Dialog,Bold,20) coloured(0,200,0,255) // green "square" at bottom with y-value=BOTy// replaced:DRAWTEXT("#BOTy#",BOTx,BOTy,Dialog,Bold,20) coloured(0,200,0,255) // green "square" at bottom with y-value=BOTy09/25/2017 at 3:31 PM #4728109/25/2017 at 3:40 PM #47283Hihihi, I was just going to write a note, that I have difficulties when deleting text after PRT code and catching the end-pre tag with that (missing “toggle control characters”).
Thanks a lot for watching.
1 user thanked author for this post.
09/25/2017 at 8:42 PM #4730401/19/2018 at 10:31 PM #59935 -
AuthorPosts
Find exclusive trading pro-tools on