ZigZag with percent?
Forums › ProRealTime English forum › ProBuilder support › ZigZag with percent?
- This topic has 4 replies, 3 voices, and was last updated 3 years ago by robertogozzi.
Tagged: zigzag
-
-
08/03/2021 at 1:58 PM #174601
Hi all,
I am fairly new to these forms, but have been looking around for an indicator such as the ZigZag but that also prints the percent of the “rotation” as a bubble on the chart. as seem to be available in some other platforms. Basically, just the ZigZagPct rather than just ZigZag, where we choose a certain threshold for a rotation up or down, and the line is drawn etc, but also when is passes the threshold prints (and updates) the actual percent change no the chart. Much like what for example Brian Watt is using. i have been think of constructing it myself, but I figured someone here is likely to have already done this perhaps. Any tip os help is welcome!
I am attaching a screenshot of an exmple what it might look like
08/03/2021 at 6:00 PM #174627There you go, simply add it to your chart as well as built-in ZigZag:
12345678910111213141516171819202122232425//DEFPARAM DrawOnLastBarOnly = true//ONCE p = 200ONCE LastPeak = 0ONCE Up = 1ONCE Down = -UpONCE PeakUP1 = closeONCE PeakUP2 = closeONCE PeakDN1 = closeONCE PeakDN2 = closeX = average[100,0](range) / 3 //offset to plot percentagesZZ = ZigZagPoint[p](close)PeakUP = (ZZ[1] > ZZ[2]) AND (ZZ < ZZ[1])PeakDN = (ZZ[1] < ZZ[2]) AND (ZZ > ZZ[1])IF PeakUP AND ((LastPeak = Down) OR (LastPeak = 0)) THENLastPeak = UpPeakUPprice = close[1]PerCent = (PeakUPprice * 100 / PeakDNprice) - 100DrawText("#PerCent#",BarIndex[1],high[1] + X,Dialog,Bold,12) coloured(0,128,0,140)ELSIF PeakDN AND ((LastPeak = Up) OR (LastPeak = 0)) THENLastPeak = DownPeakDNprice = close[1]PerCent = (PeakDNprice * 100 / PeakUPprice) - 100DrawText("#PerCent#",BarIndex[1],low[1] - X,Dialog,Bold,12) coloured(255,0,0,255)ENDIFRETURN1 user thanked author for this post.
08/03/2021 at 8:20 PM #174635Great! thank you. this will work fine. thanks a lot for your quick help!
09/03/2021 at 8:32 AM #17670909/04/2021 at 10:17 AM #176775What do you mean by “futur contract in points“?
-
AuthorPosts