'When strategy says long Entire chart turns green , short entire chart red
Dont want like thisTitle says it all, i want like this
When strategy says long Entire chart turns green, previous signal should not matter , It should not paint zebra , green red green...
Gradient background even better if possible.
Complete chart remains green if position size is greater than 0
I tried few solutions but all give zebra , plot , fill , line.fill ...
Newbie friendly answer would help more...
One of the codes i tried ,
//////////
var color bkgcolor = na
var color green = //color.new(color.green,90)
var color red = color.new(color.red,90)
If strategy.position_size > 0 and filter == true
bkgcolor := green
If strategy.position_size < 0 and filter== true
bkgcolor:= red
bgcolor(color= bkgcolor)
///////// Plz help ,
Solution 1:[1]
Complete Fix:
backcolor= color.new(color.white,100)
if IsLong and PLscreen == true
backcolor := color.new(color.green,70)
if IsShort and PLscreen == true
backcolor := color.new(color.red,70)
var tot = 0
tot := bar_index + 1
lowsec =ta.lowest(low,tot)
highsec = ta.highest(high,tot)
p1=plot(highsec,color=color.new(color.green,70))
p2=plot(lowsec,color=color.new(color.red,70))
fill(p1,p2,color=backcolor)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Sigmund Belfort |
