Page 1 of 1

How to move a signal more below in the chart?

Posted: Sun Apr 03, 2022 6:11 pm
by EveryDayBetter
Is it possible to get the green cross (signal) above the red cross to the psoition of the red cross? That can be 2 or three percent under the bar.

Code: Select all

drawShape = false               
if CONDITION IS  FULFILLED
    drawShape := true 

plotshape(drawShape, color=#FFFF00, location=location.belowbar)
 
Image

Re: How to move a signal more below in the chart?

Posted: Wed Feb 01, 2023 11:26 am
by processingclouds
Hey,

Issue: You would like to define the location of the plotshape, by moving it by certain points vertically up or down.

Solution:
This is very much achievable. In plotshape, y coordinate is the value of the series, i.e. your initial parameter setting.

In your case you would like to move the shape certain points below the low position of the bar.

Code: Select all

// © processingclouds

//@version=5
indicator("My script", overlay = true)
plot(close)              
drawShape := true 

plotshape(drawShape ? low - 1 : na, color=#FFFF00, location=location.absolute)
As you can see i have passed a logic operation to the series that if your condition is true than plot at low value - 1, this will move it 1 below the low value. You can change this to any percentage calculation as you like.