π¦How to modify the indicator to work with CDZV Toolkit
Code Zero Visual Trading for TradingView
For modification the indicator must be written in pine-script version 5
//@version=5
To integrate with CDZV Toolkit, you can use TradingView indicators that display information using the plot function.
All other indicators that are open source can be easily modified.
CDZV Toolkit processes two types of input information from indicators:
Numeric values (price, volume and any other floating point numeric value).
Signal (this is also a numeric value, but it is limited: 0 - no signal or 1 - signal is present).
These values can be sent from the indicator using the PineScriptplot() function with the parameter display = display.data_window. This parameter indicates that we do not draw anything on the plot, but will be available to the CDZV Toolkit.
// Here the original indicator draws the inscriptions
plotshape(buySignalk[1] and showsignalsk and O1[1] > K2 ? AlphaTrend[2] * 0.9999 : na, title='LONG', text='LONG', location=location.absolute, style=shape.labelup, size=size.tiny, color=color.new(#0022FC, 0), textcolor=color.new(color.white, 0))
plotshape(sellSignalk[1] and showsignalsk and O2[1] > K1 ? AlphaTrend[2] * 1.0001 : na, title='SHORT', text='SHORT', location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.new(color.maroon, 0), textcolor=color.new(color.white, 0))
// Here the original indicator sends alerts
alertcondition(buySignalk[1] and O1[1] > K2, title='Confirmed BUY Alarm', message='BUY SIGNAL APPROVED!')
alertcondition(sellSignalk[1] and O2[1] > K1, title='Confirmed SELL Alarm', message='SELL SIGNAL APPROVED!')
Make modifications to the indicator code:
// We add code to send signals to the CDZV Toolkit
// We define the logic for drawing and sending signals
// and create a plot() object that sends a 0 or 1 signal.
plot(buySignalk[1] and O1[1] > K2 ? 1 : 0, "SIGNAL: BUY", display = display.data_window)
plot(sellSignalk[1] and O2[1] > K1 ? 1 : 0, "SIGNAL: SELL", display = display.data_window)
// The indicator draws fractals from above and below with offset=-n
plotshape(downFractal, style=shape.triangledown, location=location.belowbar, offset=-n, color=#F44336, size = size.small)
plotshape(upFractal, style=shape.triangleup, location=location.abovebar, offset=-n, color=#009688, size = size.small)
add the code that passes the price to CDZV Toolkit:
// get the Low and High price if a fractal was found earlier
if upFractal
last_up_price := high[n]
if downFractal
last_down_price := low[n]
// We add code to send fractal prices to CDZV Toolkit
// create a plot() object that sends a price (a number with a plaΠ²Π°ΡΡΠ΅ΠΉ Π·Π°ΠΏΡΡΠΎΠΉ)
plot(last_up_price, title = 'UP Price', display = display.data_window)
plot(last_down_price, title = 'DOWN Price', display =display.data_window)